CN117130647A - Code management method, device and system - Google Patents

Code management method, device and system Download PDF

Info

Publication number
CN117130647A
CN117130647A CN202311084624.1A CN202311084624A CN117130647A CN 117130647 A CN117130647 A CN 117130647A CN 202311084624 A CN202311084624 A CN 202311084624A CN 117130647 A CN117130647 A CN 117130647A
Authority
CN
China
Prior art keywords
component
code
client
functional
management server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311084624.1A
Other languages
Chinese (zh)
Inventor
刘治夏
徐振伟
韩永斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Geely Holding Group Co Ltd
Zhejiang Zeekr Intelligent Technology Co Ltd
Original Assignee
Zhejiang Geely Holding Group Co Ltd
Zhejiang Zeekr Intelligent 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 Zhejiang Geely Holding Group Co Ltd, Zhejiang Zeekr Intelligent Technology Co Ltd filed Critical Zhejiang Geely Holding Group Co Ltd
Priority to CN202311084624.1A priority Critical patent/CN117130647A/en
Publication of CN117130647A publication Critical patent/CN117130647A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a code management method, a device and a system. The method is applied to a component management server associated with a code warehouse, and comprises the following steps: receiving and maintaining related information of a function component provided by the code warehouse, wherein the function component is used for realizing a preset function, and a source code of the function component is submitted to the code warehouse by a component development client for storage; the component is assisted in obtaining the source code using a client based on the relevant information.

Description

Code management method, device and system
Technical Field
The present invention relates to the field of software development, and in particular, to a code management method, device and system.
Background
In order to improve the software development efficiency, code sharing can be performed in the development process, namely, a user can develop functional components with certain functions to share for other users (software developers) to use, so that the software development speed of the users is accelerated, and the phenomenon of repeatedly making wheels in the development process is avoided.
To achieve code sharing, in the related art, a component sharer typically saves a component to be shared to an NPM (Node Package Manager, package management tool) platform, so that other developers call the component by adding dependencies in the project. Alternatively, the developer of the component may upload the component to be shared to the code hosting platform, and share the storage address of the component on the platform to other developers, so that the latter downloads and uses the component.
However, no matter the NPM platform or the code hosting platform, a specific format or protocol is generally required, so the component sharer needs to package and process the component into a component package in a specific form meeting the format or protocol before uploading the component, and correspondingly, other developers can only acquire the component package to use as a "black box" for realizing a specific function, and cannot perform more detailed secondary development on the component, so the personalized requirement of a user is often difficult to meet. In addition, the components and related information (information for describing functions and the like) in the above manner are often mixed together and managed by a platform, so that the storage, query, calling and other performances of the components are poor, and the efficient sharing of the components is not facilitated.
Disclosure of Invention
In view of the above, the present invention provides a code management method, device and system to solve the deficiencies in the related art.
Specifically, the invention is realized by the following technical scheme:
according to a first aspect of the present invention, there is provided a code management method applied to a code repository associated with a component management server, the method comprising:
receiving and storing source codes of functional components submitted by a component development client, wherein the functional components are used for realizing preset functions;
And providing the related information of the functional component to the component management server for maintenance, wherein the related information is used by the component management server to assist the component to acquire the source code by using the client.
According to a second aspect of the present invention, there is provided a code management method applied to a component management server associated with a code repository, the method comprising:
receiving and maintaining related information of a function component provided by the code warehouse, wherein the function component is used for realizing a preset function, and a source code of the function component is submitted to the code warehouse by a component development client for storage;
the component is assisted in obtaining the source code using a client based on the relevant information.
According to a third aspect of the present invention, there is provided a code management system comprising a component development client, a component use client, a component management server and associated code repositories thereof, wherein,
the code warehouse is used for receiving and storing source codes of the functional components submitted by the component development client and providing related information of the functional components to the component management server, wherein the functional components are used for realizing preset functions;
The component management server is used for receiving and maintaining the related information and assisting the component to acquire the source code by using the client based on the related information.
According to a fourth aspect of the present invention, there is provided a code management apparatus applied to a code repository associated with a component management server, the apparatus comprising:
the code receiving unit is used for receiving and storing source codes of functional components submitted by the component development client, and the functional components are used for realizing preset functions;
and the information providing unit is used for providing the related information of the functional component to the component management server for maintenance, and the related information is used by the component management server for assisting the component to acquire the source code by using the client.
According to a fifth aspect of the present invention, there is provided a code management apparatus applied to a component management server associated with a code repository, the apparatus comprising:
the information receiving unit is used for receiving and maintaining the related information of the function components provided by the code warehouse, the function components are used for realizing preset functions, and source codes of the function components are submitted to the code warehouse by the component development client for storage;
And the acquisition assisting unit is used for assisting the component to acquire the source code by using the client based on the related information.
According to a sixth aspect of the present invention, there is provided an electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the steps of the method of the first or second aspect by executing the executable instructions.
According to a seventh aspect of the present invention there is provided a computer readable storage medium having stored thereon computer instructions which when executed by a processor implement the steps of the method of the first or second aspect.
The technical scheme provided by the embodiment of the invention can comprise the following beneficial effects:
the code management system comprises a code warehouse for storing source codes, and a component management server associated with the code warehouse, wherein the server is used for managing the functional components which are uploaded by a component development client and are used for realizing preset functions, such as maintaining related information of the functional components, interacting with a component using client and the like. The code warehouse receives and stores source codes of the functional components submitted by the component development client and provides relevant information of the functional components to the component management server; and the component management server is used for receiving and maintaining the related information and assisting the component to acquire the source code by using the client based on the related information.
According to the scheme, on one hand, after the development of the functional component is completed, a sharer can directly submit the source code of the functional component to a code warehouse for storage through a component development client without packing the functional component into a component package in a specific form; accordingly, when the user needs to use the functional component, the user can not only acquire the source code and directly use the functional component for own projects, but also directly perform secondary development on the basis of the source code because the source code is acquired instead of the functional black box, thereby being beneficial to applying the functional component to specific development scenes and meeting more diversified development requirements, and further being beneficial to expanding the sharing and application range of the functional component. On the other hand, the source codes of the functional components are stored by the code warehouse, and the related information of the functional components is maintained by the code management server, so that the source codes of the functional components and the related information thereof are respectively stored and maintained (namely, the separation of the source codes and the related information thereof is realized), and the code management server and the component development client directly interact, thereby effectively improving the storage, query and calling efficiencies of the components and the source codes thereof and being beneficial to realizing the efficient sharing of the functional components.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the following description will make a brief introduction to the drawings used in the description of the embodiments or the prior art. It is evident that the drawings in the following description are only some embodiments of the present invention and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a schematic diagram of a code management system according to an embodiment of the present invention;
FIG. 2 is a flow chart of a code management method according to an embodiment of the present invention;
FIG. 3 is a flow chart of another code management method shown in an embodiment of the present invention;
FIG. 4 is a schematic block diagram of an electronic device shown in an embodiment of the invention;
FIG. 5 is a block diagram of a code management apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram of another code management apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the invention. Rather, they are merely examples of apparatus and methods consistent with aspects of the invention.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the invention. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
Embodiments of the code management method of the present invention are described in detail below with reference to the attached drawings.
FIG. 1 is a schematic diagram of an architecture of a code management system according to an exemplary embodiment. As shown in fig. 1, the system may include a network 10, a code management server 11, a code repository 12, and a number of electronic devices, such as a computer 13, a computer 14, and a computer 15.
The code management server 11 may be a physical server including an independent host, or the code management server 11 may be a virtual server, a cloud server, or the like, which is carried by the host cluster. Any one of the computers 13 to 15 may be a desktop computer, a notebook computer, a tablet computer, or the like. Moreover, computers 13-15 are but one type of electronic device that a user may use. Indeed, it is obvious that the user may also use electronic devices of the type such as: a cell phone, workstation (Work Station), palm computer (PDAs, personal Digital Assistants), wearable devices (e.g., smart glasses, smart watches, etc.), VR (Virtual Reality) devices, AR (Augmented Reality) devices, etc., without limitation, as one or more embodiments of the present invention. The code repository 12 may store codes in any form, for example, the code repository 12 may be a relational database such as MySQL, oracle, SQL Server, mariaDB, or a non-relational database such as redis, mongoDB, memcache, which is not limited in the present invention. The network 10 may comprise various types of wired or wireless networks.
The computer 13 may be used as a component development client for interacting with the code repository 12, such as submitting source code of the functional components to be shared to the code repository 12. Computers 14 and 15 may be used as component usage clients for interacting with code management server 11 and/or code repository 12, e.g. computer 14 may receive and present information about a plurality of functional components issued by code management server 11 and initiate a component usage request for target functional component unit1 thereto, and then pull the target source code of unit1 from code repository 12 according to the address in response to the target access address of functional component unit1 returned by code management server 11; for another example, the computer 15 may receive and present information about a plurality of functional components issued by the code management server 11 and initiate a component usage request for the target functional component unit1 thereto, and then receive the target source code that the code management server 11 pulls and returns from the code repository 12 according to the corresponding target access address in response to the request.
In addition, for any one of the component development client and the component use client, an Application (APP) thereof may be pre-installed on an electronic device (e.g., computers 13 to 15, etc.), so that the client may be started and run (i.e., in a C/S architecture) on the electronic device. For example, an application program of a component development client may be installed and run in the computer 14 or 15 to implement the computer as a component development client for interacting with other devices in the code management system. Of course, when an online "client" such as HTML5 technology is used, the client can be obtained and run (i.e., using a B/S architecture) without installing a corresponding application on the electronic device. For another example, the computer 13 may access an online client (i.e., the component-using client) provided by the code management server through a locally running browser, which is not described in detail.
It should be noted that, the number of code warehouse, component development client and component use client included in the code management system of the present invention may be one or more, and any one of these is only used for exemplary purposes in this specification.
Aiming at the problems in the related art, the scheme provides a code management system and a code management method respectively applied to a code management server side and a code warehouse in the system. The code management system comprises a component development client, a component use client, a component management server and an associated code warehouse, wherein,
The code warehouse is used for receiving and storing source codes of the functional components submitted by the component development client and providing related information of the functional components to the component management server, wherein the functional components are used for realizing preset functions;
the component management server is used for receiving and maintaining the related information and assisting the component to acquire the source code by using the client based on the related information.
The interface logic of each client in the code management system can be realized through a html, css, js webpage technology. Illustratively, the component development client and the component use client may be generated by Electron technology packaging. Through the use of the component with the client, a user of the component (e.g., an APP, applet, page, etc. application developer, etc.) can customize the local directory for storing the source code of the acquired functional component. The user can use the client to create a development project aiming at a certain application through the component, the local catalog is specified in the development project, and the application is developed locally through the acquired source code.
The functional component of the present invention may specifically be an item, a piece of code, or a code block containing the source code, etc. The function component is used for realizing the preset function, and the invention does not limit the function realized by the function component. Illustratively, the functional component may be a front-end component of a button, a form, or the like. The preset function may be: an operation function of performing a specific operation on input data according to a preset calculation algorithm, an encryption function of encrypting the input data according to a preset encryption algorithm, a multimedia processing function of performing a specific analysis on input multimedia resources (images, videos, music, etc.) or adding a watermark, etc., and the like. In fact, the functional components may implement any form of preset functions. In addition, the functional component is composed of source codes, and the preset functions of the functional component can be realized by running the source codes in a proper running environment. The source code can be written by C, C ++, python, java and other programming languages, and can run in Android (Android), iOS, windows, mac OS, linux and other operating environments, and the invention does not limit the environment, resources, configuration and other relevant conditions required by the source code running of the functional component.
The source code of the functional component may be written by a corresponding developer (hereinafter referred to as component developer), and in fact, the process of developing the functional component includes the process of writing the source code. The component development client in the code management system is a client used by a sharer of the functional component, and the sharer can be the developer, or can also be other related personnel (such as the component developer entrusts the developed functional component to other people for sharing). Accordingly, the functional components shared by the sharer can be used by other developers (hereinafter referred to as users of the functional components) to meet their own development requirements, and the users can use the component use clients in the code management system to interact with other devices in the system so as to obtain the source codes of the functional components and use the source codes.
The sharing process of the functional components of the invention can be divided into two parts: the sharer submits the source code of the functional component through the component development client, and the user obtains the source code of the functional component through the component using the client. The two processes are described in detail below in conjunction with fig. 2 and 3, respectively.
FIG. 2 is a flow chart of a code management method for use in a component management server-side associated code repository, according to an embodiment of the present invention, including the following steps 204-204.
Step 202, source codes of functional components submitted by a component development client are received and stored, wherein the functional components are used for realizing preset functions.
For the developed functional components, sharers can submit source codes of the components to a code warehouse through a component development client; accordingly, the code repository may store the received source codes in local storage space and manage and maintain the source codes.
In one embodiment, a component development client may integrate software development functionality, and the component developer may develop the source code for the functional components locally at the client. For example, the source code submission function may be integrated into a component development tool to submit the source code using the function after development is complete, at which point the component development tool may be considered the component development client. The source codes developed locally at the component development client can be directly submitted to a code warehouse for storage, so that the development and the submission processes of the source codes are related to each other and can be submitted even by one key, and the submission efficiency of the source codes is effectively improved. Of course, the source code of the functional component can also be developed in other development devices and transferred to the component development client for submission, and the description is not limited as to whether the development source code is the component development client.
Wherein the component development client may submit source code for one or more functional components. For any of the functional components, if the code repository has not already saved the source code of that component locally (i.e., submitted the source code of the component for the first time), the code repository may store the source code directly locally. Alternatively, if the code repository has already stored the source code of any of the functional components locally (i.e., the source code of the component was not submitted for the first time), the code repository may update (e.g., replace or overwrite) the stored historical source code of the component with the source code of the current submission, or may set different versions (e.g., accumulation values or timestamps, etc.) for each of the submitted source codes, respectively. The related information corresponding to the source codes of different versions is not identical, so that a user can select and use the source codes of proper versions according to the related information corresponding to the source codes of different versions. Of course, it is also possible to determine whether to update the history source code with the new source code just received or to store the new source code and the history source code at the same time according to the instruction issued by the sharer corresponding to the component development client, which is not described again.
And 204, providing the related information of the functional component to the component management server for maintenance, wherein the related information is used by the component management server to assist the component to acquire the source code by using the client.
After receiving the source code of the functional component submitted by the component development client, the code repository may determine relevant information of the functional component, and further provide the relevant information to the component management server for maintenance, where the relevant information is used by the component management server to assist the component in acquiring the source code using the client.
According to the scheme, on one hand, after the development of the functional component is completed, a sharer can directly submit the source code of the functional component to a code warehouse for storage through a component development client without packing the functional component into a component package in a specific form; accordingly, when the user needs to use the functional component, the user can not only acquire the source code and directly use the functional component for own projects, but also directly perform secondary development on the basis of the source code because the source code is acquired instead of the functional black box, thereby being beneficial to applying the functional component to specific development scenes and meeting more diversified development requirements, and further being beneficial to expanding the sharing and application range of the functional component. On the other hand, the source codes of the functional components are stored by the code warehouse, and the related information of the functional components is maintained by the code management server, so that the source codes of the functional components and the related information thereof are respectively stored and maintained (namely, the separation of the source codes and the related information thereof is realized), and the code management server and the component development client directly interact, thereby effectively improving the storage, query and calling efficiencies of the components and the source codes thereof and being beneficial to realizing the efficient sharing of the functional components.
In an embodiment, the information about the functional component may include an access address of the source code in a code repository. Meanwhile, the related information may further include function description information of the preset function, for example, a function instance, a graph and/or a table, where the function description information may be used by the component using a client to display to a sharer, so that a user knows, according to the information, the preset function that can be implemented by the function component, and further accurately determines whether the function meets the development requirement of the user. And/or the related information may further include usage instruction information for the usage mode of the functional component, such as the parameter entering number, type, format, operation environment, parameter configuration, resource requirement (required number of CPU cores, memory capacity) and the like of the source code, where the usage instruction information may be used by the component usage client to display to a user, so that the user can obtain the condition required for using the source code according to the information, and further accurately determine whether the self condition meets the operation requirement of the source code and the specific mode of using the source code, thereby avoiding error reporting in the subsequent use process.
Of course, the related information may also include other forms of information, which is not limited by the present invention. In addition, the function description information and the usage description information may be obtained by analyzing the source code by the code repository, or may be obtained from a component development client, for example, the component development client may submit the source code of the function component and related information (not including the access address) to the code repository in an associated manner.
In one embodiment, the code repository may provide information about the functional components to the component management server in a number of ways. For example, a change acquisition request may be initiated by a component management server to a code repository, which may return the relevant information to the component management server in response to the request. The code management server may initiate the change acquiring request according to a preset plan, such as initiation at a fixed time, periodic initiation, initiation in an idle period, initiation in a predicted high-frequency update period (i.e., a period of time that a sharer predicted by the code management server is more likely to upload a source code of the functional component, such as a working day), and the like, which are not described herein. It can be understood that, in the case of receiving any change acquisition request, the code repository may return, to the code management server, the relevant information of all the functional components that have changed within the time from the previous time of returning the relevant information to the current time. The functional components changed in the period of time comprise functional components corresponding to the source codes (possibly for the first time or not) received in the period of time respectively.
For another example, the related information of the functional component may be determined in response to receiving the source code, and the related information may be pushed to the component management server. The code repository may be pushed in Webhook mode, for example, the code repository may be preconfigured with a URL (Uniform Resource Locator ) pointing to the code management server, and then, each time related information of a functional component is determined, the related information is contained in a push message and pushed to the URL. It can be understood that the mode actively pushes the related information to the code management server by the code warehouse, so that the information can be pushed in time, and the code management server can update the locally maintained information in time, thereby improving timeliness of the related information seen by a user, effectively improving assembly viewing and use experience of the user, and avoiding accidents that a certain functional assembly cannot acquire the source code of the functional assembly as much as possible.
After receiving the related information of the functional components provided by the code warehouse, the code management server can store the information in a preset storage space, such as a local storage space or an extended storage space, and the like, and manage and maintain the information.
It can be understood that after the component development client submits the source code of the functional component to the code repository, and the code repository provides the description information of the functional component to the code management server, the sharer of the functional component completes the process of submitting the source code of the functional component through the component development client. After that, the code management server may assist the component to acquire the source code of the functional component using the client according to the related information maintained by the code management server, that is, the code management server may participate in completing the process of acquiring the source code by the user. The details are described below in connection with fig. 3.
FIG. 3 is a flow chart of another code management method for use with a component management server associated with a code repository, the method comprising steps 302-304, according to an embodiment of the present invention.
And 302, receiving and maintaining relevant information of the functional components provided by the code warehouse, wherein the functional components are used for realizing preset functions, and source codes of the functional components are submitted to the code warehouse by a component development client for storage.
In one embodiment, the code management server may receive the functional components provided by the code repository in a variety of ways. Corresponding to the foregoing embodiments, for example, the code management server may receive information about the functional component pushed by the code repository, where the information may be determined and pushed by the code repository in response to receiving source code of the functional component submitted by the component development client. In other words, the code repository may determine and actively push relevant information of the functional component to the code repository upon receiving source code of the functional component submitted by the component development client, thereby updating the relevant information maintained at the code repository in time. The pushing may be implemented in Webhook manner, or may also be implemented in a message queue, long connection, webSocket, or the like, which will not be described in detail.
For another example, the code management server may actively initiate a change acquisition request to the code repository, and receive relevant information returned by the code repository in response to the request. The code management server may initiate the change acquiring request according to a preset plan, such as initiation at a fixed time, periodic initiation, initiation at an idle time period, initiation at a predicted high-frequency update time period (i.e., a time period in which a sharer predicted by the code management server is more likely to upload source codes of the functional components, such as a working day), and the like, which are not described in detail.
Step 304, assisting the component to acquire the source code using the client based on the related information.
After receiving the relevant information of the functional components provided by the code warehouse, the code management server can locally save and maintain the relevant information. Based on the relevant information maintained by the code management server, the code management server can assist the component in acquiring the source code by using the client.
According to the scheme, on one hand, after the development of the functional component is completed, a sharer can directly submit the source code of the functional component to a code warehouse for storage through a component development client without packing the functional component into a component package in a specific form; accordingly, when the user needs to use the functional component, the user can not only acquire the source code and directly use the functional component for own projects, but also directly perform secondary development on the basis of the source code because the source code is acquired instead of the functional black box, thereby being beneficial to applying the functional component to specific development scenes and meeting more diversified development requirements, and further being beneficial to expanding the sharing and application range of the functional component. On the other hand, the source codes of the functional components are stored by the code warehouse, and the related information of the functional components is maintained by the code management server, so that the source codes of the functional components and the related information thereof are respectively stored and maintained (namely, the separation of the source codes and the related information thereof is realized), and the code management server and the component development client directly interact, so that the storage, query and calling efficiencies of the components and the source codes thereof are effectively improved, and the efficient sharing of the functional components is facilitated.
As described above, for a functional component that can implement a preset function, the relevant information may include an access address of a source code of the functional component in the code repository; and the function description information of the preset function and/or the use instruction information aiming at the use mode of the functional component.
In one embodiment, a user may have a need to use certain functional components during the development of projects, software, etc., at which point a component view request may be initiated to the code management server through the component use client. Accordingly, the code management server may issue information about the functional component to the component using client in response to the request so that it is presented to the user. If the component viewing request designates at least one functional component, the code management server side can send the related information of the functional components to the component using client side so as to meet the personalized viewing requirement of the user as much as possible; or if the component view request does not specify any functional components, the code management server may return relevant information of some functional components to the component use client according to a preset rule, so that the relevant information is displayed to a user. The certain functional components may be at least one type of sample functional component maintained by the code management server, or may be functional components that the component uses a previous (one or more) request of the client to obtain, or functional components corresponding to source codes obtained in the previous (one or more) time, or the like. In addition, for any functional component, the code management server may send, to the component use client, function description information of a preset function implemented by the functional component and/or use instruction information for a use manner of the functional component. The specific form of the function description information and the usage description information may be referred to the description of the foregoing embodiments, and will not be repeated herein.
The component using client can display the related information returned by the code management server for the user to check. For example, a user may determine which functional components to use according to his own development requirements, development conditions, and the function description information, and for the determined functional components, the target functional components will be referred to as target functional components. In other words, the target functional component in the present invention is any one or more functional components that are acquired (corresponding source code) and used by the component using the client request. Further, the user may perform a preset operation on the target function component in the component usage client under the condition that the target function component is determined, for example, select any one of the function components in the related information of the plurality of function components displayed in the component usage client as the target function component, and click a "use" button of the component. In response to detecting the above-described preset operation for the target functional component, the component use client may initiate a component use request for the target functional component to the code management server, where the request may include a component identifier of the target functional component, so as to accurately inform the code management server of which functional component(s) the source code is requested to obtain. Accordingly, in response to the component use request, the code management server may query, according to the component identifier of the target functional component, the target access address of the target source code of the target functional component in the code repository, for example, may query, according to the component identifier of the target functional component, relevant information of the target functional component, and find the corresponding target access address in the information. And the code management server may assist the component in retrieving the target source code using the client based on the target access address.
Further, the code management server may assist the component in obtaining the target source code using a client based on the target access address in a number of ways. For example, the target access address may be returned to the component use client to pull the target source code from the code repository according to the target access address by the component use client, thereby alleviating the data processing burden on the code management server. In the mode, under the scene that the code management server simultaneously connects a plurality of components to use the client, the code management server can still ensure that the code management server normally provides service for each component to use the client, response timeout and even server downtime possibly caused by excessive requests are avoided, and the source code acquisition experience of a user is improved. For another example, the code management server may pull the target source code from the code repository according to the target access address, and return the pulled target source code to the component usage client. By adopting the scheme, the exposure of the real access address of the source code in the code warehouse to the component using client can be avoided, so that the potential safety hazard of the code warehouse is reduced.
In one embodiment, the code management server may authenticate the source code of the feature before the assist component obtains it using the client to verify that the latter meets the requirements associated with the feature. For example, the code management server may first determine whether the component using client has a use right for the functional component, and further assist the component using client to acquire the source code based on the related information if it is determined that it has the use right.
Wherein the component use client has a use right for the functional component, and may include at least one of the following: the code management server can verify the payment credentials of the component using client for the functional component, and determine that the component using client has the use rights for the functional component if the verification passes. Taking the foregoing target function component as an example, for a certain target function component that needs to be acquired and used by a user, the component using client may display a corresponding payment page to the user, so that the user may complete the payment operation (such as code scanning payment) for the component, and receive the payment result returned by the corresponding payment platform: if the payment is successful, the transfer result may include payment credentials; otherwise, only information about payment failure may be included. Further, the component may submit the payment credential to the code management server using the client to verify (e.g., by interacting with the paymate) the authenticity of the credential, the payment amount, etc. by the latter. If the verification is passed, it indicates that the user has transferred the funds of the preset amount to the account corresponding to the target function component (such as the account of the sharer of the component, the public account provided by the code management server, etc.), at this time, it can be determined that the user has the use authority for the target function component, and can assist the user in obtaining the target function component. Through the verification of the payment credentials, the sharers and related parties can obtain corresponding assets/values through the sharing function component, and the sharing willingness and enthusiasm of the sharers can be improved.
And/or determining that the component use client has the use authority for the functional component under the condition that the user corresponding to the component use client belongs to a preset organization. For example, if a certain functional component unit2 shared by the sharer is used only by each member in organization a (such as a group, a company, a project group, a class, etc.), each member in organization a (belonging to organization a) has a use right for unit2, and each member in organization B (not belonging to organization a) does not have a use right for unit 2. Or, it may be determined that the component use client has the use authority for the functional component when the user level of the user corresponding to the component use client in the preset organization structure is not lower than the preset level. For example, if a certain functional component unit3 shared by the sharer is used only by each member whose level inside the organization B is not lower than the level two, each member whose level inside the organization B is not lower than the level two has a right to use the unit3, and each member whose level inside the organization B is lower than the level two does not have a right to use the unit 3. By the method, the limit of the use authority of the shared functional components can be realized, and the accurate control of the sharing range of the functional components is facilitated.
It can be understood that, for any functional component, the rule for determining the usage rights of the functional component may be set specifically by the sharer of the component when uploading the source code, or may be set uniformly in advance by related personnel such as an administrator of the code management system, which is not limited in this aspect of the present invention.
In one embodiment, a user may create a development project locally at a component using a client and specify a corresponding local directory to a code management server before requesting to acquire and use a functional component. Therefore, the code management server side can generate a code file containing the source code in the local directory in the process of assisting a component to acquire the source code by using the client side. With the foregoing embodiment, if the code management server obtains the target source code according to the target access address of the target functional component, the code file may be generated in the local target specified by the component development client, and the source code may be written into the file. Furthermore, the user can develop the project based on the source code recorded in the file, for example, directly placing the source code as a code block at a proper position of the project so as to realize the preset function corresponding to the target function component; or the secondary development is carried out on the basis of the source code, namely, the source code is added, deleted, modified and the like, so that the source code after the secondary development realizes the personalized function expected by a user and is not repeated.
Fig. 4 is a schematic structural diagram of an electronic device shown in an embodiment of the present invention. Referring to fig. 4, at the hardware level, the device includes a processor 401, a network interface 402, a memory 403, a nonvolatile memory 404, and an internal bus 405, and may include hardware required by other services. One or more embodiments of the invention may be implemented on a software basis, such as by the processor 401 reading a corresponding computer program from the non-volatile memory 404 into the memory 403 and then running. Of course, in addition to software implementation, one or more embodiments of the present invention do not exclude other implementation, such as a logic device or a combination of software and hardware, etc., that is, the execution subject of the following process flows is not limited to each logic unit, but may also be hardware or a logic device.
Fig. 5 is a block diagram of a code management apparatus according to an embodiment of the present invention. Referring to fig. 5, the apparatus may be applied to the device shown in fig. 4 to implement the technical solution of the present invention, where the apparatus is applied to a code repository associated with a component management server, and the apparatus includes:
a code receiving unit 501, configured to receive and store source code of a functional component submitted by a component development client, where the functional component is used to implement a preset function;
And the information providing unit 502 is configured to provide relevant information of the functional component to the component management server for maintenance, where the relevant information is used by the component management server to assist the component in acquiring the source code using the client.
Optionally, the information providing unit 502 is specifically configured to:
determining related information of the functional component in response to receiving the source code, and pushing the related information to the component management server; or,
and responding to a change acquisition request initiated by the component management server, and returning the related information to the component management server.
Optionally, the related information of the functional component includes:
an access address of the source code in the code repository; the method comprises the steps of,
the function description information of the preset function and/or the use instruction information aiming at the use mode of the functional component.
FIG. 6 is a block diagram of another code management apparatus according to an embodiment of the present invention. Referring to fig. 6, the apparatus may be applied to the device shown in fig. 4 to implement the technical solution of the present invention, where the apparatus is applied to a component management server associated with a code repository, and the apparatus includes:
An information receiving unit 601, configured to receive and maintain information about a function component provided by the code repository, where the function component is used to implement a preset function, and a source code of the function component is submitted to the code repository by a component development client for storage;
an acquisition assisting unit 602, configured to assist a component to acquire the source code using a client based on the related information.
Optionally, the information receiving unit 601 is specifically configured to:
receiving relevant information of the functional component pushed by the code warehouse, wherein the relevant information is determined and pushed by the code warehouse in response to receiving source codes of the functional component submitted by a component development client; or,
and initiating a change acquisition request to the code warehouse, and receiving the related information returned by the code warehouse in response to the request.
Optionally, the acquisition assisting unit 602 is specifically configured to:
responding to a component viewing request initiated by a component using client, and transmitting function description information of the preset function and/or use description information aiming at a use mode of the function component to the component using client;
in response to a component use request initiated by the component use client for a target functional component, assisting the component use client in acquiring target source code of the target functional component based on a target access address of the target source code in the code repository.
Optionally, the information receiving unit 601 is specifically configured to:
returning the target access address to the component use client to pull the target source code from the code repository by the component use client according to the target access address; or,
and pulling the target source code from the code bin according to the access address, and returning the pulled target source code to the component using client.
Optionally, the information receiving unit 601 is specifically configured to:
and under the condition that the component using client side is determined to have the using authority for the functional component, assisting the component using client side to acquire the source code based on the related information.
Optionally, the component use client has a use right for the functional component, including at least one of the following:
the component verifies the payment credentials for the functional component using the client;
the component uses the user corresponding to the client to belong to a preset organization;
the component uses the user grade of the user corresponding to the client in the preset organization structure not lower than the preset grade.
Optionally, the information receiving unit 601 is specifically configured to:
Code files containing the source code are generated in a local directory specified by the component using the client.
While this invention contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as features of specific embodiments of particular inventions. Certain features that are described in this invention in the context of separate embodiments can also be implemented in combination in a single embodiment. On the other hand, the various features described in the individual embodiments may also be implemented separately in the various embodiments or in any suitable subcombination. Furthermore, although features may be acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, although operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Furthermore, the processes depicted in the accompanying drawings are not necessarily required to be in the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the invention.

Claims (15)

1. A code management method applied to a code repository associated with a component management server, the method comprising:
receiving and storing source codes of functional components submitted by a component development client, wherein the functional components are used for realizing preset functions;
and providing the related information of the functional component to the component management server for maintenance, wherein the related information is used by the component management server to assist the component to acquire the source code by using the client.
2. The method according to claim 1, wherein providing the related information of the functional component to the component management server includes:
determining related information of the functional component in response to receiving the source code, and pushing the related information to the component management server; or,
and responding to a change acquisition request initiated by the component management server, and returning the related information to the component management server.
3. The method of claim 1, wherein the information about the functional component comprises:
an access address of the source code in the code repository; the method comprises the steps of,
the function description information of the preset function and/or the use instruction information aiming at the use mode of the functional component.
4. A code management method applied to a component management server associated with a code repository, the method comprising:
receiving and maintaining related information of a function component provided by the code warehouse, wherein the function component is used for realizing a preset function, and a source code of the function component is submitted to the code warehouse by a component development client for storage;
The component is assisted in obtaining the source code using a client based on the relevant information.
5. The method of claim 4, wherein said receiving information about the functional components provided by the code repository comprises:
receiving relevant information of the functional component pushed by the code warehouse, wherein the relevant information is determined and pushed by the code warehouse in response to receiving source codes of the functional component submitted by a component development client; or,
and initiating a change acquisition request to the code warehouse, and receiving the related information returned by the code warehouse in response to the request.
6. The method of claim 4, wherein the assisting component using a client to obtain the source code based on the relevant information comprises:
responding to a component viewing request initiated by a component using client, and transmitting function description information of the preset function and/or use description information aiming at a use mode of the function component to the component using client;
in response to a component use request initiated by the component use client for a target functional component, assisting the component use client in acquiring target source code of the target functional component based on a target access address of the target source code in the code repository.
7. The method of claim 6, wherein the assisting the component with the client in obtaining the target source code based on a target access address of the target source code of the target function component in the code repository comprises:
returning the target access address to the component use client to pull the target source code from the code repository by the component use client according to the target access address; or,
and pulling the target source code from the code bin according to the access address, and returning the pulled target source code to the component using client.
8. The method of claim 4, wherein the assisting component using a client to obtain the source code based on the relevant information comprises:
and under the condition that the component using client side is determined to have the using authority for the functional component, assisting the component using client side to acquire the source code based on the related information.
9. The method of claim 8, wherein the component-use client has a use right for the functional component, comprising at least one of:
The component verifies the payment credentials for the functional component using the client;
the component uses the user corresponding to the client to belong to a preset organization;
the user grade of the user corresponding to the component using the client in the preset organization structure is not lower than the preset grade.
10. The method of claim 4, wherein the assisting component obtains the source code using a client, comprising:
code files containing the source code are generated in a local directory specified by the component using the client.
11. A code management system is characterized by comprising a component development client, a component use client, a component management server and a code warehouse related to the component development client and the component use client, wherein,
the code warehouse is used for receiving and storing source codes of the functional components submitted by the component development client and providing related information of the functional components to the component management server, wherein the functional components are used for realizing preset functions;
the component management server is used for receiving and maintaining the related information and assisting the component to acquire the source code by using the client based on the related information.
12. A code management apparatus for use in a code repository associated with a component management server, the apparatus comprising:
the code receiving unit is used for receiving and storing source codes of functional components submitted by the component development client, and the functional components are used for realizing preset functions;
and the information providing unit is used for providing the related information of the functional component to the component management server for maintenance, and the related information is used by the component management server for assisting the component to acquire the source code by using the client.
13. A code management apparatus for use with a component management server associated with a code repository, the apparatus comprising:
the information receiving unit is used for receiving and maintaining the related information of the function components provided by the code warehouse, the function components are used for realizing preset functions, and source codes of the function components are submitted to the code warehouse by the component development client for storage;
and the acquisition assisting unit is used for assisting the component to acquire the source code by using the client based on the related information.
14. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
Wherein the processor is configured to implement the method of any of claims 1-10 by executing the executable instructions.
15. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of any of claims 1-10.
CN202311084624.1A 2023-08-25 2023-08-25 Code management method, device and system Pending CN117130647A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311084624.1A CN117130647A (en) 2023-08-25 2023-08-25 Code management method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311084624.1A CN117130647A (en) 2023-08-25 2023-08-25 Code management method, device and system

Publications (1)

Publication Number Publication Date
CN117130647A true CN117130647A (en) 2023-11-28

Family

ID=88852220

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311084624.1A Pending CN117130647A (en) 2023-08-25 2023-08-25 Code management method, device and system

Country Status (1)

Country Link
CN (1) CN117130647A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117648234A (en) * 2023-12-11 2024-03-05 南京龙垣信息科技有限公司 Sustainable and convenient code updating monitoring method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117648234A (en) * 2023-12-11 2024-03-05 南京龙垣信息科技有限公司 Sustainable and convenient code updating monitoring method

Similar Documents

Publication Publication Date Title
US11509729B2 (en) Field service management mobile offline synchronization
US10291704B2 (en) Networked solutions integration using a cloud business object broker
EP3177997B1 (en) Policy based resource management and allocation system
US9667515B1 (en) Service image notifications
US11036696B2 (en) Resource allocation for database provisioning
US9678740B2 (en) Migration mechanism
US11126481B2 (en) Fulfilling a request based on catalog aggregation and orchestrated execution of an end-to-end process
US9229759B2 (en) Virtual machine provisioning using replicated containers
CN111901294A (en) Method for constructing online machine learning project and machine learning system
CN110832458B (en) Stealth patterns for personalized machine learning models
WO2016022925A2 (en) Policy based resource management and allocation system
CN117130647A (en) Code management method, device and system
US20220027495A1 (en) Rule set-based authorization for data pool
CN104094299A (en) Retrieving availability information from published calendars
US11907387B2 (en) Service for sharing data insights
US10067808B2 (en) Nondeterministic operation execution environment utilizing resource registry
US10776186B2 (en) Method and system for detection and handling of discontinuities in event delivery systems
CN111488386A (en) Data query method and device
Gundu et al. The Dynamic Computational Model and the New Era of Cloud Computation Using Microsoft Azure
US9978070B1 (en) Dynamic customer relationship management while maintaining customer privacy
US20230195792A1 (en) Database management methods and associated apparatus
US11799864B2 (en) Computer systems for regulating access to electronic content using usage telemetry data
CN112783842A (en) Log collection method and device
CN117130648A (en) Application management method, device and system
US20240053981A1 (en) Methods for automated configuration management in platform-as-a-service environments and devices thereof

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