CN109871231B - Code sharing method and system - Google Patents
Code sharing method and system Download PDFInfo
- Publication number
- CN109871231B CN109871231B CN201910037381.3A CN201910037381A CN109871231B CN 109871231 B CN109871231 B CN 109871231B CN 201910037381 A CN201910037381 A CN 201910037381A CN 109871231 B CN109871231 B CN 109871231B
- Authority
- CN
- China
- Prior art keywords
- code
- client
- information
- debugging
- receiving
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000012360 testing method Methods 0.000 claims abstract description 42
- 238000012550 audit Methods 0.000 claims abstract description 10
- 238000012790 confirmation Methods 0.000 claims abstract description 9
- 238000004088 simulation Methods 0.000 claims description 16
- 238000000605 extraction Methods 0.000 claims description 2
- 230000000977 initiatory effect Effects 0.000 claims description 2
- 230000008569 process Effects 0.000 description 6
- 239000012634 fragment Substances 0.000 description 5
- 238000007726 management method Methods 0.000 description 4
- 238000011161 development Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a code sharing method and a system, wherein the method comprises the following steps: receiving a code search request sent by a first client, and feeding back code information to the first client; receiving incremental codes which are sent by the first client and added for the code segments/code sets in the code information, and forwarding the incremental codes to a second client; after receiving confirmation information sent by the second client and used for representing that the incremental code passes the audit, storing the code segment/code set integrated with the incremental code, and sending a code information iteration instruction to the first client; and receiving and storing code iteration information sent by the first client, wherein the code iteration information is used for ensuring that the code segments/code sets integrated with the incremental codes complete debugging and testing. The technical scheme provided by the application can improve the real-time performance and feasibility of code sharing.
Description
Technical Field
The invention relates to the technical field of internet, in particular to a code sharing method and system.
Background
With the continuous development of software engineering technology, more and more functions can be realized in a programming mode. In actual practice, there may be duplicate functions in different programming projects. To improve the efficiency of the development of programming projects, the code that implements these duplicate functions may be shared, thereby saving the effort to rewrite the code.
However, currently when implementing code sharing, it is common for programmers to publish code requirements in forums or groups and then for other programmers to provide corresponding code. Such a method has many problems, on one hand, the real-time performance and efficiency of code sharing are low, and if few programmers are active in the forum, the needed programmers cannot be provided with codes in time. On the other hand, the shared code cannot guarantee feasibility, and the code provided by other programmers may only be applicable to the project of the programmer, and cannot guarantee normal operation after the code segment is extracted.
Therefore, a code sharing method with high real-time performance and high code feasibility is needed.
Disclosure of Invention
The application aims to provide a code sharing method and a system, which can improve the real-time performance and feasibility of code sharing.
In order to achieve the above object, an aspect of the present application provides a code sharing method, where the method is applied in a code sharing system, and the method includes: receiving a code search request sent by a first client, and feeding back code information matched with keywords in the code search request to the first client, wherein the code information is uploaded by a second client and at least comprises a code segment/code set for completing debugging; receiving incremental codes which are sent by the first client and added for the code segments/code sets in the code information, and forwarding the incremental codes to the second client; after receiving confirmation information which is sent by the second client and represents that the incremental code passes the examination, storing the code segment/code set integrated with the incremental code, and sending a code information iteration instruction to the first client; and receiving and storing code iteration information sent by the first client, wherein the code iteration information is used for ensuring that the code segments/code sets integrated with the incremental codes complete debugging and testing.
To achieve the above object, another aspect of the present application further provides a code sharing system, including: the code information feedback unit is used for receiving a code search request sent by a first client and feeding back code information matched with keywords in the code search request to the first client, wherein the code information is uploaded by a second client and at least comprises a code segment/code set for completing debugging; an incremental code forwarding unit, configured to receive an incremental code added for a code segment/code set in the code information from the first client, and forward the incremental code to the second client; the iteration prompting unit is used for storing the code segment/code set integrated with the incremental code after receiving confirmation information sent by the second client and used for representing that the incremental code passes the audit, and sending a code information iteration instruction to the first client; and the iteration information storage unit is used for receiving and storing code iteration information sent by the first client, and the code iteration information is used for ensuring that the code segments/code sets integrated with the incremental codes complete debugging and testing.
Therefore, according to the technical scheme provided by the application, the code segments/code sets to be shared can be uploaded to the code sharing system by a programmer through a client, and the code segments/code sets uploaded to the code sharing system are debugged, so that the code segments/code sets in the code sharing system can be guaranteed to run normally. Further, the code sharing system may be provided with a code search function. When a programmer wants to search for codes with specific functions, keywords can be provided to the code sharing system through the client, so that the code sharing system can feed back corresponding codes to the code sharing system in time. Subsequently, if the programmer needs to modify the code when using the code fed back by the code sharing system, the programmer can send the added delta code to the code sharing system through the client, and then the code sharing system forwards the delta code to an uploader of the code. After the incremental code is checked by the uploader to be correct, the incremental code can be integrated into the original code. The code sharing system may then notify the uploader of the delta code to provide code iteration information that may be used to ensure that the code segment/code collection into which the delta code is integrated can be debugged and tested normally, thereby making the modified code in the code sharing system feasible. Therefore, the technical scheme provided by the application can improve the real-time performance and feasibility of code sharing.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a code sharing method in an embodiment of the invention;
FIG. 2 is a flow chart illustrating operation of a second client in an embodiment of the present invention;
FIG. 3 is a schematic diagram of code debugging in an embodiment of the invention;
FIG. 4 is a flowchart illustrating operation of a first client according to an embodiment of the present invention;
fig. 5 is a functional module diagram of a code sharing system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The application provides a code sharing method which can be applied to a code sharing system. In practical application, the code sharing system can be installed in a terminal device of a user in a software mode. When the terminal equipment runs the software, the terminal equipment can establish communication connection with the code sharing system, so that data interaction can be carried out with the code sharing system.
Referring to fig. 1, a code sharing method according to an embodiment of the present application may include the following steps.
S1: receiving a code search request sent by a first client, and feeding back code information matched with keywords in the code search request to the first client, wherein the code information is uploaded by a second client and at least comprises a code segment/code set for completing debugging.
In this embodiment, a programmer may upload code to the code sharing system through a client. The client may refer to a terminal device used by a programmer, and may also be a software program of the code sharing system running in the terminal device. The code may be divided into various types according to actual situations. For example, the code may be a code segment, or may be a code set composed of a plurality of code segments. The code set may be, for example, an SDK (Software Development Kit) or an API (Application Programming Interface).
Referring to fig. 2, in this embodiment, assuming that the code uploader uses the second client, the code sharing system may receive an initial code segment/code set uploaded by the second client, where the initial code segment/code set may be code that has not been debugged and may not necessarily run normally. In addition, the second client may also upload remark information of the initial code segment/code set, where the remark information may be used to characterize the functions implemented by the initial code segment/code set.
After the initial code segment/code set and the remark information thereof are uploaded, in order to ensure that the code can normally run, a programmer needs to complete a debugging process of the uploaded initial code in the second client. In particular, in the code sharing system, an underlying code debugging environment may be preconfigured, which may be enabled in the second client. In this way, the second client may debug the initial code segment/set of code in the code debugging environment. After some defects possibly occurring in the debugging process are solved, the code segments/code sets after the debugging is finished can be obtained. In this case, the second client may upload the code snippet/code set that completed the debugging into the code sharing system. In this way, the code sharing system can replace the original initial code with a piece/set of code that becomes debugged.
In this embodiment, after the second client completes the code debugging, in order to further ensure that the code fragments/code sets after completing the debugging can be better applied to software projects of other users, a test Case (Tset Case) may be configured for the code fragments/code sets after completing the debugging. The test case may be a set of test data compiled for a specific target, an execution condition under which test data is input into a code fragment/code set that completes debugging, and an expected result. Of course, in some application scenarios, a programmer may not have time to write test cases of code, but may give guidance information for implementing the test cases. The guidance information may be, for example, an idea or scheme for implementing the test case. In this way, after receiving the code segment/code set that completes debugging, the code sharing system may also receive the test case corresponding to the code segment/code set that completes debugging uploaded by the second client or the guidance information for implementing the test case. To this end, the second client may upload the debugged code fragments/code sets equipped with test cases (or guidance information) in the code sharing system.
In one embodiment, since the code segments/code sets in the code sharing system are used by other users, the other users may modify the code segments/code sets during the use process. In view of this, when the second client uploads the code segment/code set for which the debugging is completed, the second client may also configure permission information for the code segment/code set for which the debugging is completed, where the permission information may define an access manner of the code segment/code set for which the debugging is completed. For example, the access mode may be "read only", "anyone can modify", or "can only submit modification instructions by a specified mode", etc.
In addition, in order to facilitate other users to accurately search the code, the second client may further set a keyword for the code segment/code set that completes debugging, where the keyword may be set based on the function implemented by the code. In this way, the key may be used to search the code sharing system for the code snippet/code set for which debugging is complete.
In this embodiment, the above-mentioned debugged code segments/code sets, remark information, authority information, and other contents may be integrated into code information in the code sharing system, and the code information may be associated with configured keywords. A user needing to acquire a code can send a code search request to the code sharing system through the first client, and keywords can be included in the code search request. In this way, the code sharing system can query the code information matched with the keyword through a built-in search engine and feed the queried code information back to the first client.
S3: receiving the incremental code added for the code segments/code sets in the code information from the first client, and forwarding the incremental code to the second client.
In this embodiment, after receiving the code information, the first client may analyze the content of the code segment/code set, the remark information, the authority information, and the like. Then, in order to ensure that the code in the code information can normally run, the first client may enable a code debugging environment in the code sharing system, and debug the analyzed code through the code debugging environment. In practical applications, in order to occupy the code debugging environment in the code sharing system indefinitely, the first client may set a debugging validity period of the code debugging environment together when the code debugging environment in the code sharing system is enabled. The debug validity period may be a period of using the code debug environment estimated by the user of the first client, and the code sharing system may set an upper limit value for the debug validity period, where the debug validity period set by the first client cannot exceed the upper limit value. In this way, after the code sharing system enables the pre-configured code debugging environment in the first client, the debugging validity period set by the first client for the code debugging environment can be further received. Then, the code sharing system can debug the code segments/code sets in the code information by using the code debugging environment, and automatically close the code debugging environment when the debugging duration reaches the debugging effective period, so that the code debugging environment is released to other users for use.
In one embodiment, if a code debugging environment in a code sharing system is to be used normally, some pre-services corresponding to the code debugging environment need to be enabled in advance before the code debugging environment is enabled. That is, the code sharing system may query a pre-service corresponding to the code debugging environment to be enabled, and enable the pre-service. After the pre-services are enabled, the code debugging environment may be enabled normally in the first client.
Referring to fig. 3, in an embodiment, when debugging the parsed code segment/code set through the enabled code debugging environment, the first client needs to enter some simulation parameters for debugging for the SDK or API type code, and these simulation parameters may enable the SDK or API to obtain an expected result when debugging in the code debugging environment. That is, the code sharing system may receive simulation parameters transmitted by the first client, debug the code segments/code sets in the code debugging environment based on the simulation parameters, and then feed back a debugging result adapted to the simulation parameters to the first client. If the debug result matches the expected result, it indicates that the debug passed. And if the expected result is not met, the debugging is not passed, at the moment, the first client side can feed back prompt information of debugging errors to the code sharing system, the prompt information can be forwarded to the second client side by the code sharing system, and the second client side finishes the debugging process of uploading codes.
Referring to fig. 4, in an embodiment, after the parsed code segments/code sets are debugged, the first client may integrate the code segments/code sets into a system built by the first client. Specifically, the first client may integrate the code segment/code set and the unit test case of the code segment/code set into a system currently built in the first client. In addition, the first client may further integrate the automated test information of the code segments/code sets into a currently constructed system in the first client based on the test cases or the guidance information obtained by analyzing the code information. For example, when a search engine system is currently constructed by a first client, the first client may acquire a code segment corresponding to a search function from a code sharing system, and after the code segment is debugged, the code segment may be integrated into the constructed search engine system according to a unit test case and an automatic test case (or guidance information) corresponding to the code segment, thereby saving time for developing a code with the search function.
In this embodiment, after the code segment/code set obtained through parsing is debugged, the user of the first client may add an incremental code to the debugged code segment/code set, so that an additional function is implemented by the added incremental code. The first client may send the added delta code to the code sharing system, and the code sharing system forwards the delta code to the second client of the uploader of the original code, and the user of the second client verifies whether the delta code can be merged into the original code.
In practical applications, the first client may request the merging of the delta code from the second client by way of pullrequest. Specifically, when the second client needs to add the delta code, a code branch may be created in the code sharing system, and the delta code is added to the code segment/code set in the code branch. Then, the first client may send a pullrequest carrying the incremental code to the code sharing system, and after receiving the request carrying the incremental code sent by the first client, the code sharing system may forward the request to the second client. In this way, the second client can extract the delta code from the request and perform a review. Certainly, the code sharing system may further extract the incremental code from the branch merge request, and then forward the extracted incremental code to the second client for auditing.
S5: and after receiving confirmation information which is sent by the second client and used for representing that the incremental code passes the audit, storing the code segment/code set integrated with the incremental code, and sending a code information iteration indication to the first client.
In this embodiment, after the second client completes the audit on the incremental code, the second client may feed back confirmation information indicating that the incremental code passes the audit to the code sharing system. After receiving the confirmation information, the code sharing system may store the code segment/code set integrated with the incremental code, and send a code information iteration indication to the first client. The code information iteration indication may indicate that the delta code has passed an audit. After receiving the code information iteration indication, the first client needs to update various information of the code segment/code set integrated with the incremental code. For example, the first client needs to update the functional description information of the code. Due to the addition of the incremental code, the modified code has some new functionality. At this time, the first client may send function update information to the code sharing system, where the function update information may be used to describe a function implemented by the code segment/code set into which the delta code is integrated.
S7: and receiving and storing code iteration information sent by the first client, wherein the code iteration information is used for ensuring that the code segments/code sets integrated with the incremental codes complete debugging and testing.
In this embodiment, the first client further needs to debug the code segment/code set integrated with the incremental code. The specific debugging process is consistent with the process of debugging the original code by the second client, and is not described herein again.
After the code debugging is completed, the first client can further provide an automatic test case of the new code or guidance information for realizing the automatic test case. Then, the first client may send code iteration information to the code sharing system, where the code iteration information may include a notification of completion of debugging, and may also include the provided automated test case or guidance information. In this way, the code iteration information may be used to ensure that the code segment/code assembly into which the incremental code is integrated can successfully complete debugging and testing. After receiving the function update information, the code sharing system can update the version identification of the code. Specifically, the original code uploaded by the second client may have an initial version identifier, and the code sharing system may update the initial version identifier after receiving the code iteration information fed back by the first client, and allocate the updated version identifier to the code segment/code set integrated with the incremental code. For example, the code sharing system may add 1 to the initial version identification and assign the 1-added identification to the code snippet/code set that integrates the incremental code. In this way, in the code sharing system, the code segments/code sets of the respective versions can be provided, and the code segments/code sets of each version can be provided with respective version identifiers, so that other users can select the code segments/code sets according to their own requirements.
In one embodiment, some other clients have previously integrated the original code uploaded by the second client into their own system, and then after the delta code is provided by the first client, the code sharing system may send a code update prompting message to other clients currently using the code segments/code sets contained in the code information, so that the other clients update the code segments/code sets currently used to the code segments/code sets integrated with the delta code. Of course, other clients may or may not update the original code according to actual needs, which is not limited in this application.
Referring to fig. 5, the present application further provides a code sharing system, including:
the code information feedback unit is used for receiving a code search request sent by a first client and feeding back code information matched with keywords in the code search request to the first client, wherein the code information is uploaded by a second client and at least comprises a code segment/code set for completing debugging;
an incremental code forwarding unit, configured to receive an incremental code added for a code segment/code set in the code information from the first client, and forward the incremental code to the second client;
the iteration prompting unit is used for storing the code segment/code set integrated with the incremental code after receiving confirmation information sent by the second client and used for representing that the incremental code passes the audit, and sending a code information iteration instruction to the first client;
and the iteration information storage unit is used for receiving and storing code iteration information sent by the first client, and the code iteration information is used for ensuring that the code segments/code sets integrated with the incremental codes complete debugging and testing.
In one embodiment, the code information feedback unit includes:
an initial code receiving module, configured to receive an initial code segment/code set uploaded by the second client and remark information of the initial code segment/code set, where the remark information is used to characterize a function implemented by the initial code segment/code set;
the debugging enabling module is used for enabling a pre-configured code debugging environment in the second client and completing debugging on the initial code segment/code set in the code debugging environment;
and the test information receiving module is used for receiving the code segments/code sets which are uploaded by the second client and finish debugging, and the test cases corresponding to the code segments/code sets which finish debugging or the guide information for realizing the test cases.
In one embodiment, the code information feedback unit further includes:
the permission information receiving module is used for receiving permission information uploaded by the second client, and the permission information is used for limiting the access mode of the code segments/code sets which are debugged;
and the keyword receiving module is used for receiving keywords set by the second client for the code segments/code sets which are debugged, and the keywords are used for searching the code segments/code sets which are debugged in the code sharing system.
In one embodiment, the system further comprises:
the debugging starting unit is used for starting a pre-configured code debugging environment in the first client and receiving a debugging validity period set by the first client for the code debugging environment;
and the code debugging unit is used for debugging the code segments/code sets in the code information by using the code debugging environment, and closing the code debugging environment after the debugging duration reaches the debugging effective period.
In one embodiment, the debug initiation unit comprises:
the pre-service starting module is used for inquiring the pre-service corresponding to the code debugging environment to be started and starting the pre-service;
a debug environment enabling module for enabling the code debug environment in the first client after the pre-service is enabled.
In one embodiment, the code debugging unit includes:
the simulation parameter receiving module is used for receiving simulation parameters transmitted by the first client side and debugging the code segments/code sets in the code debugging environment on the basis of the simulation parameters;
and the debugging result feedback module is used for feeding back the debugging result matched with the simulation parameter to the first client.
In one embodiment, the incremental code forwarding unit comprises:
a branch merge request receiving module, configured to receive a branch merge request carrying an incremental code sent by the first client after the first client creates a code branch and adds the incremental code to the code segment/code set in the code branch;
and the code extraction module is used for extracting the incremental code from the branch merging request and forwarding the extracted incremental code to the second client.
In one embodiment, the system further comprises:
and the function updating information storage unit is used for receiving and storing the function updating information uploaded by the first client, and the function updating information is used for describing the functions realized by the code segments/code sets integrated with the incremental codes.
In one embodiment, the system further comprises:
and the updating prompting unit is used for sending code updating prompting information to other clients which are currently using the code segments/code sets contained in the code information so that the other clients update the currently used code segments/code sets into the code segments/code sets integrated with the incremental codes.
It should be noted that, in the code sharing system in this specification, a specific implementation manner may refer to the description of the method implementation manner, and details are not described here.
In practical application, the code sharing system can be provided with a user operation interface in a client. Various functions of the code sharing system can be displayed in the user operation interface. For example, a code retrieval function, a code version iterative query function, a code debugging environment management function, a message notification management function, an automated test management function, a code audit function, a code authority control function, a keyword management function, an online chat function, and the like may be exhibited. The code version iterative query function may query versions of three types of codes, i.e., a code fragment, an SDK, and an API, respectively.
Therefore, according to the technical scheme provided by the application, the code segments/code sets to be shared can be uploaded to the code sharing system by a programmer through the client, and the code segments/code sets uploaded to the code sharing system are all debugged, so that the code segments/code sets in the code sharing system can be guaranteed to be normally operated. Further, the code sharing system may be provided with a code search function. When a programmer wants to search for codes with specific functions, keywords can be provided to the code sharing system through the client, so that the code sharing system can feed back corresponding codes to the code sharing system in time. Subsequently, if the programmer needs to modify the code when using the code fed back by the code sharing system, the programmer can send the added delta code to the code sharing system through the client, and then the code sharing system forwards the delta code to an uploader of the code. After the incremental code is checked to be correct by the uploader, the incremental code can be integrated into the original code. The code sharing system may then notify the uploader of the delta code to provide code iteration information that may be used to ensure that the code segment/code collection into which the delta code is integrated can be debugged and tested normally, thereby making the modified code in the code sharing system feasible. Therefore, the technical scheme provided by the application can improve the real-time performance and feasibility of code sharing.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and can also be implemented by hardware. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the various embodiments or some parts of the embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (21)
1. A code sharing method, wherein the method is applied to a code sharing system, and the method comprises:
receiving a code search request sent by a first client, and feeding back code information matched with keywords in the code search request to the first client, wherein the code information is uploaded by a second client and at least comprises a code segment/code set for completing debugging;
receiving incremental codes added for the code segments/code sets in the code information sent by the first client, and forwarding the incremental codes to the second client so that a user of the second client can check whether the incremental codes can be merged into the code segments/code sets in the code information;
after receiving confirmation information sent by the second client and used for representing that the incremental code passes the audit, storing the code segment/code set integrated with the incremental code, and sending a code information iteration instruction to the first client;
and receiving and storing code iteration information sent by the first client, wherein the code iteration information is used for ensuring that the code segments/code sets integrated with the incremental code complete debugging and testing, and the code iteration information comprises a notification of debugging completion and test case or guide information.
2. The method of claim 1, wherein the code information is uploaded to the code sharing system as follows:
receiving an initial code segment/code set uploaded by the second client and remark information of the initial code segment/code set, wherein the remark information is used for representing functions realized by the initial code segment/code set;
starting a pre-configured code debugging environment in the second client, and completing debugging on the initial code segments/code sets in the code debugging environment;
and receiving the code segments/code sets which are uploaded by the second client and finish debugging, and the test cases corresponding to the code segments/code sets which finish debugging or the guide information for realizing the test cases.
3. The method of claim 2, further comprising:
receiving authority information uploaded by the second client, wherein the authority information is used for limiting the access mode of the code segments/code sets which are debugged;
and receiving a keyword set by the second client for the code segment/code set which completes debugging, wherein the keyword is used for searching the code segment/code set which completes debugging in the code sharing system.
4. The method of claim 1, wherein after feeding back code information to the first client that matches keywords in the code search request, the method further comprises:
starting a pre-configured code debugging environment in the first client, and receiving a debugging validity period set by the first client for the code debugging environment;
and debugging the code segments/code sets in the code information by using the code debugging environment, and closing the code debugging environment after the debugging duration reaches the debugging effective period.
5. The method of claim 4, wherein enabling the preconfigured code debugging environment in the first client comprises:
inquiring a pre-service corresponding to the code debugging environment to be started, and starting the pre-service;
after the pre-service is enabled, enabling the code debugging environment in the first client.
6. The method of claim 4 or 5, wherein debugging the code segment/code set in the code information using the code debugging environment comprises:
receiving simulation parameters transmitted by the first client, and debugging the code segments/code sets in the code debugging environment based on the simulation parameters;
and feeding back the debugging result matched with the simulation parameter to the first client.
7. The method of claim 1, wherein after feeding back code information matching keywords in the code search request to the first client, the method further comprises:
and the first client integrates the code segments/code sets and the unit test cases of the code segments/code sets into a system currently built in the first client.
8. The method according to claim 7, wherein the code information further includes a test case corresponding to the code segment/code set or guidance information for implementing the test case;
accordingly, the method further comprises:
and the first client integrates the automatic test information of the code segments/code sets into a system currently constructed in the first client based on the test cases or the guide information.
9. The method of claim 1, wherein receiving delta code added for a code segment/code set in the code information from the first client comprises:
after the first client creates a code branch and adds an incremental code to the code segment/code set in the code branch, receiving a branch merging request which carries the incremental code and is sent by the first client;
accordingly, forwarding the delta code to the second client comprises:
and extracting the delta code from the branch combination request, and forwarding the extracted delta code to the second client.
10. The method of claim 1, wherein after sending the code information iteration indication to the first client, the method further comprises:
and receiving and storing function updating information uploaded by the first client, wherein the function updating information is used for describing functions realized by the code segments/code sets integrated with the incremental codes.
11. The method of claim 1, wherein the code segments/code sets in the code information are provided with an initial version identification; accordingly, after receiving and storing the code iteration information sent by the first client, the method further comprises:
and updating the initial version identification and distributing the updated version identification to the code segments/code sets integrated with the incremental codes.
12. The method of claim 1, wherein after receiving and storing code iteration information sent by the first client, the method further comprises:
sending code update prompt information to other clients currently using the code segments/code sets contained in the code information so that the other clients update the code segments/code sets currently used into the code segments/code sets integrated with the delta code.
13. A code sharing system, the system comprising:
the code information feedback unit is used for receiving a code search request sent by a first client and feeding back code information matched with keywords in the code search request to the first client, wherein the code information is uploaded by a second client and at least comprises a code segment/code set for completing debugging;
an incremental code forwarding unit, configured to receive an incremental code added for a code segment/code set in the code information from the first client, and forward the incremental code to the second client, so that a user of the second client checks whether the incremental code can be merged into the code segment/code set in the code information;
the iteration prompting unit is used for storing the code segment/code set integrated with the incremental code after receiving confirmation information sent by the second client and used for representing that the incremental code passes the audit, and sending a code information iteration instruction to the first client;
and the iteration information storage unit is used for receiving and storing code iteration information sent by the first client, and the code iteration information is used for ensuring that the code segments/code sets integrated with the incremental codes complete debugging and testing, wherein the code iteration information comprises a debugging completion notice and test case or guide information.
14. The system of claim 13, wherein the code information feedback unit comprises:
the initial code receiving module is used for receiving an initial code segment/code set uploaded by the second client and remark information of the initial code segment/code set, wherein the remark information is used for representing the function realized by the initial code segment/code set;
the debugging enabling module is used for enabling a pre-configured code debugging environment in the second client and completing debugging on the initial code segment/code set in the code debugging environment;
and the test information receiving module is used for receiving the code segments/code sets which are uploaded by the second client and finish debugging, and the test cases corresponding to the code segments/code sets which finish debugging or the guide information for realizing the test cases.
15. The system of claim 14, wherein the code information feedback unit further comprises:
the permission information receiving module is used for receiving permission information uploaded by the second client, and the permission information is used for limiting the access mode of the code segments/code sets which are debugged;
and the keyword receiving module is used for receiving keywords set by the second client for the code segments/code sets which are debugged, and the keywords are used for searching the code segments/code sets which are debugged in the code sharing system.
16. The system of claim 13, further comprising:
the debugging starting unit is used for starting a pre-configured code debugging environment in the first client and receiving a debugging validity period set by the first client for the code debugging environment;
and the code debugging unit is used for debugging the code segments/code sets in the code information by using the code debugging environment, and closing the code debugging environment after the debugging duration reaches the debugging effective period.
17. The system of claim 16, wherein the debug initiation unit comprises:
the pre-service starting module is used for inquiring the pre-service corresponding to the code debugging environment to be started and starting the pre-service;
and the debugging environment starting module is used for starting the code debugging environment in the first client after the preposed service is started.
18. The system according to claim 16 or 17, wherein the code debugging unit comprises:
the simulation parameter receiving module is used for receiving simulation parameters transmitted by the first client and debugging the code segments/code sets in the code debugging environment based on the simulation parameters;
and the debugging result feedback module is used for feeding back the debugging result matched with the simulation parameter to the first client.
19. The system of claim 13, wherein the incremental code forwarding unit comprises:
a branch merge request receiving module, configured to receive a branch merge request carrying an incremental code sent by the first client after the first client creates a code branch and adds the incremental code to the code segment/code set in the code branch;
and the code extraction module is used for extracting the incremental code from the branch merging request and forwarding the extracted incremental code to the second client.
20. The system of claim 13, further comprising:
and the function updating information storage unit is used for receiving and storing the function updating information uploaded by the first client, and the function updating information is used for describing the functions realized by the code segments/code sets integrated with the incremental codes.
21. The system of claim 13, further comprising:
and the updating prompting unit is used for sending code updating prompting information to other clients which are currently using the code segments/code sets contained in the code information so that the other clients update the currently used code segments/code sets into the code segments/code sets integrated with the incremental codes.
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 CN109871231A (en) | 2019-06-11 |
CN109871231B true 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 (4)
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10754761B2 (en) * | 2016-11-11 | 2020-08-25 | Atlassian Pty Ltd | Systems and methods for testing source code |
-
2019
- 2019-01-15 CN CN201910037381.3A patent/CN109871231B/en not_active Expired - Fee Related
Patent Citations (4)
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 |
Also Published As
Publication number | Publication date |
---|---|
CN109871231A (en) | 2019-06-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11893385B2 (en) | Methods and systems for automated software natural language documentation | |
US9588752B2 (en) | Performing unattended software installation | |
CN111158674B (en) | Component management method, system, device and storage medium | |
CN109032662B (en) | Code file generation method and device, computer equipment and storage medium | |
CN108319575B (en) | Page component checking method, device, server and storage medium | |
CN107797823B (en) | Business rule management method and device, storage medium and computer equipment | |
CN111737227A (en) | Data modification method and system | |
CN112395307A (en) | Statement execution method, statement execution device, server and storage medium | |
CN112215015B (en) | Translation text revision method, device, computer equipment and storage medium | |
US10599424B2 (en) | Committed program-code management | |
CN112732367A (en) | Event flow processing method, device and equipment and readable storage medium | |
CN109871231B (en) | Code sharing method and system | |
CN113821486B (en) | Method and device for determining dependency relationship between pod libraries and electronic equipment | |
CN113495723B (en) | Method, device and storage medium for calling functional component | |
US11573773B2 (en) | Methods and systems for correlating source code commitments and model result records during model development | |
US11301246B2 (en) | Automatically generating continuous integration pipelines | |
CN114281688A (en) | Codeless or low-code automatic case management method and device | |
CN113722228A (en) | Software system testing method and device | |
CN114371866A (en) | Version reconfiguration test method, device and equipment of service system | |
CN106681914B (en) | Television picture quality debugging method and device | |
CN116680203B (en) | Multi-tenant-oriented SaaS platform testing method, device, equipment and medium | |
CN112905153B (en) | Software parallel construction method and device for software defined satellite | |
CN115422241A (en) | Data query method, device, equipment and medium | |
CN118363654A (en) | Data processing method and device and terminal equipment | |
KR20230036672A (en) | Devices and Control Methods Related to Web Platform Validation |
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 |
Granted publication date: 20220930 |
|
CF01 | Termination of patent right due to non-payment of annual fee |