A data recording method and apparatus for AI-assisted programming

By recording data from each session unit in AI-assisted programming and generating chained session data, the problem of data loss in AI-assisted programming is solved, and the complete recording of the code writing process and bug tracing are realized.

CN123114440APending Publication Date: 2026-11-17YUANBAO DIGITAL TECH (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611035286.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-13
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In AI-assisted programming, the dialogue between the user and the AI, the use of tools, and the reasoning process exist only in the session window. The data is lost after the session is closed, lacking credible process evidence and making it difficult to trace the background and generation process of the code.

Method used

By creating session codes in AI-assisted programming and recording data for each process from inputting prompts to generating target code as a recording unit, chained session data is generated, including tool call results, code descriptions, code submission information, etc., achieving fine-grained data recording.

Benefits of technology

It provides a complete record of the code reasoning process, supporting subsequent code tracing and bug localization, and ensuring the integrity and traceability of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114440A_ABST
    Figure CN123114440A_ABST
Patent Text Reader

Abstract

This invention provides a data recording method and apparatus for AI-assisted programming, relating to the field of artificial intelligence technology. The method includes: in response to a user creating a target session, determining a session code corresponding to the target session; repeatedly executing the following steps until the target session ends: in response to a user inputting a prompt word in the target session, creating a first recording unit for the current record and acquiring first recording data; in response to generating a target code corresponding to the prompt word, generating a first data recording result corresponding to the first recording unit based on the first recording data and the session code; and updating the historical chained session data corresponding to the target session based on the first data recording result. This method can completely record the reasoning process of the target code, providing data support for code tracing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a data recording method and apparatus for AI-assisted programming. Background Technology

[0002] With the rapid development of AI tools, developers also rely heavily on AI-assisted programming in the code development process to write code quickly and efficiently. However, AI-assisted programming has the following problems: (1) In AI-assisted programming, the dialogue between the user and the AI, the tool calls and the reasoning process only exist in the conversation window. The data will be lost after the conversation is closed, and the code cannot be replayed after it is written, which makes AI-assisted programming lack credible process evidence; (2) When development testing or code bugs are found after the code is launched, developers often cannot restore the complete background of the code writing. They are not clear about what requirements the specific code segment was generated based on, what specific instructions were given to the AI ​​when it was generated, what reasoning the code segment was generated based on, etc., which makes it difficult to effectively locate the specific problems of the code segment without this contextual information. Summary of the Invention

[0003] This invention provides a data recording method and apparatus for AI-assisted programming, which addresses the shortcomings of existing technologies that cannot effectively record the context of AI-assisted programming.

[0004] This invention provides a data recording method for AI-assisted programming, applied to an AI-assisted programming agent, comprising the following steps: in response to a user creating a target session, determining a session code corresponding to the target session; repeatedly executing the following steps until the target session ends: in response to a user inputting a prompt word in the target session, creating a first recording unit for the current record and acquiring first recording data; in response to generating a target code corresponding to the prompt word, generating a first data recording result corresponding to the first recording unit based on the first recording data and the session code; updating the pointers of the historical chained session data corresponding to the target session based on the first data recording result, generating target chained session data; wherein, the historical chained session data includes second data recording results corresponding to at least one second recording unit of a historical record and pointers corresponding to each second data recording result.

[0005] Optionally, the step of generating a first data record result corresponding to the first record unit based on the first record data and the session encoding in response to generating a target code corresponding to the prompt word includes: performing a hash calculation on the first record data to obtain a unit encoding corresponding to the first record unit in response to generating a target code corresponding to the prompt word; and generating a first data record result corresponding to the first record unit based on the session encoding and the unit encoding.

[0006] Optionally, the first record data includes tool call results; the step of creating the first record unit of the current record and obtaining the first record data includes: determining the AI ​​tool information called by the first record unit; and generating tool call results based on the AI ​​tool information and the AI ​​tool call operation.

[0007] Optionally, the unit data further includes code descriptions; the step of creating the first record unit of the current record and obtaining the first record data includes: generating a traceability anchor point corresponding to the first record unit before submitting the target code to the local repository; and generating code descriptions corresponding to the first record unit based on the traceability anchor point.

[0008] Optionally, the unit data further includes code commit information; the step of creating the first record unit of the current record and obtaining the first record data includes: obtaining the metadata of the code repository; and generating the code commit information corresponding to the first record unit based on the target code and the metadata.

[0009] Optionally, updating the pointer to the historical chained session data corresponding to the target session based on the first data recording result to generate the target chained session data includes: updating the tail node of the historical chained session data to the first data recording result, and updating the pointer of the last second data recording result in the historical chained session records based on the tail node.

[0010] Optionally, generating a first data recording result corresponding to the first recording unit based on the first recording data and the session encoding includes: determining the developer information corresponding to the target code; and generating a first data recording result corresponding to the first recording unit based on the first recording data, the session encoding, and the developer information.

[0011] Optionally, determining the developer information corresponding to the target code includes at least one of the following: obtaining developer information from the login information of the target session using an integrated development environment plugin; obtaining developer information from system environment variables or configuration files using a command-line page; or obtaining developer information from authentication information using an API interface.

[0012] The present invention also provides a data recording device for AI-assisted programming, applied to an AI-assisted programming agent, comprising the following modules: The session module is used to determine the session code corresponding to the target session in response to the user creating the target session; The recording unit module is used to repeatedly execute the following steps until the target session ends: in response to a user inputting a prompt word in the target session, creating a first recording unit for the current record and obtaining first recording data; in response to generating a target code corresponding to the prompt word, generating a first data recording result corresponding to the first recording unit based on the first recording data and the session code; updating the historical chained session data corresponding to the target session based on the first data recording result to generate target chained session data; wherein, the historical chained session data includes second data recording results corresponding to at least one second recording unit of a historical record.

[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data recording method for AI-assisted programming as described above.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data recording method for AI-assisted programming as described above.

[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the data recording method for AI-assisted programming as described above.

[0016] The present invention provides a data recording method and apparatus for AI-assisted programming. By creating session encoding when a user creates a target session, and further recording data from the input prompt word to the generation of the target code corresponding to the prompt word as a recording unit in the target session, the data can be recorded from the fine dimension of the recording unit. This enables a complete recording of the reasoning process of the target code in AI-assisted programming, providing data support for subsequent code tracing. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1This is a flowchart illustrating the data recording method for AI-assisted programming provided by the present invention.

[0019] Figure 2 This is a schematic diagram of the process for obtaining the first record data provided by the present invention.

[0020] Figure 3 This is a schematic diagram of the data recording method device for AI-assisted programming provided by the present invention.

[0021] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0023] Before describing the data recording method for AI-assisted programming provided by this invention, let's first explain the current process of code submission based on assisted programming agents. Specifically, the user first needs to interact with the assisted programming agent to generate corresponding target code based on the user's input prompts. Then, the code is submitted through a distributed version control system (Git) to preserve the code modification process in the Git system. However, the process of generating target code using an assisted programming agent is often not instantaneous. It involves continuous improvement of the code through round-robin dialogues within the same target session until the final code required by the user is obtained. If only the final code is submitted, the Git system can only store and snapshot the final code version, unable to synchronously acquire the actual code modification logic and process during multiple rounds of dialogue. This makes it difficult for the user to trace the problem through the Git system when bugs appear in the final code. Therefore, in this embodiment of the invention, a data recording method for AI-assisted programming is specifically provided. Each round of dialogue in the target session (i.e., the complete process from inputting prompts to calling tools for code writing and finally outputting the target code) is treated as a recording unit. Data is recorded for each recording unit and submitted to the Git system. After the target session ends, chained session data is generated based on the recording results corresponding to the multiple recording units included in the target session. This achieves fine-grained code recording during AI-assisted programming. It is understood that AI-assisted programming in this embodiment refers to a human-machine collaborative code writing process involving an AI agent; the degree of participation of the AI ​​agent is not specifically limited.

[0024] Figure 1 This is one of the flowcharts illustrating the data recording method for AI-assisted programming provided by the present invention, such as... Figure 1 As shown, this method is applied to an assisted programming agent and includes the following: Step 101: In response to the user creating a target session, determine the session code corresponding to the target session.

[0025] The session code is a unique identifier representing the target session. Since a target session may include multiple record units, it is necessary to generate a corresponding session code for the target session in order to identify which target session a record unit belongs to and obtain the association relationship between the session and the record unit.

[0026] In one optional embodiment, the session encoding can be a session identifier obtained from the native interface of the AI-assisted programming agent. The session identifier is a globally unique identifier used to identify and manage a single active session thread; multiple record units within the same session will carry the same session identifier. It should be noted that obtaining the session encoding from the AI-assisted programming agent's session identifier ensures the stability of the session encoding across multiple rounds of dialogue, maintaining its integrity across context compression, thereby providing a unified representation of multiple rounds of dialogue belonging to the same target session.

[0027] Repeat steps 102 to 104 until the target session ends; Step 102: In response to the user entering a prompt in the target session, create the first record unit of the current record and obtain the first record data.

[0028] In actual interaction with the AI-assisted programming agent, the user typically first creates a target session (i.e., opens a session page), then inputs a prompt word in the target session and clicks the input button. Only then is the prompt word sent to the AI-assisted programming agent so that it can assist in writing the target code based on the prompt word. In other words, in this embodiment of the invention, the process of determining the session encoding and creating the first record unit are automatically triggered based on the user's actual operation, thereby achieving automatic data collection without requiring manual intervention from the developer. In other words, this embodiment of the invention, through the above step 102, achieves automated data collection during the interaction with the AI-assisted programming agent.

[0029] In an optional embodiment, the first record data includes the tool call result, and the process of creating the first record unit of the current record and obtaining the first record data in step 102 can be specifically as follows: Figure 2 As shown, it includes: Step 201: Determine the AI ​​tool information called by the first recording unit; Step 202: Generate tool call results based on AI tool information and AI tool call operations.

[0030] Among them, AI tool information allows developers to intuitively know the specific tools called by the AI-assisted programming agent when generating target code, that is, to quickly know the source and process of target code generation, thereby recording the specific process of AI-assisted programming.

[0031] In a further optional embodiment, the first recorded data also includes code descriptions, still in the form of... Figure 2 For example, the process of obtaining the first record data further includes: Step 203: Before submitting the target code to the local repository, generate a traceability anchor point corresponding to the first record unit; Step 204: Generate code descriptions corresponding to the first record unit based on the traceability anchor points.

[0032] For example, a traceability anchor can be added to the end of the original code description. For instance, add "AI-session: { session_id} trailer" to the end of the original code description. The trailer only records the session_id (conversation-level stable identifier) ​​and does not list the specific unit code. This can cover the entire conversation scope while avoiding developers' concern about the specific recording unit.

[0033] In a further optional embodiment, the first record data also includes code commit information, still in the form of... Figure 2 For example, the process of obtaining the first record data further includes: Step 305: Obtain the metadata of the code repository; Step 306: Generate code submission information corresponding to the first record unit based on the target code and metadata.

[0034] The metadata of the code repository, such as the commit hash field (the commit hash value of the target code), the branch field (the name of the active branch where the target session is located), and the author field (database source information), is transformed into structured data and recorded in dedicated fields of the code commit information. This embodiment of the invention, by recording the metadata of the code repository, can effectively record the generation environment information of the target code, enabling clear identification of the specific environment information corresponding to the target code during bug tracing.

[0035] It should be noted that the tool call results, code descriptions, and code submission information obtained in steps 201 to 202, 203 to 204, and 205 to 206 can all be used as part of the first record data. The acquisition process can be executed synchronously or asynchronously. This invention does not impose specific limitations on this. The more comprehensive the coverage of the acquired first record data, the more accurate the process recording of AI-assisted programming will be, and the greater the help in subsequent bug fixing and code location. Therefore, it is preferable to synchronously include code descriptions, code submission information, and tool call results in the unit data.

[0036] Step 103: In response to generating the target code corresponding to the prompt word, generate the first data record result corresponding to the first record unit based on the first record data and the session encoding.

[0037] It is understandable that the AI-assisted programming agent will generate different target codes during multi-turn dialogues, and the specific improvement process can be reflected between the multi-turn target codes. Therefore, each time a target code corresponding to a prompt word is generated, the corresponding first data record result will be generated based on the first record data in the current dialogue.

[0038] In one optional embodiment, step 103 specifically includes: in response to generating a target code corresponding to the prompt word, performing a hash calculation on the first record data to obtain a unit code corresponding to the first record unit; and generating a first data record result corresponding to the first record unit based on the session code and the unit code. Specifically, by performing a hash calculation on the first record data, a unit code uniquely bound to the first record data can be generated, which can be effectively used to verify data integrity, consistency, and security, preventing data tampering.

[0039] Step 104: Update the historical chained session data corresponding to the target session according to the first data recording result to generate target chained session data; wherein, the historical chained session data includes the second data recording result corresponding to at least one second record unit of the historical record.

[0040] In this context, the second record unit in the historical record of the target session refers to the record unit that is in the same target session as the first record unit and precedes it. For example, after opening the target session, the user engages in four rounds of dialogue with the AI-assisted programming agent. Each round is a process from the user's input of a prompt to the generation of target code, and the four rounds are interconnected. For instance, the four rounds are: Round 1: Input prompt 1 - Generate target code 1; Round 2: Input improved prompt 2 related to target code 1 - Generate target code 2; Round 3: Input improved prompt 3 related to target code 2 - Generate target code 3; Round 4: Input improved prompt 4 related to target code 3 - Generate final target code 4. With each input of a prompt, the AI-assisted programming agent creates the first record unit for the current session. After generating the target code corresponding to the prompt, it ends the first record unit for the current session and updates the historical chained session data to ensure that the chained session data corresponding to the target session is updated in real time with the first record unit.

[0041] In one optional embodiment, step 104 specifically includes: updating the tail node of the historical chained session data to the first data record result, and updating the pointer of the last second data record result in the historical chained session records according to the tail node. For example, after completing the second round of dialogue, chained session data is generated based on the first data record result corresponding to the second round of dialogue and the second data record result corresponding to the first round of dialogue. The first data record result corresponding to the second round of dialogue is used as the tail node, and the second data record corresponding to the first round of dialogue is used as the head node. The backward pointer of the second data record corresponding to the first round of dialogue points to the first data record result corresponding to the second round of dialogue. Similarly, after each round of dialogue, the nodes and pointers of the chained session data are updated to obtain the target chained session data. It is understood that when only the first data record result corresponding to the first round of dialogue exists, there is no chained structure. Therefore, the target chained session data in this embodiment of the invention will only be generated when there are at least multiple rounds of dialogue. In practical applications, recording the developer information corresponding to the target code is also crucial. When problems arise in the target code, it is often necessary to locate the corresponding developer for appropriate modifications. Therefore, in an optional embodiment of the present invention, the process of generating the first data record result in step 103 may further include: determining the developer information corresponding to the target code; and generating the first data record result corresponding to the current record unit based on the first record data, session encoding, and developer information. In other words, along with the generation of the target code, the corresponding developer information is also recorded as part of the data in the first data record result to facilitate subsequent attribution of responsibility.

[0042] In one alternative embodiment, determining developer information may include at least one of the following methods: obtaining developer information from the login information of the target session using an integrated development environment plugin; obtaining developer information from system environment variables or configuration files using a command-line page; or obtaining developer information from authentication information using an API interface. Through these methods, developer information can be automatically extracted from the context of the target code generation tool, and the obtained developer information can be added as fields to the first data record result.

[0043] In summary, the data recording method for AI-assisted programming provided by this invention creates session encoding when a user creates a target session, and further records data from the input prompt word to the generation of the target code corresponding to the prompt word as a recording unit within the target session, thus recording data from the fine dimension of the recording unit. This enables a complete record of the reasoning process of the target code in AI-assisted programming, providing data support for subsequent code tracing.

[0044] The data recording device for AI-assisted programming provided by the present invention is described below. The data recording device for AI-assisted programming described below and the data recording method for AI-assisted programming described above can be referred to in correspondence.

[0045] like Figure 3 As shown, the AI-assisted programming data recording device 300 provided in this embodiment of the invention is applied to an AI-assisted programming agent and includes: Session module 301 is used to determine the session code corresponding to the target session in response to the user creating the target session; The recording unit module 302 is used to repeatedly execute the following steps until the target session ends: in response to the user inputting a prompt word in the target session, a first recording unit for the current record is created and first recording data is obtained; in response to generating a target code corresponding to the prompt word, a first data recording result corresponding to the first recording unit is generated based on the first recording data and the session code; the historical chained session data corresponding to the target session is updated based on the first data recording result to generate target chained session data; wherein, the historical chained session data includes second data recording results corresponding to at least one second recording unit of a historical record.

[0046] In an optional embodiment, the recording unit module 302 is further configured to, in response to generating a target code corresponding to the prompt word, perform a hash calculation on the first recording data to obtain a unit code corresponding to the first recording unit; and generate a first data recording result corresponding to the first recording unit based on the session code and the unit code.

[0047] In an optional embodiment, the first recorded data includes tool call results; the recording unit module 302 is further configured to determine the AI ​​tool information called by the first recording unit; and generate tool call results based on the AI ​​tool information and the AI ​​tool call operation.

[0048] In an optional embodiment, the first recorded data further includes code descriptions; the recording unit module 302 is further configured to generate a traceability anchor point corresponding to the first recording unit before submitting the target code to the local repository; and generate code descriptions corresponding to the first recording unit based on the traceability anchor point.

[0049] In an optional embodiment, the first record data further includes code commit information; the record unit module 302 is further configured to obtain metadata of the code repository; and generate code commit information corresponding to the first record unit based on the target code and the metadata.

[0050] In an optional embodiment, the recording unit module 302 is further configured to update the tail node of the historical chained session data to the first data record result, and update the pointer of the last second data record result in the historical chained session record according to the tail node.

[0051] In an optional embodiment, the recording unit module 302 is further configured to determine the developer information corresponding to the target code; and generate a first data recording result corresponding to the first recording unit based on the first recording data, the session encoding, and the developer information.

[0052] In one optional embodiment, determining the developer information corresponding to the target code includes at least one of the following: obtaining developer information from the login information of the target session using an integrated development environment plugin; obtaining developer information from system environment variables or configuration files using a command-line page; or obtaining developer information from authentication information using an API interface.

[0053] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute an AI-assisted programming data recording method. This method includes: in response to a user inputting a prompt word in a target session, creating a first recording unit for the current record and acquiring first recording data; in response to generating a target code corresponding to the prompt word, generating a first data recording result corresponding to the first recording unit based on the first recording data and the session code; updating the historical chained session data corresponding to the target session based on the first data recording result to generate target chained session data; wherein the historical chained session data includes second data recording results corresponding to at least one second recording unit of a historical record.

[0054] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0055] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the data recording method for AI-assisted programming provided by the above methods. The method includes: in response to a user inputting a prompt word in a target session, creating a first recording unit for the current record and acquiring first recording data; in response to generating a target code corresponding to the prompt word, generating a first data recording result corresponding to the first recording unit based on the first recording data and the session code; updating the historical chained session data corresponding to the target session based on the first data recording result to generate target chained session data; wherein the historical chained session data includes second data recording results corresponding to at least one second recording unit of a historical record.

[0056] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a data recording method for performing the AI-assisted programming methods provided above. The method includes: in response to a user creating a target session, determining a session code corresponding to the target session; cyclically executing the following steps until the target session ends: in response to a user inputting a prompt word in the target session, creating a first recording unit for the current record and acquiring first recording data; in response to generating a target code corresponding to the prompt word, generating a first data recording result corresponding to the first recording unit based on the first recording data and the session code; updating historical chained session data corresponding to the target session based on the first data recording result to generate target chained session data; wherein the historical chained session data includes second data recording results corresponding to at least one second recording unit of a historical record.

[0057] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0058] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data recording method for AI-assisted programming, characterized in that, Applications to assist programming agents include: In response to a user creating a target session, determine the session code corresponding to the target session; Repeat the following steps until the target session ends: In response to the user entering a prompt in the target session, create the first record unit of the current record and retrieve the first record data; In response to generating a target code corresponding to the prompt word, a first data recording result corresponding to the first recording unit is generated based on the first recording data and the session encoding; The historical chained session data corresponding to the target session is updated based on the first data recording result to generate target chained session data; wherein, the historical chained session data includes the second data recording result corresponding to at least one second record unit of the historical record.

2. The data recording method for AI-assisted programming according to claim 1, characterized in that, The step of generating a target code corresponding to the prompt word and generating a first data recording result corresponding to the first recording unit based on the first recording data and the session encoding includes: In response to generating a target code corresponding to the prompt word, a hash calculation is performed on the first record data to obtain a unit code corresponding to the first record unit; The first data record result corresponding to the first record unit is generated based on the session encoding and the unit encoding.

3. The data recording method for AI-assisted programming according to claim 1, characterized in that, The first record data includes the tool call result; the step of creating the first record unit for the current record and obtaining the first record data includes: Determine the AI ​​tool information invoked by the first recording unit; The tool call result is generated based on the AI ​​tool information and the AI ​​tool call operation.

4. The data recording method for AI-assisted programming according to claim 1, characterized in that, The first record data also includes code descriptions; the step of creating the first record unit for the current record and obtaining the first record data includes: Before submitting the target code to the local repository, a traceability anchor point corresponding to the first record unit is generated; Generate code descriptions corresponding to the first recording unit based on the traceability anchor points.

5. The data recording method for AI-assisted programming according to claim 1, characterized in that, The first record data also includes code commit information; The process of creating the first record unit for the current record and obtaining the first record data includes: Retrieve metadata from the code repository; Based on the target code and the metadata, code submission information corresponding to the first record unit is generated.

6. The data recording method for AI-assisted programming according to claim 1, characterized in that, The step of updating the pointer to the historical chained session data corresponding to the target session based on the first data recording result, and generating the target chained session data, includes: Update the tail node of the historical chained session data to the first data record result, and update the pointer of the last second data record result in the historical chained session records according to the tail node.

7. The data recording method for AI-assisted programming according to claim 1, characterized in that, The step of generating a first data record result corresponding to the first record unit based on the first record data and the session encoding includes: Determine the developer information corresponding to the target code; A first data record result corresponding to the first record unit is generated based on the first record data, the session encoding, and the developer information.

8. The data recording method for AI-assisted programming according to claim 7, characterized in that, The determination of the developer information corresponding to the target code includes at least one of the following: Developer information is obtained from the login information of the target session using an integrated development environment plugin; Use the command-line interface to retrieve developer information from system environment variables or configuration files; Use the API interface to retrieve developer information from the authentication information.

9. A data recording device for AI-assisted programming, characterized in that, Applications to assist programming agents include: The session module is used to determine the session code corresponding to the target session in response to the user creating the target session; The recording unit module is used to repeatedly execute the following steps until the target session ends: in response to a user inputting a prompt word in the target session, creating a first recording unit for the current record and obtaining first recording data; in response to generating a target code corresponding to the prompt word, generating a first data recording result corresponding to the first recording unit based on the first recording data and the session code; updating the historical chained session data corresponding to the target session based on the first data recording result to generate target chained session data; wherein, the historical chained session data includes second data recording results corresponding to at least one second recording unit of a historical record.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the data recording method for AI-assisted programming as described in any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the data recording method for AI-assisted programming as described in any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the data recording method for AI-assisted programming as described in any one of claims 1 to 8.