Cloud-native online development method, device, equipment and storage medium
By using a cloud-native online development method to create temporary container space and load available code libraries, the problem of software development tools being unable to be used in mobile scenarios is solved, and convenient online development and code security are achieved.
Patent Information
- Application Number
- CN202111446573.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2041-11-30
AI Technical Summary
Existing software development tools need to be installed on specific computers and cannot meet the software development needs in mobile scenarios, especially in scenarios such as remote positioning and remote support for emergency function development.
Based on the cloud-native online development method, by obtaining the target user ID and development language, a temporary container space is created to form an online development environment, and the available code library is loaded. It supports online editing and storage of code, and uses the temporary container environment to realize software development in mobile scenarios.
It realizes the convenience of software development in mobile scenarios, ensures the security and accessibility of code, and avoids excessive system load caused by long-term preservation of online development environment.
Smart Images

Figure CN114118971B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software development, and particularly relates to a cloud-native based online development method and device, equipment and a storage medium. BACKGROUND
[0002] Currently, when a developer develops software, the developer generally needs to develop on a specific computer on which a software editing tool is installed, and the software development demand of a mobile scenario cannot be met. The software editing tool is a tool for realizing software development corresponding to development languages such as JAVA and C++. The mobile scenario here refers to a scenario in which software development is performed on a specific computer without installing a software editing tool, including but not limited to scenarios such as remote positioning problems and remote support emergency function development. SUMMARY
[0003] The present application provides a cloud-native based online development method, device, equipment and storage medium, to solve the problem that the existing software development process develops software on a specific computer, which cannot meet the software development demand of a mobile scenario.
[0004] A cloud-native based online development method, comprising:
[0005] An online development request is obtained, and the online development request comprises a target user identifier and a target development language;
[0006] Based on the target development language, an available code library corresponding to the target user identifier is obtained;
[0007] According to the target development language, a target editing image corresponding to the target development language is obtained;
[0008] Based on the target editing image, a temporary container space corresponding to the target user identifier is created to form an online development environment, and the available code library is loaded onto the online development environment;
[0009] Based on the online development environment, an online editing code is obtained, and the online editing code is stored in a fixed container space corresponding to the target user identifier.
[0010] A cloud-native based online development device, comprising:
[0011] An online development request obtaining module is configured to obtain an online development request, and the online development request comprises a target user identifier and a target development language;
[0012] An available code library obtaining module is configured to obtain, based on the target development language, an available code library corresponding to the target user identifier;
[0013] a target editing image acquisition module configured to acquire a target editing image corresponding to the target development language according to the target development language;
[0014] an online development environment forming module configured to create a temporary container space corresponding to the target user identifier based on the target editing image, form an online development environment, and load the available code library corresponding to the target user identifier onto the online development environment;
[0015] an online editing code acquisition module configured to acquire online editing code based on the online development environment and store the online editing code in the fixed container space corresponding to the target user identifier.
[0016] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the cloud-based online development method described above when executing the computer program.
[0017] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the cloud-based online development method described above.
[0018] The cloud-based online development method, device, equipment and storage medium described above use the target editing image corresponding to the target development language to create a temporary container space corresponding to the target user identifier, form an online development environment, and load the available code library corresponding to the target user identifier into the online development environment, so that the developer can edit online through the online development environment to form online editing code, which can meet the software development requirements in mobile scenarios such as remote positioning problems and remote support emergency function development, and ensure the convenience of online software development. On the other hand, it can ensure that the online development environment is temporarily generated, and the online editing code can be permanently saved, which can ensure code security and ease of access, and can avoid high system load caused by long-term saving of the online development environment in the fixed container space. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0020] Figure 1 is a schematic diagram of an online development system based on cloud in an embodiment of the present application;
[0021] Figure 2is a flowchart of an online development method based on cloud native in an embodiment of the present application;
[0022] Figure 3 is another flowchart of an online development method based on cloud native in an embodiment of the present application;
[0023] Figure 4 is another flowchart of an online development method based on cloud native in an embodiment of the present application;
[0024] Figure 5 is another flowchart of an online development method based on cloud native in an embodiment of the present application;
[0025] Figure 6 is another flowchart of an online development method based on cloud native in an embodiment of the present application;
[0026] Figure 7 is another flowchart of an online development method based on cloud native in an embodiment of the present application;
[0027] Figure 8 is another flowchart of an online development method based on cloud native in an embodiment of the present application;
[0028] Figure 9 is a schematic diagram of an online development device based on cloud native in an embodiment of the present application;
[0029] Figure 10 is a schematic diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0031] The online development method based on cloud native provided in the embodiments of the present application can be applied in an application environment as shown in Figure 1 . Specifically, the online development method based on cloud native is applied in an online development system based on cloud native, which includes a client and a server as shown in Figure 1 , the client and the server communicate through a network, and software development can be realized on any computer device, so that it can be suitable for software development requirements in mobile scenarios. The client, also known as the user end, is a program that provides local services for clients corresponding to the server, which can be installed on but not limited to various personal computers and notebook computers.
[0032] In an embodiment, as shown in Figure 2 , a cloud-based online development method is provided. Taking a server in Figure 1 as an example, the method comprises the following steps:
[0033] S201: obtaining an online development request, the online development request comprising a target user identifier and a target development language;
[0034] S202: based on the target development language, obtaining an available code library corresponding to the target user identifier;
[0035] S203: based on the target development language, obtaining a target editing image corresponding to the target development language;
[0036] S204: based on the target editing image, creating a temporary container space corresponding to the target user identifier to form an online development environment, and loading the available code library onto the online development environment;
[0037] S205: based on the online development environment, obtaining online editing code and storing the online editing code in a fixed container space corresponding to the target user identifier.
[0038] The online development request is a request for triggering a software online development operation. The target user identifier is an identifier for uniquely identifying a developer, which can be a user account. The target development language is a language required by a developer for software online development, for example, JAVA, C++, or other languages.
[0039] As an example, in step S201, a user can input a login request containing a target user identifier on a client of a cloud-based online development system. After login verification, the user can independently select a target development language required for software development on the client, trigger an online development request, so that the online development request contains the target user identifier and the target development language, and then send the online development request to the server. The system default development language can also be directly determined as the target development language, the online development request is triggered, so that the online development request contains the target user identifier and the target development language, and then the online development request is sent to the server. In this example, the server can receive the online development request triggered by the user operating the client,
[0040] The available code library is a repository for storing available code. The available code is code corresponding to the target development language for the developer corresponding to the target user identifier.
[0041] As an example, in step S202, after receiving the online development request, the server can query the system database based on the target development language, determine all the original codes corresponding to the target development language in the system database as available codes that can be used by the developer corresponding to the target user identifier, and obtain the available code library corresponding to the target user identifier based on all the available codes.
[0042] Furthermore, after receiving the online development request, the server can query the system database based on the target development language to obtain all the original codes corresponding to the target development language in the system database; then, from all the original codes, select the original codes that match the permissions of the developer corresponding to the target user ID, and determine them as available codes that can be used by the developer corresponding to the target user ID. Based on all the available codes, obtain the available code library corresponding to the target user ID, so that the available codes in the available code library match the user permissions, thereby ensuring the security of the available codes.
[0043] The target editing image is an image corresponding to a software editing tool corresponding to the target development language. For example, when the target development language is JAVA, the target editing image is an image corresponding to a JAVA editing tool (such as Eclipse IDE).
[0044] As an example, in step S203, after receiving the online development request, the server may query the system database based on the target development language and determine the configuration editing image corresponding to the target development language in the system database as the target editing image that matches the target development language. The configuration editing image is an image corresponding to a software editing tool corresponding to a certain development language pre-stored in the system database. It is understandable that querying the system database based on the target development language to determine the target editing image corresponding to the target development language is simple to operate and helps improve subsequent processing efficiency.
[0045] The temporary container space is a container temporarily created for the developer corresponding to the target user ID to perform online development.
[0046] As an example, in step S204, when the server receives the online development request triggered by the developer through the client, the server can assign a temporary container space corresponding to the target editing image to the developer, the temporary container space is the space corresponding to the container where the target editing image runs, so that the developer can perform online development environment. Then, the server can run the target editing image on the temporary container space to form an online development environment corresponding to the target user identifier, which is equivalent to the software editing tool corresponding to the target development language running on the specific computer, and the developer can perform online development of the software on the online development environment. And the server also needs to load the available code library corresponding to the target user identifier to the online development environment, so that the developer can develop the software online according to the available code library, guarantee the diversity of the software development scene, and make it applicable to the mobile scene.
[0047] Wherein, the online editing code is the code formed by the developer in the online development environment. The fixed container space is a space for storing information pre-assigned by the system to each target user identifier.
[0048] As an example, in step S205, the server can receive the online editing code edited by the developer based on the online development environment, and store the online editing code to the fixed container space corresponding to the target user identifier, which helps to guarantee the code security, and also makes the developer can quickly and effectively obtain the previously generated online editing code from the fixed container space, which can guarantee the convenience of obtaining the online editing code.
[0049] In a specific embodiment, after obtaining the online editing code based on the online development environment, the server can further trigger a pipeline deployment request based on a pipeline interface corresponding to the online editing code. The pipeline interface is a pre-configured interface for online creation of a pipeline. The pipeline deployment request is a request for triggering deployment of a business pipeline. Then, the server can query whether the online editing code contains a code branch identifier according to the pipeline deployment request. The code branch identifier is an identifier for identifying that a certain online editing code belongs to a specific branch of a business pipeline. When the online editing code contains the code branch identifier, the server determines that the system has pre-created and stored an existing pipeline, and determines the existing pipeline as a target pipeline. At this time, the online editing code is the code corresponding to the target pipeline, so as to edit the existing online editing code corresponding to the target pipeline in the temporarily created online development environment, thereby ensuring the development efficiency of the target pipeline. When the online editing code does not contain the code branch identifier, the server determines that the system has not created and stored an existing pipeline. At this time, a pipeline creation task can be performed to create a target pipeline. At this time, the online editing code is the code corresponding to the target pipeline, so as to edit the newly added online editing code corresponding to the target pipeline in the temporarily created online development environment, thereby ensuring the development efficiency of the target pipeline.
[0050] In the cloud-native based online development method provided in the embodiment, a target editing image corresponding to a target development language is used to create a temporary container space corresponding to a target user identifier, form an online development environment, and load an available code library corresponding to the target user identifier into the online development environment, so that a developer can edit online through the online development environment to form an online editing code, which can meet the software development requirements in mobile scenarios such as remote positioning problems and remote support of emergency function development, thereby ensuring the convenience of online software development. On the other hand, the online development environment can be generated temporarily, and the online editing code can be permanently saved, thereby ensuring code security and convenience of obtaining, and avoiding high system load caused by long-time saving of the online development environment in a fixed container space.
[0051] In an embodiment, as shown in FIG. 2, step S202 of obtaining an available code library corresponding to a target user identifier based on a target development language includes: Figure 3
[0052] S301: querying a system database based on a target development language to obtain all original codes matched with the target development language, each original code corresponding to a code access attribute;
[0053] S302: if the code access attribute is a public access attribute, the original code is determined as an available code;
[0054] S303: If the code access attribute is a private access attribute, obtain the target user permission corresponding to the target user identifier and the available user permission corresponding to the original code, and determine the original code as available code when the target user permission matches the available user permission.
[0055] S304: Based on all available codes, obtain the available code library corresponding to the target user identifier.
[0056] The code access attribute is an attribute used to reflect whether the code can be accessed by all developers. In this example, the code access attribute includes a public access attribute and a private access attribute. The public access attribute refers to an attribute that the code can be accessed by all developers. The private access attribute refers to an attribute that the code can only be accessed by developers with specific permissions. Generally, the private access attribute here can be an attribute that can only be accessed by developers with pre-configured available user permissions.
[0057] As an example, in step S301, the server can query the system database according to the target development language, obtain all original codes matching the target development language from the code repository corresponding to the target development language, and each original code corresponds to a code access attribute, so as to determine whether the original code is available code for the developer corresponding to the target user identifier according to the code access attribute corresponding to the original code.
[0058] As an example, in step S302, after obtaining all original codes matching the target development language, the server can pull all original codes with public access attribute according to the code access attribute corresponding to the original code, and determine them as available codes corresponding to the target user identifier.
[0059] The target user permission corresponding to the target user identifier refers to the permission of the developer corresponding to the target user identifier. The available user permission corresponding to the original code refers to the permission of the specific user who can use the original code.
[0060] As an example, in step S303, after obtaining all original codes matching the target development language, when the code access attribute of the original code is a private access attribute, the server needs to first query the system database according to the target user identifier to determine the target user information and determine the target user permission from the target user information; and needs to query to determine the available user permission corresponding to each original code; then match the target user permission corresponding to the target user identifier with the available user permission corresponding to each original code; if the target user permission matches the available user permission successfully, pull the matching successful original code and determine it as available code corresponding to the target user identifier.
[0061] Understandably, the available code in the available code library is not only related to the code access attribute of the original code, but also related to the user authority thereof. Only the original code with the code access attribute as public access attribute or the code access attribute as private access attribute and the user authority matching is determined as the available code, the code resources formed in the online development environment can be effectively managed, the needs of code sharing and user authority secrecy can be considered, the available code with private access attribute can be prevented from being obtained by unauthorized users, so as to ensure the security of the available code.
[0062] In an embodiment, as shown in Figure 4 Step S205, that is, obtaining the online editing code based on the online development environment, includes:
[0063] S401: Displaying an online editing interface corresponding to the online development environment, and displaying a user identifier watermark corresponding to the target user identifier on the online editing interface;
[0064] S402: Obtaining the online editing code based on the online editing interface.
[0065] The user identifier watermark refers to a watermark carrying the target user identifier or target user information corresponding to the target user identifier. The target user information refers to user information corresponding to the target user identifier, including but not limited to user name, UM number or other information.
[0066] As an example, in step S401, after the server creates the online development environment, the server can control the client to display the online editing interface corresponding to the online development environment, and control the online editing interface corresponding to the online development environment to display the user identifier watermark corresponding to the target user identifier by using the watermark technology, so as to realize the security protection of the online editing code by using the user identifier watermark.
[0067] As an example, in step S402, after the server controls the client to display the online editing interface carrying the user identifier watermark, the server can receive the online editing code input by the developer through the online editing interface. Understandably, when the developer inputs the online editing code through the online editing interface, the user identifier watermark is displayed on the online editing interface corresponding to the online editing code. If the user takes a screenshot or a photo of the online editing code to obtain a code picture containing the online editing code, the code picture will contain the user identifier watermark, so that the code can be traced based on the user identifier watermark when the online editing code is leaked, which helps to ensure the security of the online editing code.
[0068] In an embodiment, as shown in Figure 5 After step S402, that is, after obtaining the online editing code based on the online editing interface, the cloud-native online development method further includes:
[0069] S501: Obtain a current operation request formed based on an online editing code;
[0070] S502: When the current operation request is a target operation request, obtain a current code identifier corresponding to the online editing code;
[0071] S503: If the current code identifier is a core code identifier, control the online editing interface to display a prohibited operation message;
[0072] S504: If the current code identifier is a non-core code identifier, execute the current operation request to process the online editing code.
[0073] The current operation request refers to a request for operating the online editing code triggered at the current moment. As an example, the current operation request can be a copy operation request, a cut operation request, a paste operation request, or an insert operation request, etc.
[0074] As an example, in step S501, the server can obtain a current operation request formed by the developer based on the online editing code, so as to subsequently execute the current operation request to process the online editing code.
[0075] The target operation request is a request that may need to be limited in operation, which is set in advance. For example, the target operation request can be a paste operation request, such as an operation request for copying the online editing code to other locations.
[0076] The current code identifier refers to a code identifier carried in the online editing code. As an example, the current code identifier is an identifier that the developer assesses whether it is a core code according to its importance when inputting the online editing code. In this example, the current code identifier can be a core code identifier or a non-core code identifier.
[0077] As an example, in step S502, when obtaining the current operation request corresponding to the online editing code, the server needs to perform matching processing on the current operation request and the target operation request pre-configured by the system; if the current operation request is the target operation request, it is determined that processing the online editing code based on the current operation request may cause core code leakage and other situations to occur, therefore, the current code identifier corresponding to the online editing code needs to be identified to determine whether the online editing code is core code.
[0078] As an example, in step S503, when the current code identifier is a core code identifier, the server can determine that the online editing code is core code of software development, and needs to take corresponding security measures. The online editing interface can be controlled to display a prohibited operation message to limit processing of the core code and ensure the security of the online editing code.
[0079] As an example, in step S504, when the current code identifier is determined as a non-core code identifier, the server can determine that the online editing code is a non-core code of software development, execute the current operation request, and process the online editing code. Other than ensuring the security of the online editing code, the online editing code can be processed.
[0080] In an embodiment, as shown in FIG. 2, after step S205, i.e., after obtaining the online editing code based on the online development environment and storing the online editing code in the fixed container space corresponding to the target user identifier, the cloud-native online development method further includes: Figure 6
[0081] S601: obtaining a code debugging request corresponding to the online editing code;
[0082] S602: determining whether the online editing code contains a code dependency identifier based on the code debugging request;
[0083] S603: if the online editing code contains the code dependency identifier, executing a remote debugging program to debug the online editing code and obtaining a code debugging result corresponding to the online editing code;
[0084] S604: if the online editing code does not contain the code dependency identifier, executing an online debugging program to debug the online editing code and obtaining a code debugging result corresponding to the online editing code;
[0085] S605: storing the code debugging result corresponding to the online editing code in the fixed container space corresponding to the target user identifier.
[0086] The code debugging request is a request for debugging the online editing code.
[0087] As an example, in step S601, after the developer inputs the online editing code through the online development environment, the developer can select the online editing code that needs to be debugged, click a debugging button, or input a debugging instruction, so that the server can obtain the code debugging request corresponding to the online editing code.
[0088] As an example, in step S602, after receiving a certain online editing code, the server can identify whether the online editing code contains a code dependency identifier. In this example, the code dependency identifier is an identifier that can identify that the online editing code needs to depend on remote code. The remote code here refers to code formed outside the current online development environment.
[0089] The remote debugging program refers to a program that needs to communicate with a remote debugging container and use remote code to assist the online editing code to complete the debugging process.
[0090] As an example, in step S603, the server determines that the running of the online editing code needs to depend on the remote code when the online editing code contains the code dependency identifier, at which time, the remote debugging program can be executed to debug the online editing code to obtain the code debugging result corresponding to the online editing code.
[0091] The online debugging program refers to a program that can be debugged online without communicating with the remote debugging container.
[0092] As an example, in step S604, the server determines that the running of the online editing code does not need to depend on the remote code when the online editing code does not contain the code dependency identifier, at which time, the online debugging program can be executed to debug the online editing code to obtain the code debugging result corresponding to the online editing code.
[0093] As an example, in step S605, after obtaining the code debugging result corresponding to the online editing code, the server can store the online editing code and the corresponding code debugging result in the fixed container space corresponding to the target user identifier, so that the developer entering the fixed container space can not only quickly and effectively obtain the online editing code, but also obtain the corresponding code debugging result.
[0094] In an embodiment, as shown in Figure 7 Step S603, i.e., executing the online debugging program to debug the online editing code to obtain the code debugging result corresponding to the online editing code, includes:
[0095] S701: Forming an online code image based on the online editing code, storing the online code image in a system image warehouse, and obtaining an image storage address corresponding to the online code image;
[0096] S702: Forming a remote debugging request based on the image storage address, sending the remote debugging request to a remote debugging container running a remote debugging image, so that the remote debugging container forms a remote debugging environment based on the remote debugging image to remotely debug the online code image corresponding to the image storage address, and obtains the code debugging result corresponding to the online editing code.
[0097] The online code image refers to an image formed by encapsulating the online editing code.
[0098] As an example, in step S701, during the execution of the online debugging program, the server needs to first encapsulate and package the online editing code using an image packaging tool to form an online code image, store the online code image in a system image warehouse, and obtain an image storage address corresponding to the online code image, so that the corresponding online code image can be downloaded according to the image storage address.
[0099] The remote debugging request is a request for triggering the implementation of remote debugging. The remote debugging image is a pre-packaged image for implementing the remote debugging function. The remote debugging container is a pre-created container for running the remote debugging image to form a remote debugging environment.
[0100] As an example, in step S702, the server can form a remote debugging request containing the image storage address of the online editing code according to the image storage address, and send the remote debugging request to the remote debugging container running the remote debugging image, so that the remote debugging container completes the remote debugging of the online editing code according to the received remote debugging request. In this example, the remote debugging container can run a pre-configured remote debugging image to form a remote debugging environment; then, according to the image storage address carried in the remote debugging request, download the online code image corresponding to the image storage address from the system image warehouse; then, according to the online code image, obtain the online editing code that needs to be remotely debugged; finally, run the online editing code in the remote debugging environment, and obtain the remote code on which the online editing code depends in the remote debugging environment, according to the order of running the online editing code and the remote code, and according to whether the online editing code can run normally, obtain the code debugging result corresponding to the online editing code.
[0101] Understandably, when remotely debugging the online editing code, the online editing code can be packaged to form an online code image, and the image storage address corresponding to the online code image can be sent to the remote debugging container, which helps to improve the communication efficiency between the server remote debugging containers and ensures the code security. The remote debugging container can remotely debug the online code image corresponding to the image storage address based on the remote debugging environment formed by the remote debugging image, and obtain the code debugging result corresponding to the online editing code. The remote debugging environment formed by the remote debugging container created by the cloud native technology can remotely debug the online editing code and ensure the operability of the online editing code.
[0102] In an embodiment, as shown in Figure 8 Step S604, i.e., executing the online debugging program to debug the online editing code and obtaining the code debugging result corresponding to the online editing code, includes:
[0103] S801: loading the online debugging image onto the temporarily created online debugging container to form an online debugging environment corresponding to the target user identifier;
[0104] S802: performing online debugging on the online editing code in the online debugging environment to obtain the code debugging result corresponding to the online editing code.
[0105] The online debugging image is a pre-packaged image for an online debugging function. The online debugging container is a container temporarily created for running the online debugging image to form an online debugging environment.
[0106] As an example, in step S801, the server can load the online debugging image onto the temporarily created online debugging container to form an online debugging environment corresponding to the target user identifier. The online debugging environment can be understood as an environment created at the current time for online debugging of the online editing code.
[0107] As an example, in step S802, after creating the online debugging environment, the server can directly run the online editing code on the online debugging environment to obtain the code debugging result corresponding to the online editing code according to whether the online editing code can run normally.
[0108] As can be understood, when online debugging the online editing code, the online debugging image can be loaded onto the temporarily created online debugging container to form an online debugging environment, and the online editing code can be debugged using the online debugging environment. On the one hand, the debugging efficiency and code runnability of the online editing code can be guaranteed. On the other hand, since the online debugging environment is created using the temporarily created online debugging container, the corresponding online debugging container needs to be released after the online editing code is debugged, thereby avoiding waste of system resources caused by long-term preservation of the online debugging container.
[0109] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution. The execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0110] In an embodiment, a cloud-native based online development device is provided, which corresponds to the cloud-native based online development method in the above embodiments. As shown in the figure, the cloud-native based online development device includes an online development request obtaining module 901, an available code library obtaining module 902, a target editing image obtaining module 903, an online development environment forming module 904, and an online editing code obtaining module 905. The functions of each module are described in detail as follows: Figure 9
[0111] The online development request obtaining module 901 is configured to obtain an online development request, the online development request including a target user identifier and a target development language.
[0112] The available code library obtaining module 902 is configured to obtain an available code library corresponding to the target user identifier based on the target development language.
[0113] The target editing image acquisition module 903 is configured to acquire a target editing image corresponding to the target development language according to the target development language.
[0114] The online development environment forming module 904 is configured to create a temporary container space corresponding to the target user identifier based on the target editing image, form an online development environment, and load the available code library onto the online development environment.
[0115] The online editing code acquisition module 905 is configured to acquire online editing code based on the online development environment, and store the online editing code in the fixed container space corresponding to the target user identifier.
[0116] In an embodiment, the available code library acquisition module 902 includes:
[0117] The original code acquisition unit is configured to query a system database based on the target development language, and acquire all original codes matching the target development language, each original code corresponding to a code access attribute.
[0118] The first available code determination unit is configured to determine the original code as available code if the code access attribute is a public access attribute.
[0119] The second available code determination unit is configured to acquire target user permissions corresponding to the target user identifier and available user permissions corresponding to the original code if the code access attribute is a private access attribute, and determine the original code as available code when the target user permissions match the available user permissions.
[0120] The available code library acquisition unit is configured to acquire an available code library corresponding to the target user identifier based on all available codes.
[0121] In an embodiment, the online editing code acquisition module 905 includes:
[0122] The online editing interface display unit is configured to display an online editing interface corresponding to the online development environment, and display a user identifier watermark corresponding to the target user identifier in the online editing interface.
[0123] The online editing code acquisition unit is configured to acquire online editing code based on the online editing interface.
[0124] In an embodiment, the cloud-native online development apparatus further includes:
[0125] The current operation request acquisition unit is configured to acquire a current operation request formed based on the online editing code.
[0126] The current code identifier acquisition unit is configured to acquire a current code identifier corresponding to the online editing code when the current operation request is a target operation request.
[0127] The first identification processing unit is configured to control display of the operation prohibition message on the online editing interface if the current code identifier is the core code identifier.
[0128] The second identification processing unit is configured to execute the current operation request and process the online editing code if the current code identifier is the non-core code identifier.
[0129] In an embodiment, the cloud-native online development device further comprises:
[0130] The code debugging request acquisition module is configured to acquire a code debugging request corresponding to the online editing code.
[0131] The code dependency identifier judgment module is configured to judge whether the online editing code contains a code dependency identifier based on the code debugging request.
[0132] The remote debugging processing module is configured to execute a remote debugging program to debug the online editing code and acquire a code debugging result corresponding to the online editing code if the online editing code contains the code dependency identifier.
[0133] The online debugging processing module is configured to execute an online debugging program to debug the online editing code and acquire a code debugging result corresponding to the online editing code if the online editing code does not contain the code dependency identifier.
[0134] The code debugging result storage module is configured to store the code debugging result corresponding to the online editing code in a fixed container space corresponding to the target user identifier.
[0135] In an embodiment, the remote debugging processing module comprises:
[0136] The image storage address acquisition unit is configured to form an online code image based on the online editing code, store the online code image in a system image warehouse, and acquire an image storage address corresponding to the online code image.
[0137] The remote debugging processing unit is configured to form a remote debugging request based on the image storage address, send the remote debugging request to a remote debugging container running a remote debugging image, and cause the remote debugging container to perform remote debugging on the online code image corresponding to the image storage address based on a remote debugging environment formed by the remote debugging image, and acquire a code debugging result corresponding to the online editing code.
[0138] In an embodiment, the online debugging processing module comprises:
[0139] The online debugging environment formation unit is configured to load the online debugging image onto an online debugging container created temporarily to form an online debugging environment corresponding to the target user identifier.
[0140] The online debugging processing unit is configured to perform online debugging on the online editing code in an online debugging environment, and obtain a code debugging result corresponding to the online editing code.
[0141] The specific definitions of the cloud-native online development apparatus can refer to the definitions of the cloud-native online development method, which will not be repeated here. Each module in the cloud-native online development apparatus can be implemented by software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so as to be called and executed by the processor.
[0142] In one embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in Figure 10 The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store data generated or used in the process of the cloud-native online development method. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the cloud-native online development method.
[0143] In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor implements the cloud-native online development method in the above embodiments when executing the computer program, such as Figure 2 as shown in S201-S205, or Figures 3 to 8 For brevity, the functions of the modules / units in this embodiment will not be repeated here. Alternatively, the processor implements the functions of the modules / units in the cloud-native online development apparatus in this embodiment when executing the computer program, such as Figure 9 the functions of the online development request obtaining module 901, the available code base obtaining module 902, the target editing image obtaining module 903, the online development environment forming module 904, and the online editing code obtaining module 905 as shown in
[0144] In one embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the cloud-native online development method in the above embodiments, such as Figure 2S201-S205, or Figures 3 to 8 The computer program is executed by the processor to implement the functions of the modules / units in the above-mentioned embodiment of the cloud-based online development device, for example Figure 9 The functions of the online development request acquisition module 901, the available code library acquisition module 902, the target editing image acquisition module 903, the online development environment formation module 904, and the online editing code acquisition module 905 shown in the above-mentioned embodiment are not repeated here to avoid repetition.
[0145] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database, or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0146] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified. In actual applications, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the above-mentioned functions.
[0147] The above-described embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A cloud-native online development method, characterized in that: include: Obtaining an online development request, wherein the online development request includes a target user identifier and a target development language; Based on the target development language, obtaining an available code library corresponding to the target user identifier; According to the target development language, obtaining a target editing image corresponding to the target development language, the target editing image being an image corresponding to a software editing tool corresponding to the target development language; Based on the target editing image, a temporary container space corresponding to the target user identifier is created to form an online development environment, and the available code library is loaded into the online development environment; Based on the online development environment, online editing code is obtained, and the online editing code is stored in a fixed container space corresponding to the target user identifier.
2. The cloud-native online development method according to claim 1, wherein: The acquiring, based on the target development language, an available code library corresponding to the target user identifier includes: Based on the target development language, a system database is queried to obtain all original codes matching the target development language, and a code access attribute corresponding to each original code; If the code access attribute is a public access attribute, the original code is determined to be an available code; If the code access attribute is a private access attribute, obtaining the target user authority corresponding to the target user identifier and the available user authority corresponding to the original code, and determining the original code as an available code when the target user authority matches the available user authority; Based on all the available codes, an available code library corresponding to the target user identifier is obtained.
3. The cloud-native online development method according to claim 1, wherein: The obtaining of online editing code based on the online development environment includes: Displaying an online editing interface corresponding to the online development environment, wherein the online editing interface displays a user identification watermark corresponding to the target user identification; Based on the online editing interface, an online editing code is obtained.
4. The cloud-native online development method according to claim 3, wherein: After obtaining the online editing code based on the online editing interface, the cloud-native-based online development method further includes: Get the current operation request formed based on the online editing code; When the current operation request is a target operation request, obtaining a current code identifier corresponding to the online editing code; If the current code identifier is a core code identifier, controlling the online editing interface to display a prohibition operation message; If the current code identifier is a non-core code identifier, the current operation request is executed to process the online edit code.
5. The cloud-native online development method according to claim 1, wherein: After obtaining the online editing code based on the online development environment and storing the online editing code in the fixed container space corresponding to the target user identifier, the cloud-native-based online development method further includes: Obtaining a code debugging request corresponding to the online editing code; Based on the code debugging request, determining whether the online editing code includes a code dependency identifier; If the online editing code includes a code dependency identifier, executing a remote debugging program to debug the online editing code and obtain a code debugging result corresponding to the online editing code; If the online editing code does not include a code dependency identifier, executing an online debugging program to debug the online editing code and obtain a code debugging result corresponding to the online editing code; The code debugging result corresponding to the online edited code is stored in a fixed container space corresponding to the target user identifier.
6. The cloud-native online development method according to claim 5, wherein: The executing the online debugging program, debugging the online editing code, and obtaining the code debugging result corresponding to the online editing code includes: Based on the online editing code, an online code image is formed, the online code image is stored in a system image repository, and an image storage address corresponding to the online code image is obtained; A remote debugging request is formed based on the image storage address, and the remote debugging request is sent to a remote debugging container running the remote debugging image, so that the remote debugging container remotely debugs the online code image corresponding to the image storage address based on a remote debugging environment formed by the remote debugging image, and obtains a code debugging result corresponding to the online edited code.
7. The cloud-native online development method according to claim 5, characterized in that The executing the online debugging program, debugging the online editing code, and obtaining the code debugging result corresponding to the online editing code includes: Loading the online debugging image into the temporarily created online debugging container to form an online debugging environment corresponding to the target user identifier; In the online debugging environment, the online editing code is debugged online to obtain a code debugging result corresponding to the online editing code.
8. A cloud-native online development device, characterized in that: include: An online development request acquisition module, configured to acquire an online development request, wherein the online development request includes a target user identifier and a target development language; An available code library acquisition module, configured to acquire an available code library corresponding to the target user identifier based on the target development language; A target editing image acquisition module is used to acquire a target editing image corresponding to the target development language according to the target development language, wherein the target editing image is an image corresponding to the software editing tool corresponding to the target development language; An online development environment forming module, configured to create a temporary container space corresponding to the target user identifier based on the target editing image, form an online development environment, and load the available code library into the online development environment; The online editing code acquisition module is used to acquire the online editing code based on the online development environment and store the online editing code in a fixed container space corresponding to the target user identifier.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the cloud-native-based online development method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cloud-native-based online development method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Cloud platform-based software development method, cloud platform, device and medium
CN109240662A
Code compiling method and device for software development project, equipment and storage medium
CN110569035A