Code editing method and device, equipment and storage medium
Patent Information
- Application Number
- CN202480004114.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2025-12-26
AI Technical Summary
When the existing technology supports intelligent code editing capabilities in different development applications, different plug-ins need to be customized for each application, resulting in high time and development costs.
By receiving code editing requests based on the communication between service components and plug-in components in the development application, determining appropriate target processing modules, generating response messages using the target model, and sending them to the plug-in components to provide a unified code editing response.
It implements code editing requests that support different types of development applications to unify the architecture response, reducing the cost and complexity of plug-in development.
Smart Images

Figure CN121219674A_ABST
Abstract
Description
Code editing method, device, equipment and storage medium Technical Field
[0001] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to a code editing method, apparatus, device, and computer-readable storage medium. Background Art
[0002] With the development of computer technology, generative AI has been applied to various aspects of our lives. For example, some code development applications (e.g., integrated development platforms, or IDEs) can use generative AI to perform various code editing operations, thereby improving code editing efficiency.
[0003] Summary of the Invention
[0004] In a first aspect of the present disclosure, a code editing method is provided. The method includes: receiving a request message from a plug-in component in a development application based on communication between a service component and the plug-in component, the request message being generated based on a code editing request received in the development application; determining, based on a request type indicated by the code editing request, at least one target processing module from a set of basic processing modules for processing the code editing request; generating, by the at least one target processing module, a response message to the request message using a target model; and sending a response message to the plug-in component, so that the plug-in component provides a response to the code editing request based on the response message.
[0005] In a second aspect of the present disclosure, a device for code editing is provided. The device includes: a receiving module configured to receive a request message from a plug-in component in a development application based on communication between a service component and the plug-in component, the request message being generated based on a code editing request received in the development application; a determining module configured to determine, based on a request type indicated by the code editing request, at least one target processing module from a set of basic processing modules for processing the code editing request; a generating module configured to generate a response message to the request message using a target model by the at least one target processing module; and a sending module configured to send a response message to the plug-in component, so that the plug-in component provides a response to the code editing request based on the response message.
[0006] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. When executed by the at least one processing unit, the instructions cause the device to perform the method of the first aspect.
[0007] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.
[0008] In a fifth aspect of the present disclosure, a computer program product is provided, which includes computer-executable instructions, which, when executed by a processor, implement the method according to the first aspect of the present disclosure.
[0009] It should be understood that the content described in this summary section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0011] FIG1 shows a schematic diagram of an example environment in which some embodiments of the present disclosure can be implemented;
[0012] FIG2 shows a flowchart of a code editing process according to some embodiments of the present disclosure;
[0013] FIG3 illustrates an example system architecture according to some embodiments of the present disclosure;
[0014] FIG4 illustrates an example communication process according to some embodiments of the present disclosure;
[0015] FIG5 shows a schematic structural block diagram of an example apparatus for code editing according to some embodiments of the present disclosure; and
[0016] FIG6 illustrates a block diagram of an electronic device capable of implementing various embodiments of the present disclosure. DETAILED DESCRIPTION
[0017] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0018] It should be noted that the titles of any section / subsection provided herein are not limiting. Various embodiments are described throughout this document, and any type of embodiment may be included under any section / subsection. Furthermore, the embodiments described in any section / subsection may be combined in any manner with any other embodiments described in the same section / subsection and / or in different sections / subsections.
[0019] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may be included below. The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may be included below.
[0020] The embodiments of the present disclosure may involve user data, data acquisition and / or use, etc. These aspects shall comply with the corresponding laws, regulations and relevant provisions. In the embodiments of the present disclosure, all data collection, acquisition, processing, processing, forwarding, use, etc. are carried out on the premise that the user is aware of and confirms them. Accordingly, when implementing the various embodiments of the present disclosure, the types, scope of use, and usage scenarios of the data or information that may be involved should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with the relevant laws and regulations. The specific notification and / or authorization method may vary according to the actual situation and application scenario, and the scope of the present disclosure is not limited in this respect.
[0021] If this specification and the solutions in the examples involve the processing of personal information, such processing will be done only with a legitimate basis (such as with the consent of the subject of personal information or as necessary for the performance of a contract) and only within the prescribed or agreed scope. A user's refusal to process personal information other than that required for basic functions will not affect the user's use of basic functions.
[0022] Some developers can support intelligent code editing capabilities in their applications by providing plug-ins associated with generative AI technology. Traditionally, to support such code editing capabilities in different applications, developers may need to customize different plug-ins for different applications, which requires a lot of time and development costs.
[0023] Embodiments of the present disclosure provide a solution for code editing. According to the solution, based on communication between a service component and a plug-in component in a development application, a request message can be received from the plug-in component, where the request message is generated based on a code editing request received in the development application; based on the request type indicated by the code editing request, at least one target processing module for processing the code editing request is determined from a set of basic processing modules; the at least one target processing module generates a response message to the request message using a target model; and a response message is sent to the plug-in component, so that the plug-in component provides a response to the code editing request based on the response message.
[0024] In this way, embodiments of the present disclosure can support responding to code editing requests in different types of development applications with a unified architecture.
[0025] Various example implementations of this solution are described in detail below in conjunction with the accompanying drawings.
[0026] Sample Environment
[0027] FIG1 shows a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. As shown in FIG1 , the example environment 100 may include an electronic device 110 .
[0028] In this example environment 100, electronic device 110 may run an application 120 that supports interface interaction. Application 120 may be any suitable type of application for interface interaction, examples of which may include, but are not limited to, code editing applications, applications integrated with an integrated development environment (IDE), or other suitable applications such as a browser. User 140 may interact with application 120 via electronic device 110 and / or its attached devices.
[0029] In the environment 100 of FIG. 1 , if the application 120 is in an active state, the electronic device 110 may present an interface 150 for supporting interface interaction through the application 120 .
[0030] In some embodiments, the electronic device 110 communicates with the server 130 to enable the provision of services for the application 120. The electronic device 110 can be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a handheld computer, a portable game terminal, a VR / AR device, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a gaming device or any combination thereof, including accessories and peripherals of these devices or any combination thereof. In some embodiments, the electronic device 110 can also support any type of interface for the user (such as a "wearable" circuit, etc.).
[0031] The server 130 may be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data and artificial intelligence platforms. For example, the server 130 may include a computing system / server such as a mainframe, an edge computing node, a computing device in a cloud environment, and the like. The server 130 may provide background services for the application 120 that supports virtual scenes in the electronic device 110.
[0032] A communication connection may be established between the server 130 and the electronic device 110. The communication connection may be established in a wired or wireless manner. The communication connection may include, but is not limited to, a Bluetooth connection, a mobile network connection, a Universal Serial Bus (USB) connection, a Wireless Fidelity (WiFi) connection, etc., and the embodiments of the present disclosure are not limited in this respect. In the embodiments of the present disclosure, the server 130 and the electronic device 110 may implement signaling interaction through the communication connection between the two.
[0033] It should be understood that the structure and function of the various elements in the environment 100 are described for illustrative purposes only and do not imply any limitation on the scope of the present disclosure.
[0034] Some example embodiments of the present disclosure will be described below with continued reference to the accompanying drawings.
[0035] Example Process
[0036] FIG2 shows a flowchart of an example process 200 for code editing according to some embodiments of the present disclosure. The process 200 shown in FIG2 will be described below with reference to FIG3 .
[0037] As shown in FIG. 2 , in block 210 , based on the communication between the service component and the plug-in component in the development application, a request message is received from the plug-in component, wherein the request message is generated based on a code editing request received in the development application.
[0038] Figure 3 shows an example system architecture 300 according to some embodiments of the present disclosure. As shown in Figure 3, the system architecture 300 may include a plug-in component 310 deployed in a development application 305 (eg, an IDE). Such a plug-in component 310 may be equivalent to a client.
[0039] 3 , the system architecture 300 may further include a service component 315. In some embodiments, the service component 315 may be implemented as a local server. For example, both the service component 315 and the plug-in component 310 may run in the electronic device 110 shown in FIG1 .
[0040] In some embodiments, if the development application is based on a cloud-based development platform, the plug-in component 310 and / or the service component 315 may also be implemented in a cloud device.
[0041] As shown in Figure 3, the service component 315 may include an access layer 320, which may establish communication with the plug-in component 310 based on a preset communication protocol. Figure 4 shows an example communication process according to some embodiments of the present disclosure.
[0042] As shown in FIG4 , plug-in component 310 and service component 315 can establish a connection based on the communication protocol in process 410. Specifically, plug-in component 310 can send a request to service component 315 to initiate communication. Service component 315 can establish a connection based on the request and monitor the connection. In addition, service component 315 can also transmit necessary information to plug-in component 310 to enable plug-in component 310 to establish the connection and monitor the connection. Thus, plug-in component 310 and service component 315 can establish a communication connection.
[0043] To support communication between the plug-in component 310 and the service component 315, the plug-in component 310 and the service component 315 may also initialize the service component 315, for example, a local server, based on process 420. Specifically, the plug-in component 310 may send an initialization request to the service component 315 and receive an initialization result from the service component 315. After completing the initialization, the service component 315 may also send an initialization notification to the service component 315.
[0044] In this manner, embodiments of the present disclosure may establish a connection between the plug-in component 310 and the service component 315 based on the communication protocol.
[0045] Furthermore, when the plug-in component 310 receives a code editing request from the development application 305 , the plug-in component 310 may further generate a request message based on the communication protocol between the two.
[0046] In some embodiments, the request message may include a set of parameters associated with the code editing request. The plug-in component 310 may determine the parameter types of the set of parameters to be included in the request message based on the request type of the code editing request, for example.
[0047] Taking a code completion request as an example, the plug-in component 310 may transmit a corresponding prompt item (ie, prompt), a language version of the code, related code currently triggering completion, etc. in the request message.
[0048] 2 , in block 220 , the service component 315 determines at least one target processing module for processing the code editing request from a group of basic processing modules based on the request type indicated by the code editing request.
[0049] As shown in Figure 3, service component 315 may further include a capability layer 325, which may include capability packages corresponding to different types of editing requests. For example, if the code editing request is a code completion request, service component 315 may determine a capability package corresponding to the code completion request from the multiple capability packages included in capability layer 325.
[0050] In some embodiments, such capability encapsulation may be implemented based on the logic layer 330 of the service component 315. Specifically, the logic layer 330 may include a target processing flow corresponding to the capability encapsulation. Such a target processing flow may include, for example, one or more preset processing stages.
[0051] As shown in FIG3 , such a target processing flow may include, for example, one or more of the following stages: a pre-processing stage, a context collection stage, a policy execution stage, a guide item encapsulation stage, a model calling stage, and a post-processing stage.
[0052] Specifically, the pre-processing stage may include, for example, analyzing the intent of the code editing request. For example, the pre-processing stage may include determining that the intent of the code editing request is code completion.
[0053] Furthermore, the context collection phase may be used to obtain context information related to processing the code editing request. In some embodiments, different types of editing requests may trigger the acquisition of different context information.
[0054] As shown in Figure 3, the service component 315 can provide, for example, multiple types of parsers for obtaining corresponding context information. In some embodiments, different types of parsers can correspond to different types of development applications 305, for example.
[0055] Furthermore, the policy execution phase may include invoking a preset policy to process the code editing request. For example, the policy execution phase may include sorting the context information to determine more relevant context information.
[0056] The prompt packaging phase may include constructing prompts for the target model 340 based on the received request message, the extracted context information, and the like.
[0057] The model calling phase may include inputting the guidance information into the target model 340 through a method such as an API call to obtain a processing result of the target model 340 .
[0058] The post-processing stage may include performing appropriate post-processing on the processing result of the target model 340 to generate a response message provided to the plug-in component 310 .
[0059] In some embodiments, different types of code editing requests may include different phases among the above multiple preset phases. For example, a code completion request may require a policy execution phase to perform operations such as sorting, but a code annotation request may not require a policy execution phase.
[0060] The embodiments of the present disclosure can provide standardized processing procedures for various types of editing requests by customizing standardized processing flows. In addition, such processing flows can also be scalable. For example, pre-processing and post-processing may have different strategy components, and R&D personnel can arbitrarily customize pre-processing and post-processing strategies in the processing flow. In addition, such processing flows are also scalable from a capability perspective, that is, desired capabilities can be expanded based on the processing flow.
[0061] 3 , the service component 315 may also provide various basic processing modules to support the service component 315 in completing the target processing flow by combining one or more basic processing modules. For example, such basic processing modules may include different types of parsers, policy execution modules, etc.
[0062] In some embodiments, the service component 315 can determine at least one target processing module corresponding to the target processing flow corresponding to the code editing request from such multiple basic processing modules. For example, based on the current code editing request being a code completion request from "Development Application 1", the service component 315 can determine that such target processing modules include a context parser and a sorting module corresponding to "Development Application 1".
[0063] 2 , in block 230 , the at least one target processing module generates a response message for the request message using a target model.
[0064] Specifically, as shown in FIG3 , the service component 315 may, for example, utilize at least one target processing module to correspondingly complete the construction of the guide item, and may obtain the output result of the target model 340 by calling the target model 340 .
[0065] Furthermore, the service component 315 may generate a response message for the request message based on the output result of the target model 340. For example, the service component 315 may perform a specified post-processing process on the output result and further generate the response message.
[0066] In some embodiments, as shown in FIG3 , the service component 315 may further include an agent tool. Such an agent tool may include multiple application program interfaces (APIs). Such multiple APIs may be used to trigger the execution of actions associated with the development application 305.
[0067] Specifically, since the service component 315 cannot directly call the capabilities in the target application 305, the embodiments of the present disclosure can construct such multiple APIs to support triggering the target application 305 to perform corresponding actions through the API.
[0068] In some embodiments, during the process of calling the target model 340, one or more of the multiple APIs may also be provided to the target model for use in the processing of the target model 340. For example, this enables the target model to generate corresponding output results based on such API information.
[0069] 3 , the service component 315 may also include a tool layer 335 , and accordingly may provide multiple tool modules corresponding to different processing capabilities. Such multiple tool modules may include, for example, an intent understanding module, a testing module, a statistics module, and a semantic parsing module.
[0070] In some embodiments, during the execution of the target processing flow, at least one target processing module may further call at least one tool module from the plurality of tool modules to process the code editing request.
[0071] 2 , in block 240 , the service component 315 sends the response message to the plug-in component 310 , so that the plug-in component provides a response to the code editing request based on the response message.
[0072] As shown in FIG4 , taking the code editing request as a code completion request as an example, in process 430, plug-in component 310 may first send the code completion request to service component 315. Furthermore, service component 315 may obtain the request by obtaining context information from plug-in component 310. Accordingly, plug-in component 310 may send corresponding context information to service component 315 as a response.
[0073] In some embodiments, the communication protocol between the plug-in component 310 and the service component 315 may include a first protocol portion that specifies transmission specifications corresponding to different types of code editing requests. For example, a code completion request sent by the plug-in component 310 to the service component 315 may be transmitted based on the first protocol portion.
[0074] In some embodiments, the communication protocol between the plug-in component 310 and the service component 315 may further include a second protocol portion, which is used to indicate a transmission specification for context information associated with the development application. For example, the context information sent by the plug-in component 310 to the service component 315 may be transmitted based on the second protocol portion.
[0075] Additionally, in process 430 , the service component 315 may also send the code completion result to the plug-in component 310 , thereby completing the processing of the code completion request.
[0076] In some embodiments, as shown in FIG4 , at 440, the plug-in component 310 may also close the communication with the service component 315. Specifically, the plug-in component 310 may send a close request to the service component 315 and obtain a close result sent by the service component 315. After determining that the close result is correct, the plug-in component 310 may send an exit notification to the service component 315, causing the service component 315 to process the exit and stop responding to the plug-in component 315.
[0077] Based on the process described above, the embodiments of the present disclosure can, on the one hand, support the rapid integration of generative AI capabilities into application plug-ins through corresponding communication protocols, thereby reducing plug-in development costs. On the other hand, the service component provides a standardized processing flow design, thereby providing a component that supports streamlined, monitorable, and traceable generative AI capabilities.
[0078] Example devices and equipment
[0079] Embodiments of the present disclosure also provide corresponding apparatuses for implementing the above-described methods or processes. FIG5 shows a schematic structural block diagram of an example apparatus 500 for code editing according to certain embodiments of the present disclosure. Apparatus 500 may be implemented as or included in an electronic device. Each module / component in apparatus 500 may be implemented by hardware, software, firmware, or any combination thereof.
[0080] As shown in Figure 5, the device 500 includes a receiving module 510, which is configured to receive a request message from the plug-in component based on the communication between the service component and the plug-in component in the development application, where the request message is generated based on the code editing request received in the development application; a determining module 520, which is configured to determine at least one target processing module for processing the code editing request from a set of basic processing modules based on the request type indicated by the code editing request; a generating module 530, which is configured to generate a response message to the request message using a target model by at least one target processing module; and a sending module 540, which is configured to send a response message to the plug-in component, so that the plug-in component provides a response to the code editing request based on the response message.
[0081] In some embodiments, the receiving module 510 is further configured to: establish communication between the service component and the plug-in component based on a communication protocol between the service component and the plug-in component; and receive a request message from the plug-in component via the communication.
[0082] In some embodiments, the request message includes a set of parameters associated with the code edit request, wherein a parameter type of the set of parameters is determined based on a request type of the code edit request.
[0083] In some embodiments, the communication protocol includes: a first protocol part, which is used to indicate transmission specifications corresponding to different types of code editing requests; and a second protocol part, which is used to indicate transmission specifications of context information associated with the development application.
[0084] In some embodiments, the determination module 520 is further configured to: determine a target processing flow corresponding to the request type, the target processing flow including at least one processing stage; and determine at least one target processing module corresponding to the target processing flow from a set of basic processing modules.
[0085] In some embodiments, at least one processing stage includes one or more of the following stages: a pre-processing stage; a context collection stage; a policy execution stage; a guide item encapsulation stage; a model calling stage; and a post-processing stage.
[0086] In some embodiments, the service component further includes a plurality of tool modules corresponding to different processing capabilities, and the at least one target processing module is configured to call at least one tool module of the plurality of tool modules to process the code editing request.
[0087] In some embodiments, the service component further includes a plurality of application program interfaces (APIs) implemented based on the communication between the service component and the plug-in component, and the plurality of APIs are used to trigger the execution of actions associated with the development application.
[0088] In some embodiments, at least one API among the plurality of APIs is provided to the target model for use in the processing of the target model.
[0089] FIG6 shows a block diagram of an electronic device 600 in which one or more embodiments of the present disclosure may be implemented. It should be understood that the electronic device 600 shown in FIG6 is merely exemplary and should not be construed as limiting the functionality and scope of the embodiments described herein. The electronic device 600 shown in FIG6 can be used in an electronic device.
[0090] As shown in FIG6 , electronic device 600 is a general-purpose electronic device. Components of electronic device 600 may include, but are not limited to, one or more processors or processing units 610, memory 620, storage device 630, one or more communication units 640, one or more input devices 650, and one or more output devices 660. Processing unit 610 may be a real or virtual processor and is capable of performing various processes according to programs stored in memory 620. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to enhance the parallel processing capabilities of electronic device 600.
[0091] The electronic device 600 typically includes a plurality of computer storage media. Such media can be any accessible media that can be obtained by the electronic device 600, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 620 can be a volatile memory (e.g., registers, cache, random access memory (RAM)), a non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 630 can be a removable or non-removable medium and can include a machine-readable medium, such as a flash drive, a disk, or any other medium that can be used to store information and / or data and can be accessed within the electronic device 600.
[0092] The electronic device 600 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG6 , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a “floppy disk”) and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to a bus (not shown) by one or more data media interfaces. The memory 620 may include a computer program product 625 having one or more program modules configured to perform various methods or actions of various embodiments of the present disclosure.
[0093] The communication unit 640 enables communication with other electronic devices via a communication medium. Additionally, the functions of the components of the electronic device 600 can be implemented in a single computing cluster or multiple computing machines that can communicate via a communication connection. Thus, the electronic device 600 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0094] The input device 650 may be one or more input devices, such as a mouse, keyboard, or trackball. The output device 660 may be one or more output devices, such as a display, a speaker, or a printer. The electronic device 600 may also communicate with one or more external devices (not shown) through the communication unit 640 as needed, such as a storage device, a display device, or the like, with one or more devices that allow a user to interact with the electronic device 600, or with any device that allows the electronic device 600 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0095] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.
[0096] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.
[0097] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0098] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0099] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple implementations of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part for a module, program segment or instruction, and a part for a module, program segment or instruction comprises one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0100] While various implementations of the present disclosure have been described above, the foregoing description is intended to be illustrative, not exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is selected to best explain the principles of the implementations, their practical applications, or improvements to existing technologies, or to enable others skilled in the art to understand the various implementations disclosed herein.
Claims
1. A code editing method, comprising: Based on the communication between the service component and the plug-in component in the development application, receiving a request message from the plug-in component, the request message being generated based on a code editing request received in the development application; Based on the request type indicated by the code editing request, determining at least one target processing module for processing the code editing request from a group of basic processing modules; The at least one target processing module generates a response message for the request message using the target model; as well as The response message is sent to the plug-in component, so that the plug-in component provides a response to the code editing request based on the response message.
2. The method according to claim 1, wherein receiving a request message from the plug-in component comprises: Establishing the communication between the service component and the plug-in component based on a communication protocol between the service component and the plug-in component; as well as The request message is received from the plug-in component via the communication. 3 . The method of claim 2 , wherein the request message includes a set of parameters associated with the code editing request, wherein parameter types of the set of parameters are determined based on the request type of the code editing request.
4. The method according to claim 1, wherein the communication protocol comprises: A first protocol part, the first protocol part is used to indicate transmission specifications corresponding to different types of code editing requests; A second protocol part, wherein the second protocol part is used to indicate a transmission specification of context information associated with the development application.
5. The method according to claim 1, wherein determining at least one target processing module for processing the code editing request from a group of basic processing modules based on the request type indicated by the code editing request comprises: Determine a target processing flow corresponding to the request type, wherein the target processing flow includes include at least one processing stage; as well as The at least one target processing module corresponding to the target processing flow is determined from the group of basic processing modules.
6. The method of claim 5, wherein the at least one processing stage comprises one or more of the following stages: Pre-processing stage; Context acquisition phase; Strategy execution phase; Boot item packaging stage; Model calling phase; Post-processing stage.
7. The method according to claim 1, wherein the service component further comprises a plurality of tool modules corresponding to different processing capabilities, and the at least one target processing module is configured to call at least one tool module among the plurality of tool modules to process the code editing request.
8. The method according to claim 1, wherein the service component further comprises a plurality of application program interfaces (APIs) implemented based on the communication between the service component and the plug-in component, and the plurality of APIs are used to trigger execution of actions associated with the development application. 9 . The method according to claim 8 , wherein at least one API among the plurality of APIs is provided to the target model for use in a processing procedure of the target model.
10. A device for code editing, comprising: A receiving module, configured to receive a request message from a plug-in component in a development application based on communication between the service component and the plug-in component, wherein the request message is generated based on a code editing request received in the development application; a determination module configured to determine, based on a request type indicated by the code editing request, at least one target processing module for processing the code editing request from a group of basic processing modules; A generating module, configured to generate a response message to the request message by using a target model by the at least one target processing module; as well as The sending module is configured to send the response message to the plug-in component, so that the plug-in component provides a response to the code editing request based on the response message.
11. An electronic device, comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 9 when executed by the at least one processing unit.
12. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 9.
13. A computer program product comprising computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 9.