System

The system automates the generation of high-quality specifications by analyzing source code with a generative model, addressing the inefficiencies and inaccuracies of existing tools.

JP2026025642APending Publication Date: 2026-02-16SOFTBANK GROUP CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024128451
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2026-02-16

AI Technical Summary

Technical Problem

Existing specification generation tools have low accuracy, leading to incomplete or missing specifications during system building or renovation, requiring significant manual effort and prone to errors.

Method used

A system that includes a generative model to analyze source code, extracting comments, variable names, function names, control structures, and test cases, and automatically generates specifications in natural language, providing a download link for users.

Benefits of technology

Reduces manual effort and errors by automating the creation and updating of high-quality specifications, ensuring detailed and accurate documentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026025642000001_ABST
    Figure 2026025642000001_ABST
Patent Text Reader

Abstract

A system is provided.SOLUTION: A system comprising: means for receiving source code; means for invoking a generative model to analyze the received source code; means for extracting comments, variable names, function names, control structures, and test cases in the source code using the generative model; means for automatically generating a specification written in a natural language based on the extracted information; and means for saving the generated specification and providing a download link.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The technology of the present disclosure relates to a system. [Background technology]

[0002] Patent document 1 discloses a persona chatbot control method performed by at least one processor, the method including the steps of receiving a user utterance, adding the user utterance to a prompt including an instruction sentence related to a description of the chatbot character, encoding the prompt, and inputting the encoded prompt into a language model to generate a chatbot utterance in response to the user utterance. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] Japanese Patent Publication No. 2022-180282 Summary of the Invention [Problem to be solved by the invention]

[0004] When building or renovating a system, creating and updating system specifications requires a significant amount of work, and often results in incomplete or missing specifications. Existing specification generation tools have low accuracy, making it difficult to accurately extract necessary information from complex programs. For this reason, there is a demand for technology to create high-quality, efficient specifications. [Means for solving the problem]

[0005] The present invention solves the above problems by providing a system including: means for receiving source code; means for launching a generative model for analyzing the received source code; means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative model; means for automatically generating specifications written in natural language based on the extracted information; and means for saving the generated specifications and providing a download link. The system also provides a function for displaying the status of source code reception and progress through an interface, and a function for providing a preview of the generated specifications, allowing users to efficiently create and check high-quality specifications.

[0006] "Source code" is textual code that describes the behavior of a program or application.

[0007] "Means for Receiving" refers to the method or interface for uploading or receiving Source Code from Users.

[0008] A "generative model for analysis" refers to an artificial intelligence or machine learning model used to analyze the contents of source code and extract the necessary information.

[0009] "Comments" refer to explanations or notes written by developers in source code, and are text that does not affect the operation of the program.

[0010] A "variable name" refers to a name used to temporarily store data in a program.

[0011] A "function name" refers to a name used to identify a function or procedure defined to perform a specific process in a program.

[0012] "Control structure" refers to commands and structures that control the flow of a program (e.g., conditional branching, loop syntax).

[0013] A "test case" refers to a set of tests that includes a set of input values ​​and expected results used to verify the correct behavior of source code.

[0014] A "specification written in natural language" refers to a document that describes technical content in natural language that is easy for people to understand, and is primarily used to explain the design and operation of a system.

[0015] "Means for storing" refers to a method or device for storing the generated specification.

[0016] "Means for providing a download link" refers to a mechanism for providing a link that allows users to download the generated specification.

[0017] The "function of providing a preview" refers to a function of displaying the contents of the generated specification so that the user can check them in advance. [Brief explanation of the drawings]

[0018] [Figure 1] 1 is a conceptual diagram showing an example of the configuration of a data processing system according to a first embodiment. [Figure 2] 1 is a conceptual diagram showing an example of main functions of a data processing device and a smart device according to a first embodiment. [Figure 3] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a second embodiment. [Figure 4] FIG. 10 is a conceptual diagram showing an example of main functions of a data processing device and smart glasses according to a second embodiment. [Figure 5] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a third embodiment. [Figure 6] FIG. 11 is a conceptual diagram showing an example of main functions of a data processing device and a headset-type terminal according to a third embodiment. [Figure 7] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a fourth embodiment. [Figure 8]FIG. 10 is a conceptual diagram showing an example of main functions of a data processing device and a robot according to a fourth embodiment. [Figure 9] 1 shows an emotion map onto which multiple emotions are mapped. [Figure 10] 1 shows an emotion map onto which multiple emotions are mapped. [Figure 11] FIG. 3 is a sequence diagram showing a processing flow of the data processing system according to the first embodiment. [Figure 12] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system in Application Example 1. [Figure 13] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system according to the second embodiment when an emotion engine is combined. [Figure 14] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system in Application Example 2 when an emotion engine is combined. DETAILED DESCRIPTION OF THE INVENTION

[0019] An example of an embodiment of a system according to the technology of the present disclosure will be described below with reference to the accompanying drawings.

[0020] First, the terms used in the following description will be explained.

[0021] In the following embodiments, a coded processor (hereinafter simply referred to as a "processor") may be a single arithmetic device or a combination of multiple arithmetic devices. Furthermore, a processor may be a single type of arithmetic device or a combination of multiple types of arithmetic devices. Examples of arithmetic devices include a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a GPGPU (General-Purpose computing on Graphics Processing Units), and an APU (Accelerated Processing Unit).

[0022] In the following embodiments, a coded RAM (Random Access Memory) is a memory in which information is temporarily stored and is used as a working memory by a processor.

[0023] In the following embodiments, the coded storage is one or more non-volatile storage devices that store various programs, various parameters, etc. Examples of non-volatile storage devices include flash memory (SSD (Solid State Drive)), magnetic disks (e.g., hard disks), and magnetic tapes.

[0024] In the following embodiments, a communication I / F (Interface) with a symbol is an interface including a communication processor, an antenna, etc. The communication I / F controls communication between multiple computers. Examples of communication standards applied to the communication I / F include wireless communication standards including 5G (5th Generation Mobile Communication System), Wi-Fi (registered trademark), Bluetooth (registered trademark), etc.

[0025] In the following embodiments, "A and / or B" is synonymous with "at least one of A and B." In other words, "A and / or B" means that it may be only A, only B, or a combination of A and B. Furthermore, in this specification, the same concept as "A and / or B" is also applied when three or more things are expressed connected by "and / or."

[0026] [First embodiment]

[0027] FIG. 1 shows an example of the configuration of a data processing system 10 according to the first embodiment.

[0028] 1, a data processing system 10 includes a data processing device 12 and a smart device 14. An example of the data processing device 12 is a server.

[0029] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).

[0030] The smart device 14 includes a computer 36, a reception device 38, an output device 40, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The reception device 38, the output device 40, and the camera 42 are also connected to the bus 52.

[0031] The reception device 38 includes a touch panel 38A, a microphone 38B, and the like, and receives user input. The touch panel 38A detects contact with an indicator (for example, a pen or a finger) to receive user input by the touch of the indicator. The microphone 38B detects the user's voice to receive user input by voice. The control unit 46A transmits data indicating the user input received by the touch panel 38A and the microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the data indicating the user input.

[0032] The output device 40 includes a display 40A and a speaker 40B, and presents data to the user 20 by outputting the data in a form of expression that the user 20 can perceive (for example, audio and / or text). The display 40A displays visible information such as text and images in accordance with instructions from the processor 46. The speaker 40B outputs audio in accordance with instructions from the processor 46. The camera 42 is a compact digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor.

[0033] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54.

[0034] FIG. 2 shows an example of the main functions of the data processing device 12 and the smart device 14.

[0035] 2, in the data processing device 12, a specific process is performed by the processor 28. A specific processing program 56 is stored in the storage 32. The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific process is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.

[0036] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.

[0037] In the smart device 14, the processor 46 performs the reception output process. The storage 50 stores a reception output program 60. The reception output program 60 is used in conjunction with the specific processing program 56 by the data processing system 10. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.

[0038] Next, a description will be given of the specific processing performed by the specific processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."

[0039] The present invention provides a system that automates the creation and updating of system specifications during system construction and modification, reducing the number of processes and providing high-quality specifications. This system includes means for receiving and analyzing source code and generating specifications in natural language. An embodiment of the system is described in detail below.

[0040] System Overview

[0041] The system's analysis process begins when a user uploads source code from their device to the server via an interface. The server then launches a generative model to analyze the received source code. The generative model then extracts comments, variable names, function names, control structures, and test cases from the source code, and automatically generates a specification written in natural language based on the extracted information. The generated specification is stored on the server, and users can download it by providing a download link.

[0042] Program processing

[0043] On the terminal, the user uploads the source code. For example, the user clicks the "Select File" button on the web interface, selects the source code file from the local disk, and clicks the "Upload" button. The server receives the uploaded source code and stores it in a temporary storage area.

[0044] The server then launches a generative model, which uses natural language processing (NLP) techniques to analyze the source code and extract the necessary information: specifically, it identifies and extracts comment content, variable names and data types, function names and arguments, control structures, and test cases.

[0045] Based on the extracted information, the server uses a generative model to automatically generate a specification written in natural language, which includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and test case content.

[0046] Finally, the server saves the generated specification. Once the saving is complete, the server generates a download link and provides it to the user. The user can click the link to download the specification and save it locally.

[0047] Specific examples

[0048] For example, if a user uploads the following Python code:

[0049] python

[0050] Function: Double a number

[0051] def double_number(x):

[0052] """

[0053] A function that doubles a number

[0054] argument:

[0055] x: an integer or floating point number

[0056] Returns:

[0057] twice the value of x

[0058] """

[0059] return x 2

[0060] Unit Testing

[0061] assert double_number(2) == 4

[0062] double assert_number(1.5) == 3.0

[0063] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, and test cases from the code, and generates a specification that looks like this:

[0064] System Specifications

[0065] overview

[0066] The system includes a function that doubles an input number and its unit test.

[0067] Function Details

[0068] double_number

[0069] Description: Doubles the given number.

[0070] argument:

[0071] x: an integer or floating point number

[0072] Returns:

[0073] twice the value of x

[0074] Control Structures

[0075] It does not include conditional branches or loop structures.

[0076] Test Cases

[0077] assert double_number(2) == 4

[0078] double assert_number(1.5) == 3.0

[0079] This specification provides detailed explanations of function behavior and test content, making it easy for users and programmers to understand, and providing high-quality documentation that is free of any omissions or omissions.

[0080] In this way, the system of the present invention can significantly reduce the man-hours and risks involved in system development by efficiently analyzing source code, extracting necessary information, and generating high-quality specifications. A system that combines the means included in the claims provides a specific method for solving a specific technical problem.

[0081] The processing flow will be explained below.

[0082] Step 1:

[0083] A user accesses the web interface from a terminal, clicks the "Choose File" button, selects a source code file from the local disk, and clicks the "Upload" button.

[0084] Step 2:

[0085] The server receives the uploaded source code file and stores it in a temporary storage area. It verifies the file format and content to ensure there are no problems.

[0086] Step 3:

[0087] The server launches the generative model, which begins analyzing the source code using natural language processing (NLP) techniques.

[0088] Step 4:

[0089] The generative model extracts comments in the source code, specifically by detecting comment blocks in the code and associating them with the corresponding code blocks.

[0090] Step 5:

[0091] The generative model extracts variable names and data types, identifies variable declarations in the program, and determines what data type the variables are.

[0092] Step 6:

[0093] The generative model extracts function names and arguments by detecting function definitions in the code and analyzing the function name, its arguments, and the return value information.

[0094] Step 7:

[0095] The generative model extracts control structures, detecting conditional branches (if statements, switch statements, etc.) and loop structures (for statements, while statements, etc.) and analyzing their flow.

[0096] Step 8:

[0097] The generative model extracts test cases, identifying and organizing unit and integration tests defined in the source code.

[0098] Step 9:

[0099] The server automatically generates a specification written in natural language based on the information extracted from the generative model, which includes an overview of the entire system and detailed descriptions of each element.

[0100] Step 10:

[0101] The server saves the generated specification, and after saving is complete, it generates a download link and provides it to the user.

[0102] Step 11:

[0103] The user clicks on the download link provided by the server to download the generated specification, save it locally, and share it with the project team and stakeholders.

[0104] Example 1

[0105] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."

[0106] Creating and updating system specifications during system construction and modification requires a significant amount of man-hours and time. Furthermore, creating specifications manually is prone to errors and omissions, resulting in a decline in quality. Therefore, there is a need for an efficient, automated method for creating high-quality specifications.

[0107] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.

[0108] In this invention, the server includes means for receiving source code, means for saving the received source code in a temporary storage area, means for launching a generative AI model for analyzing the received source code, means for setting a prompt statement in the generative AI model and instructing it to analyze the source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative AI model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications as a file, and means for generating and providing a download link for the saved specifications. This automates the creation and updating of specifications, reducing labor costs and enabling the provision of high-quality specifications.

[0109] "Source code" refers to the text files of a computer program written by a developer to design and implement the program.

[0110] The "temporary storage area" is a storage area for temporarily storing received data.

[0111] A "generative AI model" is a machine learning model that performs natural language processing based on given input data (prompts).

[0112] A "prompt sentence" is a text sentence that is input to a generative AI model to instruct it to analyze or generate something.

[0113] "Comments" are annotations or explanations written in source code to clarify the behavior and intent of the code.

[0114] A "variable name" is an identifier used to store data within a program.

[0115] A "function name" is an identifier of a code block defined to perform a specific process.

[0116] A "control structure" is a syntax for controlling the execution flow of a program, and includes conditional branches and loops.

[0117] A "test case" is a specific test condition or procedure that is executed to verify the functionality or performance of a program.

[0118] A "specification" is a document that clearly states the functions, structure, and operation of a system, and is intended for reference by developers and users.

[0119] "Download Link" means a URL provided to download a file over the Internet.

[0120] The present invention is a system that analyzes source code and automatically generates specifications. This system includes a process for uploading source code from a terminal to a server and generating specifications by analyzing the source code. This process utilizes a generative AI model to extract comments, variable names, function names, control structures, and test cases, and creates specifications written in natural language based on the extracted content.

[0121] Hardware and software used

[0122] The system is implemented using the following hardware and software.

[0123] Device: A device such as a computer or smartphone operated by a user.

[0124] Server: A high-performance computer for receiving, analyzing, generating specifications, and storing source code. Here, we will assume a virtual server of a typical cloud service.

[0125] Generative AI model: A natural language processing model that analyzes source code and generates specifications in natural language. For example, the GPT series of models.

[0126] Web Interface: A web page where users can upload their source code, built using HTML, CSS, and JavaScript.

[0127] Specific actions

[0128] The user accesses the web interface from the terminal and uploads the source code. To do so, the user clicks the "Select File" button, selects a file from the local disk, and then clicks the "Upload" button. The source code sent from the terminal is stored in a temporary storage area on the server.

[0129] Next, the server launches the generative AI model to analyze the saved source code, with the following prompt:

[0130] Analyze the following source code and generate a specification.

[0131] The prompt statement is then added to the source code and input to the generative AI model, which then analyzes the given prompt statement and source code to identify and extract comments, variable names, function names, control structures, and test cases.

[0132] The generative AI model then uses the extracted information to automatically generate a specification in natural language, which includes a system overview, detailed descriptions of each function, a list of variables, a description of the control flow, and test cases. For example, if a user uploads the following Python code:

[0133] python

[0134] Function: Double a number

[0135] def double_number(x):

[0136] """

[0137] A function that doubles a number

[0138] argument:

[0139] x: an integer or floating point number

[0140] Returns:

[0141] twice the value of x

[0142] """

[0143] return x 2

[0144] Unit Testing

[0145] assert double_number(2) == 4

[0146] double assert_number(1.5) == 3.0

[0147] The server parses this source code and generates a specification like this:

[0148] System Specifications

[0149] overview

[0150] The system includes a function that doubles an input number and its unit test.

[0151] Function Details

[0152] double_number

[0153] Description: Doubles the given number.

[0154] argument:

[0155] x: an integer or floating point number

[0156] Returns:

[0157] twice the value of x

[0158] Control Structures

[0159] It does not include conditional branches or loop structures.

[0160] Test Cases

[0161] assert double_number(2) == 4

[0162] double assert_number(1.5) == 3.0

[0163] The generated specification is stored in the server's storage and then provided to the user as a download link, via which the user can download the specification and save it locally.

[0164] In this way, the system of the present invention automates the process from uploading source code to analysis, specification generation, and final downloading, thereby enabling the efficient provision of high-quality specifications.

[0165] The flow of the identification process in the first embodiment will be described with reference to FIG.

[0166] Step 1:

[0167] Uploading source code

[0168] The user opens the web interface on the terminal, clicks the "Choose File" button to select a source code file from the local disk, and then clicks the "Upload" button. As input, there is the source code file selected by the user. As output, the selected file is sent to the server.

[0169] Step 2:

[0170] Receiving and storing source code

[0171] The server receives the source code sent by the user and saves it in a temporary storage area. As input, the server receives an HTTP POST request. As output, the source code is saved in a temporary storage area (e.g., the / tmp directory). The server uses a framework such as Python or Flask to retrieve and save the file using request.files['file'].

[0172] Step 3:

[0173] Launching a generative AI model

[0174] The server launches the generative AI model to analyze the saved source code file. As input, it takes the path of the saved source code and a prompt. As output, it launches the generative AI model and starts the analysis process. The specific prompt is as follows:

[0175] Analyze the following source code and generate a specification.

[0176] Step 4:

[0177] Source code analysis

[0178] The generative AI model performs analysis based on the given prompt and source code. As input, the prompt followed by the source code content is provided. As output, comments, variable names, function names, control structures, and test cases are extracted from the source code. The generative AI model identifies and classifies these elements.

[0179] Step 5:

[0180] Generate specifications

[0181] The server uses a generative AI model based on the extracted information to automatically generate specifications written in natural language. The analyzed source code information is provided as input. The output is a specification that includes a system overview, function details, a list of variables, control flow, and test case content. For example, it includes the following content:

[0182] System Specifications

[0183] overview

[0184] The system includes a function that doubles an input number and its unit test.

[0185] Function Details

[0186] double_number

[0187] Description: Doubles the given number.

[0188] argument:

[0189] x: an integer or floating point number

[0190] Returns:

[0191] twice the value of x

[0192] Control Structures

[0193] It does not include conditional branches or loop structures.

[0194] Test Cases

[0195] assert double_number(2) == 4

[0196] double assert_number(1.5) == 3.0

[0197] Step 6:

[0198] Storing and providing specifications

[0199] The server saves the generated specification as a file. As input, the content of the generated specification is provided. As output, the specification file is saved and its path is determined. For example, it is saved as example_spec.md in the / docs directory. Once saving is complete, the server generates a download link and provides it to the user through the web interface. The user can click the link to download the specification and save it locally.

[0200] (Application example 1)

[0201] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."

[0202] Creating specifications for conventional factory robots required a great deal of man-hours and specialized knowledge, and the accuracy and consistency of the resulting specifications were an issue. Furthermore, the more complex the robot's movements, the more work it required to update the specifications, leading to inefficiencies in actual operation. Furthermore, discrepancies often occurred between the actual source code and the specifications, requiring time and effort during troubleshooting and maintenance. A system that could solve these issues and automatically generate high-quality, consistent specifications was needed.

[0203] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.

[0204] In this invention, the server includes means for receiving source code, means for activating a generative model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications and providing a download link, means for uploading photos of the source code using a smart device, and means for generating specifications from the photos of the source code. This makes it possible to grasp the robot's operation in detail and quickly generate high-quality specifications.

[0205] "Source code" is code that describes a program, in a form before it is converted into a computer-executable form.

[0206] "Means for receiving" refers to a device or mechanism capable of obtaining data or information through a network or interface.

[0207] A "generative model for analysis" is a model trained by artificial intelligence or machine learning that is used to analyze given input data, especially source code, and understand its structure and content.

[0208] A "comment" is an explanation or annotation written in source code that does not affect the operation of the program but makes it easier for programmers and administrators to understand and maintain the code.

[0209] A "variable name" is a label or name used to identify specific data or values ​​within a program.

[0210] A "function name" is a name or label that identifies a block of code that performs a particular operation or procedure.

[0211] A "control structure" is a syntax element for controlling the flow and execution order of a program, and includes conditional branching and repetitive processing.

[0212] A "test case" is a set of specific inputs and expected outputs designed to verify whether a program or system works correctly.

[0213] A "specification written in natural language" is a document that describes the structure and operation of a program in a format that humans can understand.

[0214] A "smart device" is a portable electronic device such as a smartphone or tablet that has advanced computing and communication capabilities.

[0215] A "means for uploading photos" is a mechanism that has the function of sending and storing image data on a server or cloud.

[0216] A "means for generating specifications" is a mechanism that has the ability to automatically create detailed descriptions of a program or system based on given data or information.

[0217] This invention is a system that automatically generates robot operation specifications by photographing and uploading the source code of a factory robot. The system of this invention is realized by combining a server, smart devices, and software.

[0218] System Overview

[0219] Users use a smart device (such as a smartphone or tablet) to take a photo of the factory robot's source code and upload the photo or file to the server through the interface. The server analyzes the received data and activates a generative AI model to extract the necessary information from the source code. The generative AI model uses natural language processing technology to identify and extract comments, variable names, function names, control structures, and test cases. It then automatically generates a specification document written in natural language based on the extracted information. The final generated specification document is stored on the server, and users can obtain it via a download link.

[0220] Hardware and software used

[0221] Server: The computer system that receives the data and runs the generative AI model.

[0222] Smart Device: A device (smartphone, tablet, etc.) for taking photos of and uploading source code.

[0223] Generative AI model: A model that uses natural language processing techniques such as the OpenAI API.

[0224] Interface: A web application (using the Flask framework, for example) that manages the exchange of data between the user and the server.

[0225] Program processing explanation

[0226] The server receives the source code uploaded by the user through the interface and stores it in a temporary storage area. The server then launches a generative AI model (e.g., OpenAI API) to begin analyzing the received source code. During this analysis process, comments, variable names, function names, control structures, and test cases within the source code are identified and extracted. A specification written in natural language is then generated based on the extracted information. The generated specification is stored on the server, and the user can obtain it via a download link.

[0227] Examples and prompts

[0228] Here is the Python code that a user might upload as an example:

[0229] Upload Code:

[0230] python

[0231] Functions that control the robot's behavior

[0232] def control_robot(action):

[0233] """

[0234] Functions that control the robot's behavior

[0235] argument:

[0236] action: Action command (str)

[0237] Returns:

[0238] Operation result (str)

[0239] """

[0240] if action == "forward":

[0241] return "The robot moves forward"

[0242] elif action == "backward":

[0243] return "Robot retreats"

[0244] else:

[0245] return "Invalid command"

[0246] Example of generated prompt:

[0247] Generate a specification from the following source code:

[0248] python

[0249] Functions that control the robot's behavior

[0250] def control_robot(action):

[0251] """

[0252] Functions that control the robot's behavior

[0253] argument:

[0254] action: Action command (str)

[0255] Returns:

[0256] Operation result (str)

[0257] """

[0258] if action == "forward":

[0259] return "The robot moves forward"

[0260] elif action == "backward":

[0261] return "Robot retreats"

[0262] else:

[0263] return "Invalid command"

[0264] This system makes it possible to grasp the details of factory robot operations and quickly generate high-quality specifications, thereby reducing man-hours and improving the quality of specifications.

[0265] The flow of the specific processing in the application example 1 will be described with reference to FIG.

[0266] Step 1:

[0267] A user takes a photo of the source code or selects a source code file using a smart device. The photo or selected file is uploaded to the server through the interface. The input of this step is the source code image or file. The output is the image data or file data transferred to the server.

[0268] Step 2:

[0269] The server receives the uploaded image data or file data and stores it in a temporary storage area. The input of this step is the image data or file data sent by the user. The output is the data stored in the temporary storage area.

[0270] Step 3:

[0271] The server identifies the format of the received data (image or file) and performs appropriate preprocessing. If it is image data, it uses OCR (Optical Character Recognition) technology to extract text from the image. If it is file data, it uses it as text. The input at this stage is image data or file data from a temporary storage area. The output is source code in text format.

[0272] Step 4:

[0273] The server launches the generative AI model and inputs the textual source code into the model. The generative AI model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases. The input of this stage is the textual source code. The output is a set of extracted information.

[0274] Step 5:

[0275] The server uses a generative AI model to automatically generate a specification written in natural language based on the extracted information. The input to this stage is the set of extracted information. The output is a specification written in natural language.

[0276] Step 6:

[0277] The server stores the generated specification and generates a download link that users can access. The input to this stage is a specification written in natural language. The output is a download link to the location where the specification is stored.

[0278] Step 7:

[0279] The user accesses the download link through the interface and downloads the generated specification. The input of this step is the download link. The output is the locally saved specification.

[0280] This series of steps allows users to efficiently generate high-quality specifications.

[0281] Furthermore, an emotion engine that estimates the user's emotion may be combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59 and perform identification processing using the user's emotion.

[0282] The present invention provides a system that automates the creation and updating of system specifications during system construction and modification, reducing the number of steps and providing high-quality specifications. The present invention also includes an emotion engine that recognizes a user's emotions and provides feedback based on the results. Embodiments of the present invention are described in detail below.

[0283] System Overview

[0284] The system analysis process begins when a user uploads source code from their device to the server via an interface. The server then launches a generative model to analyze the received source code. The generative model extracts comments, variable names, function names, control structures, and test cases from the source code, and automatically generates a specification document written in natural language based on the extracted information. The generated specification document is stored on the server, and a download link is provided.

[0285] The emotion engine uses sensor data and input information to recognize the user's emotions, analyzes the user's emotional state, and provides appropriate feedback to the user according to the analysis results and the contents of the generated specifications.

[0286] Program processing

[0287] The user uploads the source code on the terminal. For example, the user clicks the "Select File" button on the web interface, selects the source code file from the local disk, and clicks the "Upload" button. The server receives the uploaded source code and stores it in a temporary storage area.

[0288] The server then launches a generative model, which uses natural language processing (NLP) techniques to analyze the source code and extract the necessary information: specifically, it identifies and extracts comment content, variable names and data types, function names and arguments, control structures, and test cases.

[0289] Based on the extracted information, the server uses a generative model to automatically generate a specification written in natural language, which includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and test case content.

[0290] The emotion engine recognizes the user's emotional state by analyzing the user's facial expression, tone of voice, typing pace, etc. For example, if the user types at a faster pace than usual or their facial expression becomes grim, the emotion engine will determine that the user is feeling stressed.

[0291] Based on the analysis results of the emotion engine, the server provides feedback to the user. For example, it can display a message such as "Please relax" based on the analysis results, or automatically generate an explanation to supplement the contents of the specification.

[0292] Finally, the server saves the generated specification. Once the saving is complete, the server generates a download link and provides it to the user. The user can click the link to download the specification and save it locally. In addition, the emotion engine's feedback can reduce the user's stress and improve work efficiency.

[0293] Specific examples

[0294] For example, if a user uploads the following Python code:

[0295] python

[0296] Function: Double a number

[0297] def double_number(x):

[0298] """

[0299] A function that doubles a number

[0300] argument:

[0301] x: an integer or floating point number

[0302] Returns:

[0303] twice the value of x

[0304] """

[0305] return x 2

[0306] Unit Testing

[0307] assert double_number(2) == 4

[0308] double assert_number(1.5) == 3.0

[0309] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, and test cases from the code, and generates a specification that looks like this:

[0310] System Specifications

[0311] overview

[0312] The system includes a function that doubles an input number and its unit test.

[0313] Function Details

[0314] double_number

[0315] Description: Doubles the given number.

[0316] argument:

[0317] x: an integer or floating point number

[0318] Returns:

[0319] twice the value of x

[0320] Control Structures

[0321] It does not include conditional branches or loop structures.

[0322] Test Cases

[0323] assert double_number(2) == 4

[0324] double assert_number(1.5) == 3.0

[0325] This specification provides detailed explanations of function behavior and test content, making it easy for users and programmers to understand, and providing high-quality documentation that is free of any omissions or omissions.

[0326] If the emotion engine analyzes the user's facial expressions and input pace and detects that the user is feeling stressed, it can display a message such as "Please relax," thereby improving the user's work efficiency and mental comfort. In this way, by combining emotion engines, a system can be realized that provides appropriate feedback according to the user's emotional state.

[0327] In this way, the system of the present invention not only efficiently analyzes source code, extracts necessary information, and generates high-quality specifications, but also recognizes user emotions and provides appropriate feedback, thereby significantly reducing the labor hours and risks involved in system development.

[0328] The processing flow will be explained below.

[0329] Step 1:

[0330] A user accesses the web interface from a terminal, clicks the "Choose File" button, selects a source code file from the local disk, and clicks the "Upload" button.

[0331] Step 2:

[0332] The server receives the uploaded source code file and stores it in a temporary storage area. It verifies the file format and content to ensure there are no problems.

[0333] Step 3:

[0334] The server launches the generative model, which begins analyzing the source code using natural language processing (NLP) techniques.

[0335] Step 4:

[0336] The generative model extracts comments in the source code, specifically by detecting comment blocks in the code and associating them with the corresponding code blocks.

[0337] Step 5:

[0338] The generative model extracts variable names and data types, identifies variable declarations in the program, and determines what data type the variables are.

[0339] Step 6:

[0340] The generative model extracts function names and arguments by detecting function definitions in the code and analyzing the function name, its arguments, and the return value information.

[0341] Step 7:

[0342] The generative model extracts control structures, detecting conditional branches (if statements, switch statements, etc.) and loop structures (for statements, while statements, etc.) and analyzing their flow.

[0343] Step 8:

[0344] The generative model extracts test cases, identifying and organizing unit and integration tests defined in the source code.

[0345] Step 9:

[0346] The server automatically generates a specification written in natural language based on the information extracted from the generative model, which includes an overview of the entire system and detailed descriptions of each element.

[0347] Step 10:

[0348] The server uses an emotion engine to analyze the user's emotions, specifically by analyzing the user's facial expressions, tone of voice, and typing pace to recognize the user's emotional state.

[0349] Step 11:

[0350] Based on the analysis results of the emotion engine, the server provides feedback to the user. For example, if the user is feeling stressed, a message encouraging them to relax is displayed.

[0351] Step 12:

[0352] The server saves the generated specification, and after saving is complete, it generates a download link and provides it to the user.

[0353] Step 13:

[0354] The user clicks on the download link provided by the server to download the generated specification, save it locally, and share it with the project team and stakeholders.

[0355] Example 2

[0356] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."

[0357] In conventional system development, analyzing source code and creating specifications are often done manually, which is time-consuming, labor-intensive, and prone to human error. Furthermore, while the user's emotional state can affect the efficiency and quality of system development, few systems take this into account. Therefore, a system that automates analysis, efficiently generates high-quality specifications, and recognizes the user's emotions and provides appropriate feedback is needed.

[0358] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.

[0359] In this invention, the server includes means for receiving source code, means for launching a generative AI model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative AI model, means for automatically generating specifications written in natural language based on the extracted information, means for launching an emotion analysis engine that recognizes user emotions and provides feedback based on the results, and means for saving the generated specifications and providing a download link. This enables the automation of source code analysis and specification generation, and provides feedback according to the user's emotional state, enabling efficient and high-quality system development.

[0360] "Source code" is a text file that describes the behavior of a program and is the input before it is converted into a form that a computer can run.

[0361] "Means for receiving" refers to the communication functions and protocols used to transfer data from a terminal to a server and receive the data on the server side.

[0362] A "generative AI model" refers to an algorithm or program that uses machine learning and natural language processing techniques to analyze source code, extract specific information, and perform specified tasks.

[0363] A "comment" is text written in source code to add supplementary explanations without affecting the operation of the program.

[0364] A "variable name" is a named symbol for storing data within a program, and serves to hold a value in a series of operations or calculations.

[0365] A "function name" is an identifier used to call a code block that performs a specific process or calculation.

[0366] A "control structure" is a syntax for controlling the execution flow of a program, and includes conditional branches and loops.

[0367] A "test case" defines specific inputs and expected outputs to verify the functionality and behavior of a program.

[0368] A "specification written in natural language" is a document that provides a detailed explanation of the operation of a system or program in a format that is easy to understand even for people without specialized programming knowledge.

[0369] An "emotion analysis engine" is a software module for detecting a user's emotional state, analyzing data such as facial expressions, voice, and input speed to classify emotions.

[0370] "Providing feedback" means that the system provides the user with information such as analysis results, suggestions, and warnings in a timely manner.

[0371] DETAILED DESCRIPTION OF THE INVENTION The present invention provides a system for automating the creation and updating of system specifications, and for analyzing a user's emotional state and providing feedback. The following describes in detail an embodiment of the present invention.

[0372] A user uses a terminal to upload source code to the server. To do this, the user launches a browser and accesses a web interface. For example, the user clicks the "Choose File" button, selects the source code file from the local disk, and clicks the "Upload" button to send the file from the terminal to the server.

[0373] The server receives the HTTP request and saves the file data in the request in a temporary storage area. This makes the source code available for subsequent analysis steps. The server then launches a generative AI model using natural language processing (NLP) techniques. This generative AI model is an algorithm built in Python or similar language and analyzes the uploaded source code.

[0374] The generative AI model identifies and extracts comments, variable names, function names, control structures, and test cases from the source code. This information is stored as a data structure in the server's memory. The server then automatically generates a specification written in natural language based on the extracted information. This specification includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and the contents of the test cases.

[0375] The emotion analysis engine recognizes the user's emotional state by analyzing their facial expressions, tone of voice, typing pace, etc. For example, if the user types at a faster pace than usual or if the camera image shows a grim expression, the emotion analysis engine will determine that the user is feeling stressed.

[0376] Based on the analysis, the server can provide appropriate feedback to the user, for example, a message such as "Relax" can be displayed in the web interface, and comments can be provided to supplement the content of the specification, if necessary.

[0377] The server stores the final generated specification in long-term storage. Once the storage process is complete, the server generates a download link for the user and displays it on the web interface. The user can click the link to download the specification and save it to their local disk.

[0378] As a concrete example, consider the following Python code uploaded by a user:

[0379] python

[0380] Function: Double a number

[0381] def double_number(x):

[0382] """

[0383] A function that doubles a number

[0384] argument:

[0385] x: an integer or floating point number

[0386] Returns:

[0387] twice the value of x

[0388] """

[0389] return x 2

[0390] Unit Testing

[0391] assert double_number(2) == 4

[0392] double assert_number(1.5) == 3.0

[0393] The server receives this source code and begins analyzing it. A generative AI model extracts comments, function names, arguments, and test cases from the code, generating a specification that looks like this:

[0394] markdown

[0395] System Specifications

[0396] overview

[0397] The system includes a function that doubles an input number and its unit test.

[0398] Function Details

[0399] double_number

[0400] Description: Doubles the given number.

[0401] argument:

[0402] x: an integer or floating point number

[0403] Returns:

[0404] twice the value of x

[0405] Control Structures

[0406] It does not include conditional branches or loop structures.

[0407] Test Cases

[0408] assert double_number(2) == 4

[0409] double assert_number(1.5) == 3.0

[0410] The generated specifications provide detailed explanations of function behavior and test content, making it easier for engineers and programmers to understand. In this way, the system of the present invention automates a series of processes, from analyzing source code to generating specifications, and even recognizing user emotions and providing appropriate feedback, achieving highly efficient and high-quality development support.

[0411] The flow of the identification process in the second embodiment will be described with reference to FIG.

[0412] Step 1:

[0413] The user uploads the source code from the terminal to the server.

[0414] Specifically, the user launches a browser on their device, accesses the provided web interface, clicks the "Choose File" button, selects the source code file from their local disk, and then clicks the "Upload" button, which sends the source code to the server as an HTTP request.

[0415] Input: Source code files stored on your local disk

[0416] Output: Source code data sent to the server

[0417] Step 2:

[0418] The server receives the source code and stores it in a temporary storage area.

[0419] Specifically, the server receives an HTTP request, extracts the file data from it, and saves the extracted file data in a designated temporary storage area. This file is used for analysis by the generative AI model.

[0420] Input: Source code data in the HTTP request

[0421] Output: Source code file saved in temporary storage area on the server

[0422] Step 3:

[0423] The server launches the generative AI model and analyzes the source code.

[0424] Specifically, the server launches a generative AI model built in Python or similar. This model uses natural language processing (NLP) techniques to analyze source code, identifying comments, variable names, function names, control structures, and test cases, and extracting information from each.

[0425] Input: Source code files stored on the server

[0426] Output: Comments, variable names, function names, control structures, and test case information extracted by the analysis.

[0427] Step 4:

[0428] The server automatically generates specifications based on the extracted information.

[0429] Specifically, the server provides the extracted information as input to the generative AI model to generate a specification written in natural language. This specification includes an overview of the system, detailed descriptions of functions, a list of variables, a description of the control flow, and the contents of test cases. The generated specification is then saved in a temporary storage area.

[0430] Input: Comments, variable names, function names, control structures, and test case information

[0431] Output: A specification written in natural language

[0432] Step 5:

[0433] The emotion analysis engine analyzes the user's emotional state.

[0434] Specifically, the emotion analysis engine analyzes the user's facial expression data (camera input), voice data (microphone input), and typing pace (keyboard input speed) to evaluate the user's emotional state and detect, for example, stress.

[0435] Input: facial expression data, voice data, input pace

[0436] Output: Evaluated user emotional state

[0437] Step 6:

[0438] The server provides feedback based on the results of the sentiment analysis engine.

[0439] Specifically, the server displays an appropriate message on the web interface based on the results of the emotion analysis engine. For example, displaying a message such as "Please relax" can improve the user's mental comfort. It can also display supplementary explanations to the content of the specifications as needed.

[0440] Input: Evaluated emotional state of the user

[0441] Output: Feedback message to the user

[0442] Step 7:

[0443] The server saves the generated specification and generates a download link.

[0444] Specifically, the server writes the generated specification to long-term storage. Once saved, the server generates a download link and displays it on the web interface. Users can click the link to download the specification and save it to their local disk.

[0445] Input: Generated specification

[0446] Output: Download link, save specification

[0447] (Application example 2)

[0448] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."

[0449] In modern system development, manually creating source code specifications requires a significant amount of time and effort, and is prone to human error. Robot control programs, especially those used on factory production lines, are complex, making the creation and updating of specifications extremely important. However, high levels of stress and fatigue can hinder efficient work. Therefore, there is a need for an efficient system development environment that not only automatically generates specifications but also monitors the emotional state of workers and provides appropriate feedback.

[0450] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 2 is realized by the following means.

[0451] In this invention, the server includes means for receiving source code, means for activating a generative model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications and providing a download link, means for activating an emotion engine for recognizing the emotional state of a worker and providing feedback, means for analyzing sensor data such as facial expressions, voice, and input speed using the emotion engine, and means for providing appropriate feedback to the worker based on the analysis results. This enables both the automatic generation of specifications and feedback according to the worker's emotional state, thereby realizing efficient and high-quality system construction.

[0452] The "means for receiving source code" is a function that allows a user to upload source code to the system and have the code received by the server.

[0453] "Means for launching a generative model" refers to a function for running an AI model or machine learning model to analyze received source code.

[0454] "Means for extracting comments, variable names, function names, control structures, and test cases from source code" refers to a function for automatically identifying and extracting annotations, variable names, function names, control flow structures, and test cases from source code.

[0455] "Means for automatically generating specifications written in natural language" is a function for automatically creating documents in a format that is easy for humans to understand, based on extracted information.

[0456] The "means for saving the generated specifications and providing a download link" is a function for saving the automatically generated specifications on a server and providing a link that allows the user to download the specifications.

[0457] The "means for activating an emotion engine to recognize the worker's emotional state and provide feedback" is a function for acquiring sensor data necessary to recognize the user's emotions and executing an engine that processes the data.

[0458] "Means for analyzing sensor data such as facial expressions, voice, and input speed" is a function that collects information such as a worker's facial expressions, voice changes, and keystroke speed, and analyzes them to determine their emotional state.

[0459] "Means for providing appropriate feedback to workers based on the analysis results" is a function for providing feedback and suggestions to relieve workers' stress and fatigue based on the results of the emotion engine.

[0460] This invention is a system that efficiently analyzes robot control programs for factory production lines and automatically generates specifications. It also monitors the emotional state of workers and provides appropriate feedback to improve work efficiency and quality. Specific embodiments for implementing this invention are described below.

[0461] System configuration

[0462] The system mainly consists of the following components:

[0463] 1. Server

[0464] 2. Terminal

[0465] 3. Emotion Engine

[0466] 4. Generative Model

[0467] What the program does

[0468] The server has a means for receiving source code sent by users. The process begins when a user selects and uploads source code from a web interface via their terminal. Once the source code is received by the server, it is stored in a temporary storage area.

[0469] The server then launches a generative model, which analyzes and extracts comments, variable names, function names, control structures, and test cases from the source code. Using natural language processing (NLP) techniques, the analysis automatically generates a specification written in natural language based on the extracted information. The specification is then stored on the server, and a download link is provided for users to download.

[0470] The server then activates an emotion engine, which analyzes the worker's emotional state using sensor data such as the user's facial expressions, voice, and input speed. Based on the analysis results, the server provides appropriate feedback to the worker. If the emotion engine detects stress or fatigue based on the sensor information, it displays a message such as "Please relax."

[0471] Hardware and software used

[0472] Server: a high-performance computer system

[0473] Device: The computer or tablet used by the user

[0474] Generative Model: A generative AI model that uses natural language processing (NLP) techniques

[0475] Emotion engine: Software that performs facial expression recognition, voice analysis, and keystroke analysis

[0476] Specific examples

[0477] Suppose a user uploads the following Python code from their terminal:

[0478] python

[0479] Robot arm initialization function

[0480] def initialize_arm():

[0481] """

[0482] A function to initialize the robot arm

[0483] """

[0484] print("Initializing arm.")

[0485] A function to move the arm to a specific position

[0486] def move_arm_to_position(position):

[0487] """

[0488] A function that moves the robot arm to a specified position.

[0489] argument:

[0490] position: target position of the arm

[0491] """

[0492] print(f"Moving arm to {position}")

[0493] Unit Testing

[0494] initialize_arm()

[0495] move_arm_to_position('home')

[0496] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, etc. from the code and generates a specification document like this:

[0497] System Specifications

[0498] overview

[0499] The system includes functionality to initialize and move the robotic arm to a specific position.

[0500] Function Details

[0501] initialize_arm

[0502] Description: Initializes the robot arm.

[0503] Arguments: None

[0504] move_arm_to_position

[0505] Description: Moves the robot arm to the specified position.

[0506] argument:

[0507] position: target position of the arm

[0508] Test Cases

[0509] initialize_arm()

[0510] move_arm_to_position('home')

[0511] Furthermore, if the user types information into the system too quickly or their facial expression becomes grim, the emotion engine will determine that the user is feeling stressed. Based on the analysis results, the server will display messages such as "Please relax" to reduce the worker's stress.

[0512] Prompt Sentence Examples

[0513] The prompt is fed to the generative AI model in the following format:

[0514] Parse the following Python code and generate its specification:

[0515] Robot arm initialization function

[0516] def initialize_arm():

[0517] """

[0518] A function to initialize the robot arm

[0519] """

[0520] print("Initializing arm.")

[0521] A function to move the arm to a specific position

[0522] def move_arm_to_position(position):

[0523] """

[0524] A function that moves the robot arm to a specified position.

[0525] argument:

[0526] position: target position of the arm

[0527] """

[0528] print(f"Moving arm to {position}")

[0529] Unit Testing

[0530] initialize_arm()

[0531] move_arm_to_position('home')

[0532] This prompt allows the generative model to extract the necessary information and generate a high-quality specification.

[0533] The flow of the specific processing in the application example 2 will be described with reference to FIG.

[0534] Step 1:

[0535] The user uploads the source code.

[0536] The user uses the terminal and clicks the "Choose File" button in the web interface to select the source code file from the local disk and then clicks the "Upload" button. The input is the source code file, and the output is that this source code is sent to the server.

[0537] Step 2:

[0538] The server receives the source code and stores it in a temporary storage area.

[0539] The server receives the submitted source code file and saves it in the server's temporary storage area (e.g., a specified temporary directory). The input is the source code file submitted by the user, and the output is the path of the saved source code file.

[0540] Step 3:

[0541] The server launches the generative model.

[0542] The server passes the path of the saved source code file to the generative model and launches the model. The input is the path of the source code file, and the output is the generative model ready for analysis.

[0543] Step 4:

[0544] A generative model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases.

[0545] The generative model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases written in the code. The input is the content of the source code file, and the output is each analyzed element (comments, variable names, function names, control structures, and test cases).

[0546] Step 5:

[0547] The server generates a specification based on the extracted information.

[0548] The server uses the analysis results obtained from the generative model to automatically generate specifications written in natural language. The input is the analysis results, and the output is the generated specification.

[0549] Step 6:

[0550] The server stores the generated specification and provides a download link.

[0551] The server stores the generated specification and creates and provides a link for users to download the specification. The input is the generated specification and the output is the download link.

[0552] Step 7:

[0553] The server starts the emotion engine.

[0554] The server invokes the emotion engine to recognize the user's emotional state. The input is the invocation command and the output is the running emotion engine.

[0555] Step 8:

[0556] The emotion engine analyzes sensor data such as facial expressions, voice, and input speed.

[0557] The emotion engine analyzes sensor data such as facial expressions, voice, and typing speed to measure the user's emotional state. The input is the sensor data, and the output is the analyzed emotional state.

[0558] Step 9:

[0559] The server provides appropriate feedback to the user based on the analysis results.

[0560] The server displays appropriate feedback to the user based on the analysis results of the emotion engine, for example, a message such as "Please relax." The input is the analyzed emotional state, and the output is the feedback message.

[0561] The specific processing unit 290 transmits the result of the specific processing to the smart device 14. In the smart device 14, the control unit 46A causes the output device 40 to output the result of the specific processing. The microphone 38B acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.

[0562] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.

[0563] In the above embodiment, an example in which the specific process is performed by the data processing device 12 has been given, but the technology of the present disclosure is not limited to this, and the specific process may be performed by the smart device 14.

[0564] [Second embodiment]

[0565] FIG. 3 shows an example of the configuration of a data processing system 210 according to the second embodiment.

[0566] 3, the data processing system 210 includes the data processing device 12 and smart glasses 214. An example of the data processing device 12 is a server.

[0567] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).

[0568] The smart glasses 214 include a computer 36, a microphone 238, a speaker 240, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, and the camera 42 are also connected to the bus 52.

[0569] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.

[0570] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).

[0571] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 are responsible for the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.

[0572] Fig. 4 shows an example of the main functions of the data processing device 12 and the smart glasses 214. As shown in Fig. 4, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.

[0573] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.

[0574] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.

[0575] In the smart glasses 214, the reception output process is performed by the processor 46. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.

[0576] Next, a description will be given of the identification process performed by the identification processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as the "server" and the smart glasses 214 will be referred to as the "terminal."

[0577] The present invention provides a system that automates the creation and updating of system specifications during system construction and modification, reducing the number of processes and providing high-quality specifications. This system includes means for receiving and analyzing source code and generating specifications in natural language. An embodiment of the system is described in detail below.

[0578] System Overview

[0579] The system's analysis process begins when a user uploads source code from their device to the server via an interface. The server then launches a generative model to analyze the received source code. The generative model then extracts comments, variable names, function names, control structures, and test cases from the source code, and automatically generates a specification written in natural language based on the extracted information. The generated specification is stored on the server, and users can download it by providing a download link.

[0580] Program processing

[0581] On the terminal, the user uploads the source code. For example, the user clicks the "Select File" button on the web interface, selects the source code file from the local disk, and clicks the "Upload" button. The server receives the uploaded source code and stores it in a temporary storage area.

[0582] The server then launches a generative model, which uses natural language processing (NLP) techniques to analyze the source code and extract the necessary information: specifically, it identifies and extracts comment content, variable names and data types, function names and arguments, control structures, and test cases.

[0583] Based on the extracted information, the server uses a generative model to automatically generate a specification written in natural language, which includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and test case content.

[0584] Finally, the server saves the generated specification. Once the saving is complete, the server generates a download link and provides it to the user. The user can click the link to download the specification and save it locally.

[0585] Specific examples

[0586] For example, if a user uploads the following Python code:

[0587] python

[0588] Function: Double a number

[0589] def double_number(x):

[0590] """

[0591] A function that doubles a number

[0592] argument:

[0593] x: an integer or floating point number

[0594] Returns:

[0595] twice the value of x

[0596] """

[0597] return x 2

[0598] Unit Testing

[0599] assert double_number(2) == 4

[0600] double assert_number(1.5) == 3.0

[0601] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, and test cases from the code, and generates a specification that looks like this:

[0602] System Specifications

[0603] overview

[0604] The system includes a function that doubles an input number and its unit test.

[0605] Function Details

[0606] double_number

[0607] Description: Doubles the given number.

[0608] argument:

[0609] x: an integer or floating point number

[0610] Returns:

[0611] twice the value of x

[0612] Control Structures

[0613] It does not include conditional branches or loop structures.

[0614] Test Cases

[0615] assert double_number(2) == 4

[0616] double assert_number(1.5) == 3.0

[0617] This specification provides detailed explanations of function behavior and test content, making it easy for users and programmers to understand, and providing high-quality documentation that is free of any omissions or omissions.

[0618] In this way, the system of the present invention can significantly reduce the man-hours and risks involved in system development by efficiently analyzing source code, extracting necessary information, and generating high-quality specifications. A system that combines the means included in the claims provides a specific method for solving a specific technical problem.

[0619] The processing flow will be explained below.

[0620] Step 1:

[0621] A user accesses the web interface from a terminal, clicks the "Choose File" button, selects a source code file from the local disk, and clicks the "Upload" button.

[0622] Step 2:

[0623] The server receives the uploaded source code file and stores it in a temporary storage area. It verifies the file format and content to ensure there are no problems.

[0624] Step 3:

[0625] The server launches the generative model, which begins analyzing the source code using natural language processing (NLP) techniques.

[0626] Step 4:

[0627] The generative model extracts comments in the source code, specifically by detecting comment blocks in the code and associating them with the corresponding code blocks.

[0628] Step 5:

[0629] The generative model extracts variable names and data types, identifies variable declarations in the program, and determines what data type the variables are.

[0630] Step 6:

[0631] The generative model extracts function names and arguments by detecting function definitions in the code and analyzing the function name, its arguments, and the return value information.

[0632] Step 7:

[0633] The generative model extracts control structures, detecting conditional branches (if statements, switch statements, etc.) and loop structures (for statements, while statements, etc.) and analyzing their flow.

[0634] Step 8:

[0635] The generative model extracts test cases, identifying and organizing unit and integration tests defined in the source code.

[0636] Step 9:

[0637] The server automatically generates a specification written in natural language based on the information extracted from the generative model, which includes an overview of the entire system and detailed descriptions of each element.

[0638] Step 10:

[0639] The server saves the generated specification, and after saving is complete, it generates a download link and provides it to the user.

[0640] Step 11:

[0641] The user clicks on the download link provided by the server to download the generated specification, save it locally, and share it with the project team and stakeholders.

[0642] Example 1

[0643] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."

[0644] Creating and updating system specifications during system construction and modification requires a significant amount of man-hours and time. Furthermore, creating specifications manually is prone to errors and omissions, resulting in a decline in quality. Therefore, there is a need for an efficient, automated method for creating high-quality specifications.

[0645] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.

[0646] In this invention, the server includes means for receiving source code, means for saving the received source code in a temporary storage area, means for launching a generative AI model for analyzing the received source code, means for setting a prompt statement in the generative AI model and instructing it to analyze the source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative AI model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications as a file, and means for generating and providing a download link for the saved specifications. This automates the creation and updating of specifications, reducing labor costs and enabling the provision of high-quality specifications.

[0647] "Source code" refers to the text files of a computer program written by a developer to design and implement the program.

[0648] The "temporary storage area" is a storage area for temporarily storing received data.

[0649] A "generative AI model" is a machine learning model that performs natural language processing based on given input data (prompts).

[0650] A "prompt sentence" is a text sentence that is input to a generative AI model to instruct it to analyze or generate something.

[0651] "Comments" are annotations or explanations written in source code to clarify the behavior and intent of the code.

[0652] A "variable name" is an identifier used to store data within a program.

[0653] A "function name" is an identifier of a code block defined to perform a specific process.

[0654] A "control structure" is a syntax for controlling the execution flow of a program, and includes conditional branches and loops.

[0655] A "test case" is a specific test condition or procedure that is executed to verify the functionality or performance of a program.

[0656] A "specification" is a document that clearly states the functions, structure, and operation of a system, and is intended for reference by developers and users.

[0657] "Download Link" means a URL provided to download a file over the Internet.

[0658] The present invention is a system that analyzes source code and automatically generates specifications. This system includes a process for uploading source code from a terminal to a server and generating specifications by analyzing the source code. This process utilizes a generative AI model to extract comments, variable names, function names, control structures, and test cases, and creates specifications written in natural language based on the extracted content.

[0659] Hardware and software used

[0660] The system is implemented using the following hardware and software.

[0661] Device: A device such as a computer or smartphone operated by a user.

[0662] Server: A high-performance computer for receiving, analyzing, generating specifications, and storing source code. Here, we will assume a virtual server of a typical cloud service.

[0663] Generative AI model: A natural language processing model that analyzes source code and generates specifications in natural language. For example, the GPT series of models.

[0664] Web Interface: A web page where users can upload their source code, built using HTML, CSS, and JavaScript.

[0665] Specific actions

[0666] The user accesses the web interface from the terminal and uploads the source code. To do so, the user clicks the "Select File" button, selects a file from the local disk, and then clicks the "Upload" button. The source code sent from the terminal is stored in a temporary storage area on the server.

[0667] Next, the server launches the generative AI model to analyze the saved source code, with the following prompt:

[0668] Analyze the following source code and generate a specification.

[0669] The prompt statement is then added to the source code and input to the generative AI model, which then analyzes the given prompt statement and source code to identify and extract comments, variable names, function names, control structures, and test cases.

[0670] The generative AI model then uses the extracted information to automatically generate a specification in natural language, which includes a system overview, detailed descriptions of each function, a list of variables, a description of the control flow, and test cases. For example, if a user uploads the following Python code:

[0671] python

[0672] Function: Double a number

[0673] def double_number(x):

[0674] """

[0675] A function that doubles a number

[0676] argument:

[0677] x: an integer or floating point number

[0678] Returns:

[0679] twice the value of x

[0680] """

[0681] return x 2

[0682] Unit Testing

[0683] assert double_number(2) == 4

[0684] double assert_number(1.5) == 3.0

[0685] The server parses this source code and generates a specification like this:

[0686] System Specifications

[0687] overview

[0688] The system includes a function that doubles an input number and its unit test.

[0689] Function Details

[0690] double_number

[0691] Description: Doubles the given number.

[0692] argument:

[0693] x: an integer or floating point number

[0694] Returns:

[0695] twice the value of x

[0696] Control Structures

[0697] It does not include conditional branches or loop structures.

[0698] Test Cases

[0699] assert double_number(2) == 4

[0700] double assert_number(1.5) == 3.0

[0701] The generated specification is stored in the server's storage and then provided to the user as a download link, via which the user can download the specification and save it locally.

[0702] In this way, the system of the present invention automates the process from uploading source code to analysis, specification generation, and final downloading, thereby enabling the efficient provision of high-quality specifications.

[0703] The flow of the identification process in the first embodiment will be described with reference to FIG.

[0704] Step 1:

[0705] Uploading source code

[0706] The user opens the web interface on the terminal, clicks the "Choose File" button to select a source code file from the local disk, and then clicks the "Upload" button. As input, there is the source code file selected by the user. As output, the selected file is sent to the server.

[0707] Step 2:

[0708] Receiving and storing source code

[0709] The server receives the source code sent by the user and saves it in a temporary storage area. As input, the server receives an HTTP POST request. As output, the source code is saved in a temporary storage area (e.g., the / tmp directory). The server uses a framework such as Python or Flask to retrieve and save the file using request.files['file'].

[0710] Step 3:

[0711] Launching a generative AI model

[0712] The server launches the generative AI model to analyze the saved source code file. As input, it takes the path of the saved source code and a prompt. As output, it launches the generative AI model and starts the analysis process. The specific prompt is as follows:

[0713] Analyze the following source code and generate a specification.

[0714] Step 4:

[0715] Source code analysis

[0716] The generative AI model performs analysis based on the given prompt and source code. As input, the prompt followed by the source code content is provided. As output, comments, variable names, function names, control structures, and test cases are extracted from the source code. The generative AI model identifies and classifies these elements.

[0717] Step 5:

[0718] Generate specifications

[0719] The server uses a generative AI model based on the extracted information to automatically generate specifications written in natural language. The analyzed source code information is provided as input. The output is a specification that includes a system overview, function details, a list of variables, control flow, and test case content. For example, it includes the following content:

[0720] System Specifications

[0721] overview

[0722] The system includes a function that doubles an input number and its unit test.

[0723] Function Details

[0724] double_number

[0725] Description: Doubles the given number.

[0726] argument:

[0727] x: an integer or floating point number

[0728] Returns:

[0729] twice the value of x

[0730] Control Structures

[0731] It does not include conditional branches or loop structures.

[0732] Test Cases

[0733] assert double_number(2) == 4

[0734] double assert_number(1.5) == 3.0

[0735] Step 6:

[0736] Storing and providing specifications

[0737] The server saves the generated specification as a file. As input, the content of the generated specification is provided. As output, the specification file is saved and its path is determined. For example, it is saved as example_spec.md in the / docs directory. Once saving is complete, the server generates a download link and provides it to the user through the web interface. The user can click the link to download the specification and save it locally.

[0738] (Application example 1)

[0739] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."

[0740] Creating specifications for conventional factory robots required a great deal of man-hours and specialized knowledge, and the accuracy and consistency of the resulting specifications were an issue. Furthermore, the more complex the robot's movements, the more work it required to update the specifications, leading to inefficiencies in actual operation. Furthermore, discrepancies often occurred between the actual source code and the specifications, requiring time and effort during troubleshooting and maintenance. A system that could solve these issues and automatically generate high-quality, consistent specifications was needed.

[0741] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.

[0742] In this invention, the server includes means for receiving source code, means for activating a generative model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications and providing a download link, means for uploading photos of the source code using a smart device, and means for generating specifications from the photos of the source code. This makes it possible to grasp the robot's operation in detail and quickly generate high-quality specifications.

[0743] "Source code" is code that describes a program, in a form before it is converted into a computer-executable form.

[0744] "Means for receiving" refers to a device or mechanism capable of obtaining data or information through a network or interface.

[0745] A "generative model for analysis" is a model trained by artificial intelligence or machine learning that is used to analyze given input data, especially source code, and understand its structure and content.

[0746] A "comment" is an explanation or annotation written in source code that does not affect the operation of the program but makes it easier for programmers and administrators to understand and maintain the code.

[0747] A "variable name" is a label or name used to identify specific data or values ​​within a program.

[0748] A "function name" is a name or label that identifies a block of code that performs a particular operation or procedure.

[0749] A "control structure" is a syntax element for controlling the flow and execution order of a program, and includes conditional branching and repetitive processing.

[0750] A "test case" is a set of specific inputs and expected outputs designed to verify whether a program or system works correctly.

[0751] A "specification written in natural language" is a document that describes the structure and operation of a program in a format that humans can understand.

[0752] A "smart device" is a portable electronic device such as a smartphone or tablet that has advanced computing and communication capabilities.

[0753] A "means for uploading photos" is a mechanism that has the function of sending and storing image data on a server or cloud.

[0754] A "means for generating specifications" is a mechanism that has the ability to automatically create detailed descriptions of a program or system based on given data or information.

[0755] This invention is a system that automatically generates robot operation specifications by photographing and uploading the source code of a factory robot. The system of this invention is realized by combining a server, smart devices, and software.

[0756] System Overview

[0757] Users use a smart device (such as a smartphone or tablet) to take a photo of the factory robot's source code and upload the photo or file to the server through the interface. The server analyzes the received data and activates a generative AI model to extract the necessary information from the source code. The generative AI model uses natural language processing technology to identify and extract comments, variable names, function names, control structures, and test cases. It then automatically generates a specification document written in natural language based on the extracted information. The final generated specification document is stored on the server, and users can obtain it via a download link.

[0758] Hardware and software used

[0759] Server: The computer system that receives the data and runs the generative AI model.

[0760] Smart Device: A device (smartphone, tablet, etc.) for taking photos of and uploading source code.

[0761] Generative AI model: A model that uses natural language processing techniques such as the OpenAI API.

[0762] Interface: A web application (using the Flask framework, for example) that manages the exchange of data between the user and the server.

[0763] Program processing explanation

[0764] The server receives the source code uploaded by the user through the interface and stores it in a temporary storage area. The server then launches a generative AI model (e.g., OpenAI API) to begin analyzing the received source code. During this analysis process, comments, variable names, function names, control structures, and test cases within the source code are identified and extracted. A specification written in natural language is then generated based on the extracted information. The generated specification is stored on the server, and the user can obtain it via a download link.

[0765] Examples and prompts

[0766] Here is the Python code that a user might upload as an example:

[0767] Upload Code:

[0768] python

[0769] Functions that control the robot's behavior

[0770] def control_robot(action):

[0771] """

[0772] Functions that control the robot's behavior

[0773] argument:

[0774] action: Action command (str)

[0775] Returns:

[0776] Operation result (str)

[0777] """

[0778] if action == "forward":

[0779] return "The robot moves forward"

[0780] elif action == "backward":

[0781] return "Robot retreats"

[0782] else:

[0783] return "Invalid command"

[0784] Example of generated prompt:

[0785] Generate a specification from the following source code:

[0786] python

[0787] Functions that control the robot's behavior

[0788] def control_robot(action):

[0789] """

[0790] Functions that control the robot's behavior

[0791] argument:

[0792] action: Action command (str)

[0793] Returns:

[0794] Operation result (str)

[0795] """

[0796] if action == "forward":

[0797] return "The robot moves forward"

[0798] elif action == "backward":

[0799] return "Robot retreats"

[0800] else:

[0801] return "Invalid command"

[0802] This system makes it possible to grasp the details of factory robot operations and quickly generate high-quality specifications, thereby reducing man-hours and improving the quality of specifications.

[0803] The flow of the specific processing in the application example 1 will be described with reference to FIG.

[0804] Step 1:

[0805] A user takes a photo of the source code or selects a source code file using a smart device. The photo or selected file is uploaded to the server through the interface. The input of this step is the source code image or file. The output is the image data or file data transferred to the server.

[0806] Step 2:

[0807] The server receives the uploaded image data or file data and stores it in a temporary storage area. The input of this step is the image data or file data sent by the user. The output is the data stored in the temporary storage area.

[0808] Step 3:

[0809] The server identifies the format of the received data (image or file) and performs appropriate preprocessing. If it is image data, it uses OCR (Optical Character Recognition) technology to extract text from the image. If it is file data, it uses it as text. The input at this stage is image data or file data from a temporary storage area. The output is source code in text format.

[0810] Step 4:

[0811] The server launches the generative AI model and inputs the textual source code into the model. The generative AI model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases. The input of this stage is the textual source code. The output is a set of extracted information.

[0812] Step 5:

[0813] The server uses a generative AI model to automatically generate a specification written in natural language based on the extracted information. The input to this stage is the set of extracted information. The output is a specification written in natural language.

[0814] Step 6:

[0815] The server stores the generated specification and generates a download link that users can access. The input to this stage is a specification written in natural language. The output is a download link to the location where the specification is stored.

[0816] Step 7:

[0817] The user accesses the download link through the interface and downloads the generated specification. The input of this step is the download link. The output is the locally saved specification.

[0818] This series of steps allows users to efficiently generate high-quality specifications.

[0819] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.

[0820] The present invention provides a system that automates the creation and updating of system specifications during system construction and modification, reducing the number of steps and providing high-quality specifications. The present invention also includes an emotion engine that recognizes a user's emotions and provides feedback based on the results. Embodiments of the present invention are described in detail below.

[0821] System Overview

[0822] The system analysis process begins when a user uploads source code from their device to the server via an interface. The server then launches a generative model to analyze the received source code. The generative model extracts comments, variable names, function names, control structures, and test cases from the source code, and automatically generates a specification document written in natural language based on the extracted information. The generated specification document is stored on the server, and a download link is provided.

[0823] The emotion engine uses sensor data and input information to recognize the user's emotions, analyzes the user's emotional state, and provides appropriate feedback to the user according to the analysis results and the contents of the generated specifications.

[0824] Program processing

[0825] The user uploads the source code on the terminal. For example, the user clicks the "Select File" button on the web interface, selects the source code file from the local disk, and clicks the "Upload" button. The server receives the uploaded source code and stores it in a temporary storage area.

[0826] The server then launches a generative model, which uses natural language processing (NLP) techniques to analyze the source code and extract the necessary information: specifically, it identifies and extracts comment content, variable names and data types, function names and arguments, control structures, and test cases.

[0827] Based on the extracted information, the server uses a generative model to automatically generate a specification written in natural language, which includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and test case content.

[0828] The emotion engine recognizes the user's emotional state by analyzing the user's facial expression, tone of voice, typing pace, etc. For example, if the user types at a faster pace than usual or their facial expression becomes grim, the emotion engine will determine that the user is feeling stressed.

[0829] Based on the analysis results of the emotion engine, the server provides feedback to the user. For example, it can display a message such as "Please relax" based on the analysis results, or automatically generate an explanation to supplement the contents of the specification.

[0830] Finally, the server saves the generated specification. Once the saving is complete, the server generates a download link and provides it to the user. The user can click the link to download the specification and save it locally. In addition, the emotion engine's feedback can reduce the user's stress and improve work efficiency.

[0831] Specific examples

[0832] For example, if a user uploads the following Python code:

[0833] python

[0834] Function: Double a number

[0835] def double_number(x):

[0836] """

[0837] A function that doubles a number

[0838] argument:

[0839] x: an integer or floating point number

[0840] Returns:

[0841] twice the value of x

[0842] """

[0843] return x 2

[0844] Unit Testing

[0845] assert double_number(2) == 4

[0846] double assert_number(1.5) == 3.0

[0847] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, and test cases from the code, and generates a specification that looks like this:

[0848] System Specifications

[0849] overview

[0850] The system includes a function that doubles an input number and its unit test.

[0851] Function Details

[0852] double_number

[0853] Description: Doubles the given number.

[0854] argument:

[0855] x: an integer or floating point number

[0856] Returns:

[0857] twice the value of x

[0858] Control Structures

[0859] It does not include conditional branches or loop structures.

[0860] Test Cases

[0861] assert double_number(2) == 4

[0862] double assert_number(1.5) == 3.0

[0863] This specification provides detailed explanations of function behavior and test content, making it easy for users and programmers to understand, and providing high-quality documentation that is free of any omissions or omissions.

[0864] If the emotion engine analyzes the user's facial expressions and input pace and detects that the user is feeling stressed, it can display a message such as "Please relax," thereby improving the user's work efficiency and mental comfort. In this way, by combining emotion engines, a system can be realized that provides appropriate feedback according to the user's emotional state.

[0865] In this way, the system of the present invention not only efficiently analyzes source code, extracts necessary information, and generates high-quality specifications, but also recognizes user emotions and provides appropriate feedback, thereby significantly reducing the labor hours and risks involved in system development.

[0866] The processing flow will be explained below.

[0867] Step 1:

[0868] A user accesses the web interface from a terminal, clicks the "Choose File" button, selects a source code file from the local disk, and clicks the "Upload" button.

[0869] Step 2:

[0870] The server receives the uploaded source code file and stores it in a temporary storage area. It verifies the file format and content to ensure there are no problems.

[0871] Step 3:

[0872] The server launches the generative model, which begins analyzing the source code using natural language processing (NLP) techniques.

[0873] Step 4:

[0874] The generative model extracts comments in the source code, specifically by detecting comment blocks in the code and associating them with the corresponding code blocks.

[0875] Step 5:

[0876] The generative model extracts variable names and data types, identifies variable declarations in the program, and determines what data type the variables are.

[0877] Step 6:

[0878] The generative model extracts function names and arguments by detecting function definitions in the code and analyzing the function name, its arguments, and the return value information.

[0879] Step 7:

[0880] The generative model extracts control structures, detecting conditional branches (if statements, switch statements, etc.) and loop structures (for statements, while statements, etc.) and analyzing their flow.

[0881] Step 8:

[0882] The generative model extracts test cases, identifying and organizing unit and integration tests defined in the source code.

[0883] Step 9:

[0884] The server automatically generates a specification written in natural language based on the information extracted from the generative model, which includes an overview of the entire system and detailed descriptions of each element.

[0885] Step 10:

[0886] The server uses an emotion engine to analyze the user's emotions, specifically by analyzing the user's facial expressions, tone of voice, and typing pace to recognize the user's emotional state.

[0887] Step 11:

[0888] Based on the analysis results of the emotion engine, the server provides feedback to the user. For example, if the user is feeling stressed, a message encouraging them to relax is displayed.

[0889] Step 12:

[0890] The server saves the generated specification, and after saving is complete, it generates a download link and provides it to the user.

[0891] Step 13:

[0892] The user clicks on the download link provided by the server to download the generated specification, save it locally, and share it with the project team and stakeholders.

[0893] Example 2

[0894] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."

[0895] In conventional system development, analyzing source code and creating specifications are often done manually, which is time-consuming, labor-intensive, and prone to human error. Furthermore, while the user's emotional state can affect the efficiency and quality of system development, few systems take this into account. Therefore, a system that automates analysis, efficiently generates high-quality specifications, and recognizes the user's emotions and provides appropriate feedback is needed.

[0896] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.

[0897] In this invention, the server includes means for receiving source code, means for launching a generative AI model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative AI model, means for automatically generating specifications written in natural language based on the extracted information, means for launching an emotion analysis engine that recognizes user emotions and provides feedback based on the results, and means for saving the generated specifications and providing a download link. This enables the automation of source code analysis and specification generation, and provides feedback according to the user's emotional state, enabling efficient and high-quality system development.

[0898] "Source code" is a text file that describes the behavior of a program and is the input before it is converted into a form that a computer can run.

[0899] "Means for receiving" refers to the communication functions and protocols used to transfer data from a terminal to a server and receive the data on the server side.

[0900] A "generative AI model" refers to an algorithm or program that uses machine learning and natural language processing techniques to analyze source code, extract specific information, and perform specified tasks.

[0901] A "comment" is text written in source code to add supplementary explanations without affecting the operation of the program.

[0902] A "variable name" is a named symbol for storing data within a program, and serves to hold a value in a series of operations or calculations.

[0903] A "function name" is an identifier used to call a code block that performs a specific process or calculation.

[0904] A "control structure" is a syntax for controlling the execution flow of a program, and includes conditional branches and loops.

[0905] A "test case" defines specific inputs and expected outputs to verify the functionality and behavior of a program.

[0906] A "specification written in natural language" is a document that provides a detailed explanation of the operation of a system or program in a format that is easy to understand even for people without specialized programming knowledge.

[0907] An "emotion analysis engine" is a software module for detecting a user's emotional state, analyzing data such as facial expressions, voice, and input speed to classify emotions.

[0908] "Providing feedback" means that the system provides the user with information such as analysis results, suggestions, and warnings in a timely manner.

[0909] DETAILED DESCRIPTION OF THE INVENTION The present invention provides a system for automating the creation and updating of system specifications, and for analyzing a user's emotional state and providing feedback. The following describes in detail an embodiment of the present invention.

[0910] A user uses a terminal to upload source code to the server. To do this, the user launches a browser and accesses a web interface. For example, the user clicks the "Choose File" button, selects the source code file from the local disk, and clicks the "Upload" button to send the file from the terminal to the server.

[0911] The server receives the HTTP request and saves the file data in the request in a temporary storage area. This makes the source code available for subsequent analysis steps. The server then launches a generative AI model using natural language processing (NLP) techniques. This generative AI model is an algorithm built in Python or similar language and analyzes the uploaded source code.

[0912] The generative AI model identifies and extracts comments, variable names, function names, control structures, and test cases from the source code. This information is stored as a data structure in the server's memory. The server then automatically generates a specification written in natural language based on the extracted information. This specification includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and the contents of the test cases.

[0913] The emotion analysis engine recognizes the user's emotional state by analyzing their facial expressions, tone of voice, typing pace, etc. For example, if the user types at a faster pace than usual or if the camera image shows a grim expression, the emotion analysis engine will determine that the user is feeling stressed.

[0914] Based on the analysis, the server can provide appropriate feedback to the user, for example, a message such as "Relax" can be displayed in the web interface, and comments can be provided to supplement the content of the specification, if necessary.

[0915] The server stores the final generated specification in long-term storage. Once the storage process is complete, the server generates a download link for the user and displays it on the web interface. The user can click the link to download the specification and save it to their local disk.

[0916] As a concrete example, consider the following Python code uploaded by a user:

[0917] python

[0918] Function: Double a number

[0919] def double_number(x):

[0920] """

[0921] A function that doubles a number

[0922] argument:

[0923] x: an integer or floating point number

[0924] Returns:

[0925] twice the value of x

[0926] """

[0927] return x 2

[0928] Unit Testing

[0929] assert double_number(2) == 4

[0930] double assert_number(1.5) == 3.0

[0931] The server receives this source code and begins analyzing it. A generative AI model extracts comments, function names, arguments, and test cases from the code, generating a specification that looks like this:

[0932] markdown

[0933] System Specifications

[0934] overview

[0935] The system includes a function that doubles an input number and its unit test.

[0936] Function Details

[0937] double_number

[0938] Description: Doubles the given number.

[0939] argument:

[0940] x: an integer or floating point number

[0941] Returns:

[0942] twice the value of x

[0943] Control Structures

[0944] It does not include conditional branches or loop structures.

[0945] Test Cases

[0946] assert double_number(2) == 4

[0947] double assert_number(1.5) == 3.0

[0948] The generated specifications provide detailed explanations of function behavior and test content, making it easier for engineers and programmers to understand. In this way, the system of the present invention automates a series of processes, from analyzing source code to generating specifications, and even recognizing user emotions and providing appropriate feedback, achieving highly efficient and high-quality development support.

[0949] The flow of the identification process in the second embodiment will be described with reference to FIG.

[0950] Step 1:

[0951] The user uploads the source code from the terminal to the server.

[0952] Specifically, the user launches a browser on their device, accesses the provided web interface, clicks the "Choose File" button, selects the source code file from their local disk, and then clicks the "Upload" button, which sends the source code to the server as an HTTP request.

[0953] Input: Source code files stored on your local disk

[0954] Output: Source code data sent to the server

[0955] Step 2:

[0956] The server receives the source code and stores it in a temporary storage area.

[0957] Specifically, the server receives an HTTP request, extracts the file data from it, and saves the extracted file data in a designated temporary storage area. This file is used for analysis by the generative AI model.

[0958] Input: Source code data in the HTTP request

[0959] Output: Source code file saved in temporary storage area on the server

[0960] Step 3:

[0961] The server launches the generative AI model and analyzes the source code.

[0962] Specifically, the server launches a generative AI model built in Python or similar. This model uses natural language processing (NLP) techniques to analyze source code, identifying comments, variable names, function names, control structures, and test cases, and extracting information from each.

[0963] Input: Source code files stored on the server

[0964] Output: Comments, variable names, function names, control structures, and test case information extracted by the analysis.

[0965] Step 4:

[0966] The server automatically generates specifications based on the extracted information.

[0967] Specifically, the server provides the extracted information as input to the generative AI model to generate a specification written in natural language. This specification includes an overview of the system, detailed descriptions of functions, a list of variables, a description of the control flow, and the contents of test cases. The generated specification is then saved in a temporary storage area.

[0968] Input: Comments, variable names, function names, control structures, and test case information

[0969] Output: A specification written in natural language

[0970] Step 5:

[0971] The emotion analysis engine analyzes the user's emotional state.

[0972] Specifically, the emotion analysis engine analyzes the user's facial expression data (camera input), voice data (microphone input), and typing pace (keyboard input speed) to evaluate the user's emotional state and detect, for example, stress.

[0973] Input: facial expression data, voice data, input pace

[0974] Output: Evaluated user emotional state

[0975] Step 6:

[0976] The server provides feedback based on the results of the sentiment analysis engine.

[0977] Specifically, the server displays an appropriate message on the web interface based on the results of the emotion analysis engine. For example, displaying a message such as "Please relax" can improve the user's mental comfort. It can also display supplementary explanations to the content of the specifications as needed.

[0978] Input: Evaluated emotional state of the user

[0979] Output: Feedback message to the user

[0980] Step 7:

[0981] The server saves the generated specification and generates a download link.

[0982] Specifically, the server writes the generated specification to long-term storage. Once saved, the server generates a download link and displays it on the web interface. Users can click the link to download the specification and save it to their local disk.

[0983] Input: Generated specification

[0984] Output: Download link, save specification

[0985] (Application example 2)

[0986] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."

[0987] In modern system development, manually creating source code specifications requires a significant amount of time and effort, and is prone to human error. Robot control programs, especially those used on factory production lines, are complex, making the creation and updating of specifications extremely important. However, high levels of stress and fatigue can hinder efficient work. Therefore, there is a need for an efficient system development environment that not only automatically generates specifications but also monitors the emotional state of workers and provides appropriate feedback.

[0988] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 2 is realized by the following means.

[0989] In this invention, the server includes means for receiving source code, means for activating a generative model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications and providing a download link, means for activating an emotion engine for recognizing the emotional state of a worker and providing feedback, means for analyzing sensor data such as facial expressions, voice, and input speed using the emotion engine, and means for providing appropriate feedback to the worker based on the analysis results. This enables both the automatic generation of specifications and feedback according to the worker's emotional state, thereby realizing efficient and high-quality system construction.

[0990] The "means for receiving source code" is a function that allows a user to upload source code to the system and have the code received by the server.

[0991] "Means for launching a generative model" refers to a function for running an AI model or machine learning model to analyze received source code.

[0992] "Means for extracting comments, variable names, function names, control structures, and test cases from source code" refers to a function for automatically identifying and extracting annotations, variable names, function names, control flow structures, and test cases from source code.

[0993] "Means for automatically generating specifications written in natural language" is a function for automatically creating documents in a format that is easy for humans to understand, based on extracted information.

[0994] The "means for saving the generated specifications and providing a download link" is a function for saving the automatically generated specifications on a server and providing a link that allows the user to download the specifications.

[0995] The "means for activating an emotion engine to recognize the worker's emotional state and provide feedback" is a function for acquiring sensor data necessary to recognize the user's emotions and executing an engine that processes the data.

[0996] "Means for analyzing sensor data such as facial expressions, voice, and input speed" is a function that collects information such as a worker's facial expressions, voice changes, and keystroke speed, and analyzes them to determine their emotional state.

[0997] "Means for providing appropriate feedback to workers based on the analysis results" is a function for providing feedback and suggestions to relieve workers' stress and fatigue based on the results of the emotion engine.

[0998] This invention is a system that efficiently analyzes robot control programs for factory production lines and automatically generates specifications. It also monitors the emotional state of workers and provides appropriate feedback to improve work efficiency and quality. Specific embodiments for implementing this invention are described below.

[0999] System configuration

[1000] The system mainly consists of the following components:

[1001] 1. Server

[1002] 2. Terminal

[1003] 3. Emotion Engine

[1004] 4. Generative Model

[1005] What the program does

[1006] The server has a means for receiving source code sent by users. The process begins when a user selects and uploads source code from a web interface via their terminal. Once the source code is received by the server, it is stored in a temporary storage area.

[1007] The server then launches a generative model, which analyzes and extracts comments, variable names, function names, control structures, and test cases from the source code. Using natural language processing (NLP) techniques, the analysis automatically generates a specification written in natural language based on the extracted information. The specification is then stored on the server, and a download link is provided for users to download.

[1008] The server then activates an emotion engine, which analyzes the worker's emotional state using sensor data such as the user's facial expressions, voice, and input speed. Based on the analysis results, the server provides appropriate feedback to the worker. If the emotion engine detects stress or fatigue based on the sensor information, it displays a message such as "Please relax."

[1009] Hardware and software used

[1010] Server: a high-performance computer system

[1011] Device: The computer or tablet used by the user

[1012] Generative Model: A generative AI model that uses natural language processing (NLP) techniques

[1013] Emotion engine: Software that performs facial expression recognition, voice analysis, and keystroke analysis

[1014] Specific examples

[1015] Suppose a user uploads the following Python code from their terminal:

[1016] python

[1017] Robot arm initialization function

[1018] def initialize_arm():

[1019] """

[1020] A function to initialize the robot arm

[1021] """

[1022] print("Initializing arm.")

[1023] A function to move the arm to a specific position

[1024] def move_arm_to_position(position):

[1025] """

[1026] A function that moves the robot arm to a specified position.

[1027] argument:

[1028] position: target position of the arm

[1029] """

[1030] print(f"Moving arm to {position}")

[1031] Unit Testing

[1032] initialize_arm()

[1033] move_arm_to_position('home')

[1034] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, etc. from the code and generates a specification document like this:

[1035] System Specifications

[1036] overview

[1037] The system includes functionality to initialize and move the robotic arm to a specific position.

[1038] Function Details

[1039] initialize_arm

[1040] Description: Initializes the robot arm.

[1041] Arguments: None

[1042] move_arm_to_position

[1043] Description: Moves the robot arm to the specified position.

[1044] argument:

[1045] position: target position of the arm

[1046] Test Cases

[1047] initialize_arm()

[1048] move_arm_to_position('home')

[1049] Furthermore, if the user types information into the system too quickly or their facial expression becomes grim, the emotion engine will determine that the user is feeling stressed. Based on the analysis results, the server will display messages such as "Please relax" to reduce the worker's stress.

[1050] Prompt Sentence Examples

[1051] The prompt is fed to the generative AI model in the following format:

[1052] Parse the following Python code and generate its specification:

[1053] Robot arm initialization function

[1054] def initialize_arm():

[1055] """

[1056] A function to initialize the robot arm

[1057] """

[1058] print("Initializing arm.")

[1059] A function to move the arm to a specific position

[1060] def move_arm_to_position(position):

[1061] """

[1062] A function that moves the robot arm to a specified position.

[1063] argument:

[1064] position: target position of the arm

[1065] """

[1066] print(f"Moving arm to {position}")

[1067] Unit Testing

[1068] initialize_arm()

[1069] move_arm_to_position('home')

[1070] This prompt allows the generative model to extract the necessary information and generate a high-quality specification.

[1071] The flow of the specific processing in the application example 2 will be described with reference to FIG.

[1072] Step 1:

[1073] The user uploads the source code.

[1074] The user uses the terminal and clicks the "Choose File" button in the web interface to select the source code file from the local disk and then clicks the "Upload" button. The input is the source code file, and the output is that this source code is sent to the server.

[1075] Step 2:

[1076] The server receives the source code and stores it in a temporary storage area.

[1077] The server receives the submitted source code file and saves it in the server's temporary storage area (e.g., a specified temporary directory). The input is the source code file submitted by the user, and the output is the path of the saved source code file.

[1078] Step 3:

[1079] The server launches the generative model.

[1080] The server passes the path of the saved source code file to the generative model and launches the model. The input is the path of the source code file, and the output is the generative model ready for analysis.

[1081] Step 4:

[1082] A generative model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases.

[1083] The generative model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases written in the code. The input is the content of the source code file, and the output is each analyzed element (comments, variable names, function names, control structures, and test cases).

[1084] Step 5:

[1085] The server generates a specification based on the extracted information.

[1086] The server uses the analysis results obtained from the generative model to automatically generate specifications written in natural language. The input is the analysis results, and the output is the generated specification.

[1087] Step 6:

[1088] The server stores the generated specification and provides a download link.

[1089] The server stores the generated specification and creates and provides a link for users to download the specification. The input is the generated specification and the output is the download link.

[1090] Step 7:

[1091] The server starts the emotion engine.

[1092] The server invokes the emotion engine to recognize the user's emotional state. The input is the invocation command and the output is the running emotion engine.

[1093] Step 8:

[1094] The emotion engine analyzes sensor data such as facial expressions, voice, and input speed.

[1095] The emotion engine analyzes sensor data such as facial expressions, voice, and typing speed to measure the user's emotional state. The input is the sensor data, and the output is the analyzed emotional state.

[1096] Step 9:

[1097] The server provides appropriate feedback to the user based on the analysis results.

[1098] The server displays appropriate feedback to the user based on the analysis results of the emotion engine, for example, a message such as "Please relax." The input is the analyzed emotional state, and the output is the feedback message.

[1099] The specific processing unit 290 transmits the result of the specific processing to the smart glasses 214. In the smart glasses 214, the control unit 46A causes the speaker 240 to output the result of the specific processing. The microphone 238 acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.

[1100] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.

[1101] In the above embodiment, an example in which the specific processing is performed by the data processing device 12 has been given, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the smart glasses 214.

[1102] [Third embodiment]

[1103] FIG. 5 shows an example of the configuration of a data processing system 310 according to the third embodiment.

[1104] 5, the data processing system 310 includes the data processing device 12 and a headset terminal 314. An example of the data processing device 12 is a server.

[1105] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).

[1106] The headset type terminal 314 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a display 343. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, the camera 42, and the display 343 are also connected to the bus 52.

[1107] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.

[1108] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).

[1109] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 are responsible for the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.

[1110] Fig. 6 shows an example of the main functions of the data processing device 12 and the headset type terminal 314. As shown in Fig. 6, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.

[1111] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.

[1112] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.

[1113] In the headset type terminal 314, a reception output process is performed by the processor 46. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.

[1114] Next, a description will be given of the identification process performed by the identification processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as the "server" and the headset type terminal 314 will be referred to as the "terminal."

[1115] The present invention provides a system that automates the creation and updating of system specifications during system construction and modification, reducing the number of processes and providing high-quality specifications. This system includes means for receiving and analyzing source code and generating specifications in natural language. An embodiment of the system is described in detail below.

[1116] System Overview

[1117] The system's analysis process begins when a user uploads source code from their device to the server via an interface. The server then launches a generative model to analyze the received source code. The generative model then extracts comments, variable names, function names, control structures, and test cases from the source code, and automatically generates a specification written in natural language based on the extracted information. The generated specification is stored on the server, and users can download it by providing a download link.

[1118] Program processing

[1119] On the terminal, the user uploads the source code. For example, the user clicks the "Select File" button on the web interface, selects the source code file from the local disk, and clicks the "Upload" button. The server receives the uploaded source code and stores it in a temporary storage area.

[1120] The server then launches a generative model, which uses natural language processing (NLP) techniques to analyze the source code and extract the necessary information: specifically, it identifies and extracts comment content, variable names and data types, function names and arguments, control structures, and test cases.

[1121] Based on the extracted information, the server uses a generative model to automatically generate a specification written in natural language, which includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and test case content.

[1122] Finally, the server saves the generated specification. Once the saving is complete, the server generates a download link and provides it to the user. The user can click the link to download the specification and save it locally.

[1123] Specific examples

[1124] For example, if a user uploads the following Python code:

[1125] python

[1126] Function: Double a number

[1127] def double_number(x):

[1128] """

[1129] A function that doubles a number

[1130] argument:

[1131] x: an integer or floating point number

[1132] Returns:

[1133] twice the value of x

[1134] """

[1135] return x 2

[1136] Unit Testing

[1137] assert double_number(2) == 4

[1138] double assert_number(1.5) == 3.0

[1139] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, and test cases from the code, and generates a specification that looks like this:

[1140] System Specifications

[1141] overview

[1142] The system includes a function that doubles an input number and its unit test.

[1143] Function Details

[1144] double_number

[1145] Description: Doubles the given number.

[1146] argument:

[1147] x: an integer or floating point number

[1148] Returns:

[1149] twice the value of x

[1150] Control Structures

[1151] It does not include conditional branches or loop structures.

[1152] Test Cases

[1153] assert double_number(2) == 4

[1154] double assert_number(1.5) == 3.0

[1155] This specification provides detailed explanations of function behavior and test content, making it easy for users and programmers to understand, and providing high-quality documentation that is free of any omissions or omissions.

[1156] In this way, the system of the present invention can significantly reduce the man-hours and risks involved in system development by efficiently analyzing source code, extracting necessary information, and generating high-quality specifications. A system that combines the means included in the claims provides a specific method for solving a specific technical problem.

[1157] The processing flow will be explained below.

[1158] Step 1:

[1159] A user accesses the web interface from a terminal, clicks the "Choose File" button, selects a source code file from the local disk, and clicks the "Upload" button.

[1160] Step 2:

[1161] The server receives the uploaded source code file and stores it in a temporary storage area. It verifies the file format and content to ensure there are no problems.

[1162] Step 3:

[1163] The server launches the generative model, which begins analyzing the source code using natural language processing (NLP) techniques.

[1164] Step 4:

[1165] The generative model extracts comments in the source code, specifically by detecting comment blocks in the code and associating them with the corresponding code blocks.

[1166] Step 5:

[1167] The generative model extracts variable names and data types, identifies variable declarations in the program, and determines what data type the variables are.

[1168] Step 6:

[1169] The generative model extracts function names and arguments by detecting function definitions in the code and analyzing the function name, its arguments, and the return value information.

[1170] Step 7:

[1171] The generative model extracts control structures, detecting conditional branches (if statements, switch statements, etc.) and loop structures (for statements, while statements, etc.) and analyzing their flow.

[1172] Step 8:

[1173] The generative model extracts test cases, identifying and organizing unit and integration tests defined in the source code.

[1174] Step 9:

[1175] The server automatically generates a specification written in natural language based on the information extracted from the generative model, which includes an overview of the entire system and detailed descriptions of each element.

[1176] Step 10:

[1177] The server saves the generated specification, and after saving is complete, it generates a download link and provides it to the user.

[1178] Step 11:

[1179] The user clicks on the download link provided by the server to download the generated specification, save it locally, and share it with the project team and stakeholders.

[1180] Example 1

[1181] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."

[1182] Creating and updating system specifications during system construction and modification requires a significant amount of man-hours and time. Furthermore, creating specifications manually is prone to errors and omissions, resulting in a decline in quality. Therefore, there is a need for an efficient, automated method for creating high-quality specifications.

[1183] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.

[1184] In this invention, the server includes means for receiving source code, means for saving the received source code in a temporary storage area, means for launching a generative AI model for analyzing the received source code, means for setting a prompt statement in the generative AI model and instructing it to analyze the source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative AI model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications as a file, and means for generating and providing a download link for the saved specifications. This automates the creation and updating of specifications, reducing labor costs and enabling the provision of high-quality specifications.

[1185] "Source code" refers to the text files of a computer program written by a developer to design and implement the program.

[1186] The "temporary storage area" is a storage area for temporarily storing received data.

[1187] A "generative AI model" is a machine learning model that performs natural language processing based on given input data (prompts).

[1188] A "prompt sentence" is a text sentence that is input to a generative AI model to instruct it to analyze or generate something.

[1189] "Comments" are annotations or explanations written in source code to clarify the behavior and intent of the code.

[1190] A "variable name" is an identifier used to store data within a program.

[1191] A "function name" is an identifier of a code block defined to perform a specific process.

[1192] A "control structure" is a syntax for controlling the execution flow of a program, and includes conditional branches and loops.

[1193] A "test case" is a specific test condition or procedure that is executed to verify the functionality or performance of a program.

[1194] A "specification" is a document that clearly states the functions, structure, and operation of a system, and is intended for reference by developers and users.

[1195] "Download Link" means a URL provided to download a file over the Internet.

[1196] The present invention is a system that analyzes source code and automatically generates specifications. This system includes a process for uploading source code from a terminal to a server and generating specifications by analyzing the source code. This process utilizes a generative AI model to extract comments, variable names, function names, control structures, and test cases, and creates specifications written in natural language based on the extracted content.

[1197] Hardware and software used

[1198] The system is implemented using the following hardware and software.

[1199] Device: A device such as a computer or smartphone operated by a user.

[1200] Server: A high-performance computer for receiving, analyzing, generating specifications, and storing source code. Here, we will assume a virtual server of a typical cloud service.

[1201] Generative AI model: A natural language processing model that analyzes source code and generates specifications in natural language. For example, the GPT series of models.

[1202] Web Interface: A web page where users can upload their source code, built using HTML, CSS, and JavaScript.

[1203] Specific actions

[1204] The user accesses the web interface from the terminal and uploads the source code. To do so, the user clicks the "Select File" button, selects a file from the local disk, and then clicks the "Upload" button. The source code sent from the terminal is stored in a temporary storage area on the server.

[1205] Next, the server launches the generative AI model to analyze the saved source code, with the following prompt:

[1206] Analyze the following source code and generate a specification.

[1207] The prompt statement is then added to the source code and input to the generative AI model, which then analyzes the given prompt statement and source code to identify and extract comments, variable names, function names, control structures, and test cases.

[1208] The generative AI model then uses the extracted information to automatically generate a specification in natural language, which includes a system overview, detailed descriptions of each function, a list of variables, a description of the control flow, and test cases. For example, if a user uploads the following Python code:

[1209] python

[1210] Function: Double a number

[1211] def double_number(x):

[1212] """

[1213] A function that doubles a number

[1214] argument:

[1215] x: an integer or floating point number

[1216] Returns:

[1217] twice the value of x

[1218] """

[1219] return x 2

[1220] Unit Testing

[1221] assert double_number(2) == 4

[1222] double assert_number(1.5) == 3.0

[1223] The server parses this source code and generates a specification like this:

[1224] System Specifications

[1225] overview

[1226] The system includes a function that doubles an input number and its unit test.

[1227] Function Details

[1228] double_number

[1229] Description: Doubles the given number.

[1230] argument:

[1231] x: an integer or floating point number

[1232] Returns:

[1233] twice the value of x

[1234] Control Structures

[1235] It does not include conditional branches or loop structures.

[1236] Test Cases

[1237] assert double_number(2) == 4

[1238] double assert_number(1.5) == 3.0

[1239] The generated specification is stored in the server's storage and then provided to the user as a download link, via which the user can download the specification and save it locally.

[1240] In this way, the system of the present invention automates the process from uploading source code to analysis, specification generation, and final downloading, thereby enabling the efficient provision of high-quality specifications.

[1241] The flow of the identification process in the first embodiment will be described with reference to FIG.

[1242] Step 1:

[1243] Uploading source code

[1244] The user opens the web interface on the terminal, clicks the "Choose File" button to select a source code file from the local disk, and then clicks the "Upload" button. As input, there is the source code file selected by the user. As output, the selected file is sent to the server.

[1245] Step 2:

[1246] Receiving and storing source code

[1247] The server receives the source code sent by the user and saves it in a temporary storage area. As input, the server receives an HTTP POST request. As output, the source code is saved in a temporary storage area (e.g., the / tmp directory). The server uses a framework such as Python or Flask to retrieve and save the file using request.files['file'].

[1248] Step 3:

[1249] Launching a generative AI model

[1250] The server launches the generative AI model to analyze the saved source code file. As input, it takes the path of the saved source code and a prompt. As output, it launches the generative AI model and starts the analysis process. The specific prompt is as follows:

[1251] Analyze the following source code and generate a specification.

[1252] Step 4:

[1253] Source code analysis

[1254] The generative AI model performs analysis based on the given prompt and source code. As input, the prompt followed by the source code content is provided. As output, comments, variable names, function names, control structures, and test cases are extracted from the source code. The generative AI model identifies and classifies these elements.

[1255] Step 5:

[1256] Generate specifications

[1257] The server uses a generative AI model based on the extracted information to automatically generate specifications written in natural language. The analyzed source code information is provided as input. The output is a specification that includes a system overview, function details, a list of variables, control flow, and test case content. For example, it includes the following content:

[1258] System Specifications

[1259] overview

[1260] The system includes a function that doubles an input number and its unit test.

[1261] Function Details

[1262] double_number

[1263] Description: Doubles the given number.

[1264] argument:

[1265] x: an integer or floating point number

[1266] Returns:

[1267] twice the value of x

[1268] Control Structures

[1269] It does not include conditional branches or loop structures.

[1270] Test Cases

[1271] assert double_number(2) == 4

[1272] double assert_number(1.5) == 3.0

[1273] Step 6:

[1274] Storing and providing specifications

[1275] The server saves the generated specification as a file. As input, the content of the generated specification is provided. As output, the specification file is saved and its path is determined. For example, it is saved as example_spec.md in the / docs directory. Once saving is complete, the server generates a download link and provides it to the user through the web interface. The user can click the link to download the specification and save it locally.

[1276] (Application example 1)

[1277] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."

[1278] Creating specifications for conventional factory robots required a great deal of man-hours and specialized knowledge, and the accuracy and consistency of the resulting specifications were an issue. Furthermore, the more complex the robot's movements, the more work it required to update the specifications, leading to inefficiencies in actual operation. Furthermore, discrepancies often occurred between the actual source code and the specifications, requiring time and effort during troubleshooting and maintenance. A system that could solve these issues and automatically generate high-quality, consistent specifications was needed.

[1279] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.

[1280] In this invention, the server includes means for receiving source code, means for activating a generative model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications and providing a download link, means for uploading photos of the source code using a smart device, and means for generating specifications from the photos of the source code. This makes it possible to grasp the robot's operation in detail and quickly generate high-quality specifications.

[1281] "Source code" is code that describes a program, in a form before it is converted into a computer-executable form.

[1282] "Means for receiving" refers to a device or mechanism capable of obtaining data or information through a network or interface.

[1283] A "generative model for analysis" is a model trained by artificial intelligence or machine learning that is used to analyze given input data, especially source code, and understand its structure and content.

[1284] A "comment" is an explanation or annotation written in source code that does not affect the operation of the program but makes it easier for programmers and administrators to understand and maintain the code.

[1285] A "variable name" is a label or name used to identify specific data or values ​​within a program.

[1286] A "function name" is a name or label that identifies a block of code that performs a particular operation or procedure.

[1287] A "control structure" is a syntax element for controlling the flow and execution order of a program, and includes conditional branching and repetitive processing.

[1288] A "test case" is a set of specific inputs and expected outputs designed to verify whether a program or system works correctly.

[1289] A "specification written in natural language" is a document that describes the structure and operation of a program in a format that humans can understand.

[1290] A "smart device" is a portable electronic device such as a smartphone or tablet that has advanced computing and communication capabilities.

[1291] A "means for uploading photos" is a mechanism that has the function of sending and storing image data on a server or cloud.

[1292] A "means for generating specifications" is a mechanism that has the ability to automatically create detailed descriptions of a program or system based on given data or information.

[1293] This invention is a system that automatically generates robot operation specifications by photographing and uploading the source code of a factory robot. The system of this invention is realized by combining a server, smart devices, and software.

[1294] System Overview

[1295] Users use a smart device (such as a smartphone or tablet) to take a photo of the factory robot's source code and upload the photo or file to the server through the interface. The server analyzes the received data and activates a generative AI model to extract the necessary information from the source code. The generative AI model uses natural language processing technology to identify and extract comments, variable names, function names, control structures, and test cases. It then automatically generates a specification document written in natural language based on the extracted information. The final generated specification document is stored on the server, and users can obtain it via a download link.

[1296] Hardware and software used

[1297] Server: The computer system that receives the data and runs the generative AI model.

[1298] Smart Device: A device (smartphone, tablet, etc.) for taking photos of and uploading source code.

[1299] Generative AI model: A model that uses natural language processing techniques such as the OpenAI API.

[1300] Interface: A web application (using the Flask framework, for example) that manages the exchange of data between the user and the server.

[1301] Program processing explanation

[1302] The server receives the source code uploaded by the user through the interface and stores it in a temporary storage area. The server then launches a generative AI model (e.g., OpenAI API) to begin analyzing the received source code. During this analysis process, comments, variable names, function names, control structures, and test cases within the source code are identified and extracted. A specification written in natural language is then generated based on the extracted information. The generated specification is stored on the server, and the user can obtain it via a download link.

[1303] Examples and prompts

[1304] Here is the Python code that a user might upload as an example:

[1305] Upload Code:

[1306] python

[1307] Functions that control the robot's behavior

[1308] def control_robot(action):

[1309] """

[1310] Functions that control the robot's behavior

[1311] argument:

[1312] action: Action command (str)

[1313] Returns:

[1314] Operation result (str)

[1315] """

[1316] if action == "forward":

[1317] return "The robot moves forward"

[1318] elif action == "backward":

[1319] return "Robot retreats"

[1320] else:

[1321] return "Invalid command"

[1322] Example of generated prompt:

[1323] Generate a specification from the following source code:

[1324] python

[1325] Functions that control the robot's behavior

[1326] def control_robot(action):

[1327] """

[1328] Functions that control the robot's behavior

[1329] argument:

[1330] action: Action command (str)

[1331] Returns:

[1332] Operation result (str)

[1333] """

[1334] if action == "forward":

[1335] return "The robot moves forward"

[1336] elif action == "backward":

[1337] return "Robot retreats"

[1338] else:

[1339] return "Invalid command"

[1340] This system makes it possible to grasp the details of factory robot operations and quickly generate high-quality specifications, thereby reducing man-hours and improving the quality of specifications.

[1341] The flow of the specific processing in the application example 1 will be described with reference to FIG.

[1342] Step 1:

[1343] A user takes a photo of the source code or selects a source code file using a smart device. The photo or selected file is uploaded to the server through the interface. The input of this step is the source code image or file. The output is the image data or file data transferred to the server.

[1344] Step 2:

[1345] The server receives the uploaded image data or file data and stores it in a temporary storage area. The input of this step is the image data or file data sent by the user. The output is the data stored in the temporary storage area.

[1346] Step 3:

[1347] The server identifies the format of the received data (image or file) and performs appropriate preprocessing. If it is image data, it uses OCR (Optical Character Recognition) technology to extract text from the image. If it is file data, it uses it as text. The input at this stage is image data or file data from a temporary storage area. The output is source code in text format.

[1348] Step 4:

[1349] The server launches the generative AI model and inputs the textual source code into the model. The generative AI model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases. The input of this stage is the textual source code. The output is a set of extracted information.

[1350] Step 5:

[1351] The server uses a generative AI model to automatically generate a specification written in natural language based on the extracted information. The input to this stage is the set of extracted information. The output is a specification written in natural language.

[1352] Step 6:

[1353] The server stores the generated specification and generates a download link that users can access. The input to this stage is a specification written in natural language. The output is a download link to the location where the specification is stored.

[1354] Step 7:

[1355] The user accesses the download link through the interface and downloads the generated specification. The input of this step is the download link. The output is the locally saved specification.

[1356] This series of steps allows users to efficiently generate high-quality specifications.

[1357] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.

[1358] The present invention provides a system that automates the creation and updating of system specifications during system construction and modification, reducing the number of steps and providing high-quality specifications. The present invention also includes an emotion engine that recognizes a user's emotions and provides feedback based on the results. Embodiments of the present invention are described in detail below.

[1359] System Overview

[1360] The system analysis process begins when a user uploads source code from their device to the server via an interface. The server then launches a generative model to analyze the received source code. The generative model extracts comments, variable names, function names, control structures, and test cases from the source code, and automatically generates a specification document written in natural language based on the extracted information. The generated specification document is stored on the server, and a download link is provided.

[1361] The emotion engine uses sensor data and input information to recognize the user's emotions, analyzes the user's emotional state, and provides appropriate feedback to the user according to the analysis results and the contents of the generated specifications.

[1362] Program processing

[1363] The user uploads the source code on the terminal. For example, the user clicks the "Select File" button on the web interface, selects the source code file from the local disk, and clicks the "Upload" button. The server receives the uploaded source code and stores it in a temporary storage area.

[1364] The server then launches a generative model, which uses natural language processing (NLP) techniques to analyze the source code and extract the necessary information: specifically, it identifies and extracts comment content, variable names and data types, function names and arguments, control structures, and test cases.

[1365] Based on the extracted information, the server uses a generative model to automatically generate a specification written in natural language, which includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and test case content.

[1366] The emotion engine recognizes the user's emotional state by analyzing the user's facial expression, tone of voice, typing pace, etc. For example, if the user types at a faster pace than usual or their facial expression becomes grim, the emotion engine will determine that the user is feeling stressed.

[1367] Based on the analysis results of the emotion engine, the server provides feedback to the user. For example, it can display a message such as "Please relax" based on the analysis results, or automatically generate an explanation to supplement the contents of the specification.

[1368] Finally, the server saves the generated specification. Once the saving is complete, the server generates a download link and provides it to the user. The user can click the link to download the specification and save it locally. In addition, the emotion engine's feedback can reduce the user's stress and improve work efficiency.

[1369] Specific examples

[1370] For example, if a user uploads the following Python code:

[1371] python

[1372] Function: Double a number

[1373] def double_number(x):

[1374] """

[1375] A function that doubles a number

[1376] argument:

[1377] x: an integer or floating point number

[1378] Returns:

[1379] twice the value of x

[1380] """

[1381] return x 2

[1382] Unit Testing

[1383] assert double_number(2) == 4

[1384] double assert_number(1.5) == 3.0

[1385] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, and test cases from the code, and generates a specification that looks like this:

[1386] System Specifications

[1387] overview

[1388] The system includes a function that doubles an input number and its unit test.

[1389] Function Details

[1390] double_number

[1391] Description: Doubles the given number.

[1392] argument:

[1393] x: an integer or floating point number

[1394] Returns:

[1395] twice the value of x

[1396] Control Structures

[1397] It does not include conditional branches or loop structures.

[1398] Test Cases

[1399] assert double_number(2) == 4

[1400] double assert_number(1.5) == 3.0

[1401] This specification provides detailed explanations of function behavior and test content, making it easy for users and programmers to understand, and providing high-quality documentation that is free of any omissions or omissions.

[1402] If the emotion engine analyzes the user's facial expressions and input pace and detects that the user is feeling stressed, it can display a message such as "Please relax," thereby improving the user's work efficiency and mental comfort. In this way, by combining emotion engines, a system can be realized that provides appropriate feedback according to the user's emotional state.

[1403] In this way, the system of the present invention not only efficiently analyzes source code, extracts necessary information, and generates high-quality specifications, but also recognizes user emotions and provides appropriate feedback, thereby significantly reducing the labor hours and risks involved in system development.

[1404] The processing flow will be explained below.

[1405] Step 1:

[1406] A user accesses the web interface from a terminal, clicks the "Choose File" button, selects a source code file from the local disk, and clicks the "Upload" button.

[1407] Step 2:

[1408] The server receives the uploaded source code file and stores it in a temporary storage area. It verifies the file format and content to ensure there are no problems.

[1409] Step 3:

[1410] The server launches the generative model, which begins analyzing the source code using natural language processing (NLP) techniques.

[1411] Step 4:

[1412] The generative model extracts comments in the source code, specifically by detecting comment blocks in the code and associating them with the corresponding code blocks.

[1413] Step 5:

[1414] The generative model extracts variable names and data types, identifies variable declarations in the program, and determines what data type the variables are.

[1415] Step 6:

[1416] The generative model extracts function names and arguments by detecting function definitions in the code and analyzing the function name, its arguments, and the return value information.

[1417] Step 7:

[1418] The generative model extracts control structures, detecting conditional branches (if statements, switch statements, etc.) and loop structures (for statements, while statements, etc.) and analyzing their flow.

[1419] Step 8:

[1420] The generative model extracts test cases, identifying and organizing unit and integration tests defined in the source code.

[1421] Step 9:

[1422] The server automatically generates a specification written in natural language based on the information extracted from the generative model, which includes an overview of the entire system and detailed descriptions of each element.

[1423] Step 10:

[1424] The server uses an emotion engine to analyze the user's emotions, specifically by analyzing the user's facial expressions, tone of voice, and typing pace to recognize the user's emotional state.

[1425] Step 11:

[1426] Based on the analysis results of the emotion engine, the server provides feedback to the user. For example, if the user is feeling stressed, a message encouraging them to relax is displayed.

[1427] Step 12:

[1428] The server saves the generated specification, and after saving is complete, it generates a download link and provides it to the user.

[1429] Step 13:

[1430] The user clicks on the download link provided by the server to download the generated specification, save it locally, and share it with the project team and stakeholders.

[1431] Example 2

[1432] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."

[1433] In conventional system development, analyzing source code and creating specifications are often done manually, which is time-consuming, labor-intensive, and prone to human error. Furthermore, while the user's emotional state can affect the efficiency and quality of system development, few systems take this into account. Therefore, a system that automates analysis, efficiently generates high-quality specifications, and recognizes the user's emotions and provides appropriate feedback is needed.

[1434] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.

[1435] In this invention, the server includes means for receiving source code, means for launching a generative AI model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative AI model, means for automatically generating specifications written in natural language based on the extracted information, means for launching an emotion analysis engine that recognizes user emotions and provides feedback based on the results, and means for saving the generated specifications and providing a download link. This enables the automation of source code analysis and specification generation, and provides feedback according to the user's emotional state, enabling efficient and high-quality system development.

[1436] "Source code" is a text file that describes the behavior of a program and is the input before it is converted into a form that a computer can run.

[1437] "Means for receiving" refers to the communication functions and protocols used to transfer data from a terminal to a server and receive the data on the server side.

[1438] A "generative AI model" refers to an algorithm or program that uses machine learning and natural language processing techniques to analyze source code, extract specific information, and perform specified tasks.

[1439] A "comment" is text written in source code to add supplementary explanations without affecting the operation of the program.

[1440] A "variable name" is a named symbol for storing data within a program, and serves to hold a value in a series of operations or calculations.

[1441] A "function name" is an identifier used to call a code block that performs a specific process or calculation.

[1442] A "control structure" is a syntax for controlling the execution flow of a program, and includes conditional branches and loops.

[1443] A "test case" defines specific inputs and expected outputs to verify the functionality and behavior of a program.

[1444] A "specification written in natural language" is a document that provides a detailed explanation of the operation of a system or program in a format that is easy to understand even for people without specialized programming knowledge.

[1445] An "emotion analysis engine" is a software module for detecting a user's emotional state, analyzing data such as facial expressions, voice, and input speed to classify emotions.

[1446] "Providing feedback" means that the system provides the user with information such as analysis results, suggestions, and warnings in a timely manner.

[1447] DETAILED DESCRIPTION OF THE INVENTION The present invention provides a system for automating the creation and updating of system specifications, and for analyzing a user's emotional state and providing feedback. The following describes in detail an embodiment of the present invention.

[1448] A user uses a terminal to upload source code to the server. To do this, the user launches a browser and accesses a web interface. For example, the user clicks the "Choose File" button, selects the source code file from the local disk, and clicks the "Upload" button to send the file from the terminal to the server.

[1449] The server receives the HTTP request and saves the file data in the request in a temporary storage area. This makes the source code available for subsequent analysis steps. The server then launches a generative AI model using natural language processing (NLP) techniques. This generative AI model is an algorithm built in Python or similar language and analyzes the uploaded source code.

[1450] The generative AI model identifies and extracts comments, variable names, function names, control structures, and test cases from the source code. This information is stored as a data structure in the server's memory. The server then automatically generates a specification written in natural language based on the extracted information. This specification includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and the contents of the test cases.

[1451] The emotion analysis engine recognizes the user's emotional state by analyzing their facial expressions, tone of voice, typing pace, etc. For example, if the user types at a faster pace than usual or if the camera image shows a grim expression, the emotion analysis engine will determine that the user is feeling stressed.

[1452] Based on the analysis, the server can provide appropriate feedback to the user, for example, a message such as "Relax" can be displayed in the web interface, and comments can be provided to supplement the content of the specification, if necessary.

[1453] The server stores the final generated specification in long-term storage. Once the storage process is complete, the server generates a download link for the user and displays it on the web interface. The user can click the link to download the specification and save it to their local disk.

[1454] As a concrete example, consider the following Python code uploaded by a user:

[1455] python

[1456] Function: Double a number

[1457] def double_number(x):

[1458] """

[1459] A function that doubles a number

[1460] argument:

[1461] x: an integer or floating point number

[1462] Returns:

[1463] twice the value of x

[1464] """

[1465] return x 2

[1466] Unit Testing

[1467] assert double_number(2) == 4

[1468] double assert_number(1.5) == 3.0

[1469] The server receives this source code and begins analyzing it. A generative AI model extracts comments, function names, arguments, and test cases from the code, generating a specification that looks like this:

[1470] markdown

[1471] System Specifications

[1472] overview

[1473] The system includes a function that doubles an input number and its unit test.

[1474] Function Details

[1475] double_number

[1476] Description: Doubles the given number.

[1477] argument:

[1478] x: an integer or floating point number

[1479] Returns:

[1480] twice the value of x

[1481] Control Structures

[1482] It does not include conditional branches or loop structures.

[1483] Test Cases

[1484] assert double_number(2) == 4

[1485] double assert_number(1.5) == 3.0

[1486] The generated specifications provide detailed explanations of function behavior and test content, making it easier for engineers and programmers to understand. In this way, the system of the present invention automates a series of processes, from analyzing source code to generating specifications, and even recognizing user emotions and providing appropriate feedback, achieving highly efficient and high-quality development support.

[1487] The flow of the identification process in the second embodiment will be described with reference to FIG.

[1488] Step 1:

[1489] The user uploads the source code from the terminal to the server.

[1490] Specifically, the user launches a browser on their device, accesses the provided web interface, clicks the "Choose File" button, selects the source code file from their local disk, and then clicks the "Upload" button, which sends the source code to the server as an HTTP request.

[1491] Input: Source code files stored on your local disk

[1492] Output: Source code data sent to the server

[1493] Step 2:

[1494] The server receives the source code and stores it in a temporary storage area.

[1495] Specifically, the server receives an HTTP request, extracts the file data from it, and saves the extracted file data in a designated temporary storage area. This file is used for analysis by the generative AI model.

[1496] Input: Source code data in the HTTP request

[1497] Output: Source code file saved in temporary storage area on the server

[1498] Step 3:

[1499] The server launches the generative AI model and analyzes the source code.

[1500] Specifically, the server launches a generative AI model built in Python or similar. This model uses natural language processing (NLP) techniques to analyze source code, identifying comments, variable names, function names, control structures, and test cases, and extracting information from each.

[1501] Input: Source code files stored on the server

[1502] Output: Comments, variable names, function names, control structures, and test case information extracted by the analysis.

[1503] Step 4:

[1504] The server automatically generates specifications based on the extracted information.

[1505] Specifically, the server provides the extracted information as input to the generative AI model to generate a specification written in natural language. This specification includes an overview of the system, detailed descriptions of functions, a list of variables, a description of the control flow, and the contents of test cases. The generated specification is then saved in a temporary storage area.

[1506] Input: Comments, variable names, function names, control structures, and test case information

[1507] Output: A specification written in natural language

[1508] Step 5:

[1509] The emotion analysis engine analyzes the user's emotional state.

[1510] Specifically, the emotion analysis engine analyzes the user's facial expression data (camera input), voice data (microphone input), and typing pace (keyboard input speed) to evaluate the user's emotional state and detect, for example, stress.

[1511] Input: facial expression data, voice data, input pace

[1512] Output: Evaluated user emotional state

[1513] Step 6:

[1514] The server provides feedback based on the results of the sentiment analysis engine.

[1515] Specifically, the server displays an appropriate message on the web interface based on the results of the emotion analysis engine. For example, displaying a message such as "Please relax" can improve the user's mental comfort. It can also display supplementary explanations to the content of the specifications as needed.

[1516] Input: Evaluated emotional state of the user

[1517] Output: Feedback message to the user

[1518] Step 7:

[1519] The server saves the generated specification and generates a download link.

[1520] Specifically, the server writes the generated specification to long-term storage. Once saved, the server generates a download link and displays it on the web interface. Users can click the link to download the specification and save it to their local disk.

[1521] Input: Generated specification

[1522] Output: Download link, save specification

[1523] (Application example 2)

[1524] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."

[1525] In modern system development, manually creating source code specifications requires a significant amount of time and effort, and is prone to human error. Robot control programs, especially those used on factory production lines, are complex, making the creation and updating of specifications extremely important. However, high levels of stress and fatigue can hinder efficient work. Therefore, there is a need for an efficient system development environment that not only automatically generates specifications but also monitors the emotional state of workers and provides appropriate feedback.

[1526] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 2 is realized by the following means.

[1527] In this invention, the server includes means for receiving source code, means for activating a generative model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications and providing a download link, means for activating an emotion engine for recognizing the emotional state of a worker and providing feedback, means for analyzing sensor data such as facial expressions, voice, and input speed using the emotion engine, and means for providing appropriate feedback to the worker based on the analysis results. This enables both the automatic generation of specifications and feedback according to the worker's emotional state, thereby realizing efficient and high-quality system construction.

[1528] The "means for receiving source code" is a function that allows a user to upload source code to the system and have the code received by the server.

[1529] "Means for launching a generative model" refers to a function for running an AI model or machine learning model to analyze received source code.

[1530] "Means for extracting comments, variable names, function names, control structures, and test cases from source code" refers to a function for automatically identifying and extracting annotations, variable names, function names, control flow structures, and test cases from source code.

[1531] "Means for automatically generating specifications written in natural language" is a function for automatically creating documents in a format that is easy for humans to understand, based on extracted information.

[1532] The "means for saving the generated specifications and providing a download link" is a function for saving the automatically generated specifications on a server and providing a link that allows the user to download the specifications.

[1533] The "means for activating an emotion engine to recognize the worker's emotional state and provide feedback" is a function for acquiring sensor data necessary to recognize the user's emotions and executing an engine that processes the data.

[1534] "Means for analyzing sensor data such as facial expressions, voice, and input speed" is a function that collects information such as a worker's facial expressions, voice changes, and keystroke speed, and analyzes them to determine their emotional state.

[1535] "Means for providing appropriate feedback to workers based on the analysis results" is a function for providing feedback and suggestions to relieve workers' stress and fatigue based on the results of the emotion engine.

[1536] This invention is a system that efficiently analyzes robot control programs for factory production lines and automatically generates specifications. It also monitors the emotional state of workers and provides appropriate feedback to improve work efficiency and quality. Specific embodiments for implementing this invention are described below.

[1537] System configuration

[1538] The system mainly consists of the following components:

[1539] 1. Server

[1540] 2. Terminal

[1541] 3. Emotion Engine

[1542] 4. Generative Model

[1543] What the program does

[1544] The server has a means for receiving source code sent by users. The process begins when a user selects and uploads source code from a web interface via their terminal. Once the source code is received by the server, it is stored in a temporary storage area.

[1545] The server then launches a generative model, which analyzes and extracts comments, variable names, function names, control structures, and test cases from the source code. Using natural language processing (NLP) techniques, the analysis automatically generates a specification written in natural language based on the extracted information. The specification is then stored on the server, and a download link is provided for users to download.

[1546] The server then activates an emotion engine, which analyzes the worker's emotional state using sensor data such as the user's facial expressions, voice, and input speed. Based on the analysis results, the server provides appropriate feedback to the worker. If the emotion engine detects stress or fatigue based on the sensor information, it displays a message such as "Please relax."

[1547] Hardware and software used

[1548] Server: a high-performance computer system

[1549] Device: The computer or tablet used by the user

[1550] Generative Model: A generative AI model that uses natural language processing (NLP) techniques

[1551] Emotion engine: Software that performs facial expression recognition, voice analysis, and keystroke analysis

[1552] Specific examples

[1553] Suppose a user uploads the following Python code from their terminal:

[1554] python

[1555] Robot arm initialization function

[1556] def initialize_arm():

[1557] """

[1558] A function to initialize the robot arm

[1559] """

[1560] print("Initializing arm.")

[1561] A function to move the arm to a specific position

[1562] def move_arm_to_position(position):

[1563] """

[1564] A function that moves the robot arm to a specified position.

[1565] argument:

[1566] position: target position of the arm

[1567] """

[1568] print(f"Moving arm to {position}")

[1569] Unit Testing

[1570] initialize_arm()

[1571] move_arm_to_position('home')

[1572] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, etc. from the code and generates a specification document like this:

[1573] System Specifications

[1574] overview

[1575] The system includes functionality to initialize and move the robotic arm to a specific position.

[1576] Function Details

[1577] initialize_arm

[1578] Description: Initializes the robot arm.

[1579] Arguments: None

[1580] move_arm_to_position

[1581] Description: Moves the robot arm to the specified position.

[1582] argument:

[1583] position: target position of the arm

[1584] Test Cases

[1585] initialize_arm()

[1586] move_arm_to_position('home')

[1587] Furthermore, if the user types information into the system too quickly or their facial expression becomes grim, the emotion engine will determine that the user is feeling stressed. Based on the analysis results, the server will display messages such as "Please relax" to reduce the worker's stress.

[1588] Prompt Sentence Examples

[1589] The prompt is fed to the generative AI model in the following format:

[1590] Parse the following Python code and generate its specification:

[1591] Robot arm initialization function

[1592] def initialize_arm():

[1593] """

[1594] A function to initialize the robot arm

[1595] """

[1596] print("Initializing arm.")

[1597] A function to move the arm to a specific position

[1598] def move_arm_to_position(position):

[1599] """

[1600] A function that moves the robot arm to a specified position.

[1601] argument:

[1602] position: target position of the arm

[1603] """

[1604] print(f"Moving arm to {position}")

[1605] Unit Testing

[1606] initialize_arm()

[1607] move_arm_to_position('home')

[1608] This prompt allows the generative model to extract the necessary information and generate a high-quality specification.

[1609] The flow of the specific processing in the application example 2 will be described with reference to FIG.

[1610] Step 1:

[1611] The user uploads the source code.

[1612] The user uses the terminal and clicks the "Choose File" button in the web interface to select the source code file from the local disk and then clicks the "Upload" button. The input is the source code file, and the output is that this source code is sent to the server.

[1613] Step 2:

[1614] The server receives the source code and stores it in a temporary storage area.

[1615] The server receives the submitted source code file and saves it in the server's temporary storage area (e.g., a specified temporary directory). The input is the source code file submitted by the user, and the output is the path of the saved source code file.

[1616] Step 3:

[1617] The server launches the generative model.

[1618] The server passes the path of the saved source code file to the generative model and launches the model. The input is the path of the source code file, and the output is the generative model ready for analysis.

[1619] Step 4:

[1620] A generative model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases.

[1621] The generative model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases written in the code. The input is the content of the source code file, and the output is each analyzed element (comments, variable names, function names, control structures, and test cases).

[1622] Step 5:

[1623] The server generates a specification based on the extracted information.

[1624] The server uses the analysis results obtained from the generative model to automatically generate specifications written in natural language. The input is the analysis results, and the output is the generated specification.

[1625] Step 6:

[1626] The server stores the generated specification and provides a download link.

[1627] The server stores the generated specification and creates and provides a link for users to download the specification. The input is the generated specification and the output is the download link.

[1628] Step 7:

[1629] The server starts the emotion engine.

[1630] The server invokes the emotion engine to recognize the user's emotional state. The input is the invocation command and the output is the running emotion engine.

[1631] Step 8:

[1632] The emotion engine analyzes sensor data such as facial expressions, voice, and input speed.

[1633] The emotion engine analyzes sensor data such as facial expressions, voice, and typing speed to measure the user's emotional state. The input is the sensor data, and the output is the analyzed emotional state.

[1634] Step 9:

[1635] The server provides appropriate feedback to the user based on the analysis results.

[1636] The server displays appropriate feedback to the user based on the analysis results of the emotion engine, for example, a message such as "Please relax." The input is the analyzed emotional state, and the output is the feedback message.

[1637] The specific processing unit 290 transmits the result of the specific processing to the headset type terminal 314. In the headset type terminal 314, the control unit 46A causes the speaker 240 and the display 343 to output the result of the specific processing. The microphone 238 acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.

[1638] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.

[1639] In the above embodiment, an example was given in which the specific processing is performed by the data processing device 12, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the headset type terminal 314.

[1640] [Fourth embodiment]

[1641] FIG. 7 shows an example of the configuration of a data processing system 410 according to the fourth embodiment.

[1642] 7, a data processing system 410 includes a data processing device 12 and a robot 414. An example of the data processing device 12 is a server.

[1643] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).

[1644] The robot 414 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a control target 443. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, the camera 42, and the control target 443 are also connected to the bus 52.

[1645] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.

[1646] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).

[1647] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 are responsible for the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.

[1648] The control object 443 includes a display device, LEDs in the eyes, and motors for driving the arms, hands, and feet. The posture and gestures of the robot 414 are controlled by controlling the motors of the arms, hands, and feet. Some of the emotions of the robot 414 can be expressed by controlling these motors. In addition, the facial expressions of the robot 414 can also be expressed by controlling the light emission state of the LEDs in the eyes of the robot 414.

[1649] Fig. 8 shows an example of the main functions of the data processing device 12 and the robot 414. As shown in Fig. 8, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.

[1650] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.

[1651] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.

[1652] In the robot 414, the processor 46 performs the reception output process. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.

[1653] Next, a description will be given of the specific processing performed by the specific processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."

[1654] The present invention provides a system that automates the creation and updating of system specifications during system construction and modification, reducing the number of processes and providing high-quality specifications. This system includes means for receiving and analyzing source code and generating specifications in natural language. An embodiment of the system is described in detail below.

[1655] System Overview

[1656] The system's analysis process begins when a user uploads source code from their device to the server via an interface. The server then launches a generative model to analyze the received source code. The generative model then extracts comments, variable names, function names, control structures, and test cases from the source code, and automatically generates a specification written in natural language based on the extracted information. The generated specification is stored on the server, and users can download it by providing a download link.

[1657] Program processing

[1658] On the terminal, the user uploads the source code. For example, the user clicks the "Select File" button on the web interface, selects the source code file from the local disk, and clicks the "Upload" button. The server receives the uploaded source code and stores it in a temporary storage area.

[1659] The server then launches a generative model, which uses natural language processing (NLP) techniques to analyze the source code and extract the necessary information: specifically, it identifies and extracts comment content, variable names and data types, function names and arguments, control structures, and test cases.

[1660] Based on the extracted information, the server uses a generative model to automatically generate a specification written in natural language, which includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and test case content.

[1661] Finally, the server saves the generated specification. Once the saving is complete, the server generates a download link and provides it to the user. The user can click the link to download the specification and save it locally.

[1662] Specific examples

[1663] For example, if a user uploads the following Python code:

[1664] python

[1665] Function: Double a number

[1666] def double_number(x):

[1667] """

[1668] A function that doubles a number

[1669] argument:

[1670] x: an integer or floating point number

[1671] Returns:

[1672] twice the value of x

[1673] """

[1674] return x 2

[1675] Unit Testing

[1676] assert double_number(2) == 4

[1677] double assert_number(1.5) == 3.0

[1678] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, and test cases from the code, and generates a specification that looks like this:

[1679] System Specifications

[1680] overview

[1681] The system includes a function that doubles an input number and its unit test.

[1682] Function Details

[1683] double_number

[1684] Description: Doubles the given number.

[1685] argument:

[1686] x: an integer or floating point number

[1687] Returns:

[1688] twice the value of x

[1689] Control Structures

[1690] It does not include conditional branches or loop structures.

[1691] Test Cases

[1692] assert double_number(2) == 4

[1693] double assert_number(1.5) == 3.0

[1694] This specification provides detailed explanations of function behavior and test content, making it easy for users and programmers to understand, and providing high-quality documentation that is free of any omissions or omissions.

[1695] In this way, the system of the present invention can significantly reduce the man-hours and risks involved in system development by efficiently analyzing source code, extracting necessary information, and generating high-quality specifications. A system that combines the means included in the claims provides a specific method for solving a specific technical problem.

[1696] The processing flow will be explained below.

[1697] Step 1:

[1698] A user accesses the web interface from a terminal, clicks the "Choose File" button, selects a source code file from the local disk, and clicks the "Upload" button.

[1699] Step 2:

[1700] The server receives the uploaded source code file and stores it in a temporary storage area. It verifies the file format and content to ensure there are no problems.

[1701] Step 3:

[1702] The server launches the generative model, which begins analyzing the source code using natural language processing (NLP) techniques.

[1703] Step 4:

[1704] The generative model extracts comments in the source code, specifically by detecting comment blocks in the code and associating them with the corresponding code blocks.

[1705] Step 5:

[1706] The generative model extracts variable names and data types, identifies variable declarations in the program, and determines what data type the variables are.

[1707] Step 6:

[1708] The generative model extracts function names and arguments by detecting function definitions in the code and analyzing the function name, its arguments, and the return value information.

[1709] Step 7:

[1710] The generative model extracts control structures, detecting conditional branches (if statements, switch statements, etc.) and loop structures (for statements, while statements, etc.) and analyzing their flow.

[1711] Step 8:

[1712] The generative model extracts test cases, identifying and organizing unit and integration tests defined in the source code.

[1713] Step 9:

[1714] The server automatically generates a specification written in natural language based on the information extracted from the generative model, which includes an overview of the entire system and detailed descriptions of each element.

[1715] Step 10:

[1716] The server saves the generated specification, and after saving is complete, it generates a download link and provides it to the user.

[1717] Step 11:

[1718] The user clicks on the download link provided by the server to download the generated specification, save it locally, and share it with the project team and stakeholders.

[1719] Example 1

[1720] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."

[1721] Creating and updating system specifications during system construction and modification requires a significant amount of man-hours and time. Furthermore, creating specifications manually is prone to errors and omissions, resulting in a decline in quality. Therefore, there is a need for an efficient, automated method for creating high-quality specifications.

[1722] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.

[1723] In this invention, the server includes means for receiving source code, means for saving the received source code in a temporary storage area, means for launching a generative AI model for analyzing the received source code, means for setting a prompt statement in the generative AI model and instructing it to analyze the source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative AI model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications as a file, and means for generating and providing a download link for the saved specifications. This automates the creation and updating of specifications, reducing labor costs and enabling the provision of high-quality specifications.

[1724] "Source code" refers to the text files of a computer program written by a developer to design and implement the program.

[1725] The "temporary storage area" is a storage area for temporarily storing received data.

[1726] A "generative AI model" is a machine learning model that performs natural language processing based on given input data (prompts).

[1727] A "prompt sentence" is a text sentence that is input to a generative AI model to instruct it to analyze or generate something.

[1728] "Comments" are annotations or explanations written in source code to clarify the behavior and intent of the code.

[1729] A "variable name" is an identifier used to store data within a program.

[1730] A "function name" is an identifier of a code block defined to perform a specific process.

[1731] A "control structure" is a syntax for controlling the execution flow of a program, and includes conditional branches and loops.

[1732] A "test case" is a specific test condition or procedure that is executed to verify the functionality or performance of a program.

[1733] A "specification" is a document that clearly states the functions, structure, and operation of a system, and is intended for reference by developers and users.

[1734] "Download Link" means a URL provided to download a file over the Internet.

[1735] The present invention is a system that analyzes source code and automatically generates specifications. This system includes a process for uploading source code from a terminal to a server and generating specifications by analyzing the source code. This process utilizes a generative AI model to extract comments, variable names, function names, control structures, and test cases, and creates specifications written in natural language based on the extracted content.

[1736] Hardware and software used

[1737] The system is implemented using the following hardware and software.

[1738] Device: A device such as a computer or smartphone operated by a user.

[1739] Server: A high-performance computer for receiving, analyzing, generating specifications, and storing source code. Here, we will assume a virtual server of a typical cloud service.

[1740] Generative AI model: A natural language processing model that analyzes source code and generates specifications in natural language. For example, the GPT series of models.

[1741] Web Interface: A web page where users can upload their source code, built using HTML, CSS, and JavaScript.

[1742] Specific actions

[1743] The user accesses the web interface from the terminal and uploads the source code. To do so, the user clicks the "Select File" button, selects a file from the local disk, and then clicks the "Upload" button. The source code sent from the terminal is stored in a temporary storage area on the server.

[1744] Next, the server launches the generative AI model to analyze the saved source code, with the following prompt:

[1745] Analyze the following source code and generate a specification.

[1746] The prompt statement is then added to the source code and input to the generative AI model, which then analyzes the given prompt statement and source code to identify and extract comments, variable names, function names, control structures, and test cases.

[1747] The generative AI model then uses the extracted information to automatically generate a specification in natural language, which includes a system overview, detailed descriptions of each function, a list of variables, a description of the control flow, and test cases. For example, if a user uploads the following Python code:

[1748] python

[1749] Function: Double a number

[1750] def double_number(x):

[1751] """

[1752] A function that doubles a number

[1753] argument:

[1754] x: an integer or floating point number

[1755] Returns:

[1756] twice the value of x

[1757] """

[1758] return x 2

[1759] Unit Testing

[1760] assert double_number(2) == 4

[1761] double assert_number(1.5) == 3.0

[1762] The server parses this source code and generates a specification like this:

[1763] System Specifications

[1764] overview

[1765] The system includes a function that doubles an input number and its unit test.

[1766] Function Details

[1767] double_number

[1768] Description: Doubles the given number.

[1769] argument:

[1770] x: an integer or floating point number

[1771] Returns:

[1772] twice the value of x

[1773] Control Structures

[1774] It does not include conditional branches or loop structures.

[1775] Test Cases

[1776] assert double_number(2) == 4

[1777] double assert_number(1.5) == 3.0

[1778] The generated specification is stored in the server's storage and then provided to the user as a download link, via which the user can download the specification and save it locally.

[1779] In this way, the system of the present invention automates the process from uploading source code to analysis, specification generation, and final downloading, thereby enabling the efficient provision of high-quality specifications.

[1780] The flow of the identification process in the first embodiment will be described with reference to FIG.

[1781] Step 1:

[1782] Uploading source code

[1783] The user opens the web interface on the terminal, clicks the "Choose File" button to select a source code file from the local disk, and then clicks the "Upload" button. As input, there is the source code file selected by the user. As output, the selected file is sent to the server.

[1784] Step 2:

[1785] Receiving and storing source code

[1786] The server receives the source code sent by the user and saves it in a temporary storage area. As input, the server receives an HTTP POST request. As output, the source code is saved in a temporary storage area (e.g., the / tmp directory). The server uses a framework such as Python or Flask to retrieve and save the file using request.files['file'].

[1787] Step 3:

[1788] Launching a generative AI model

[1789] The server launches the generative AI model to analyze the saved source code file. As input, it takes the path of the saved source code and a prompt. As output, it launches the generative AI model and starts the analysis process. The specific prompt is as follows:

[1790] Analyze the following source code and generate a specification.

[1791] Step 4:

[1792] Source code analysis

[1793] The generative AI model performs analysis based on the given prompt and source code. As input, the prompt followed by the source code content is provided. As output, comments, variable names, function names, control structures, and test cases are extracted from the source code. The generative AI model identifies and classifies these elements.

[1794] Step 5:

[1795] Generate specifications

[1796] The server uses a generative AI model based on the extracted information to automatically generate specifications written in natural language. The analyzed source code information is provided as input. The output is a specification that includes a system overview, function details, a list of variables, control flow, and test case content. For example, it includes the following content:

[1797] System Specifications

[1798] overview

[1799] The system includes a function that doubles an input number and its unit test.

[1800] Function Details

[1801] double_number

[1802] Description: Doubles the given number.

[1803] argument:

[1804] x: an integer or floating point number

[1805] Returns:

[1806] twice the value of x

[1807] Control Structures

[1808] It does not include conditional branches or loop structures.

[1809] Test Cases

[1810] assert double_number(2) == 4

[1811] double assert_number(1.5) == 3.0

[1812] Step 6:

[1813] Storing and providing specifications

[1814] The server saves the generated specification as a file. As input, the content of the generated specification is provided. As output, the specification file is saved and its path is determined. For example, it is saved as example_spec.md in the / docs directory. Once saving is complete, the server generates a download link and provides it to the user through the web interface. The user can click the link to download the specification and save it locally.

[1815] (Application example 1)

[1816] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."

[1817] Creating specifications for conventional factory robots required a great deal of man-hours and specialized knowledge, and the accuracy and consistency of the resulting specifications were an issue. Furthermore, the more complex the robot's movements, the more work it required to update the specifications, leading to inefficiencies in actual operation. Furthermore, discrepancies often occurred between the actual source code and the specifications, requiring time and effort during troubleshooting and maintenance. A system that could solve these issues and automatically generate high-quality, consistent specifications was needed.

[1818] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.

[1819] In this invention, the server includes means for receiving source code, means for activating a generative model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications and providing a download link, means for uploading photos of the source code using a smart device, and means for generating specifications from the photos of the source code. This makes it possible to grasp the robot's operation in detail and quickly generate high-quality specifications.

[1820] "Source code" is code that describes a program, in a form before it is converted into a computer-executable form.

[1821] "Means for receiving" refers to a device or mechanism capable of obtaining data or information through a network or interface.

[1822] A "generative model for analysis" is a model trained by artificial intelligence or machine learning that is used to analyze given input data, especially source code, and understand its structure and content.

[1823] A "comment" is an explanation or annotation written in source code that does not affect the operation of the program but makes it easier for programmers and administrators to understand and maintain the code.

[1824] A "variable name" is a label or name used to identify specific data or values ​​within a program.

[1825] A "function name" is a name or label that identifies a block of code that performs a particular operation or procedure.

[1826] A "control structure" is a syntax element for controlling the flow and execution order of a program, and includes conditional branching and repetitive processing.

[1827] A "test case" is a set of specific inputs and expected outputs designed to verify whether a program or system works correctly.

[1828] A "specification written in natural language" is a document that describes the structure and operation of a program in a format that humans can understand.

[1829] A "smart device" is a portable electronic device such as a smartphone or tablet that has advanced computing and communication capabilities.

[1830] A "means for uploading photos" is a mechanism that has the function of sending and storing image data on a server or cloud.

[1831] A "means for generating specifications" is a mechanism that has the ability to automatically create detailed descriptions of a program or system based on given data or information.

[1832] This invention is a system that automatically generates robot operation specifications by photographing and uploading the source code of a factory robot. The system of this invention is realized by combining a server, smart devices, and software.

[1833] System Overview

[1834] Users use a smart device (such as a smartphone or tablet) to take a photo of the factory robot's source code and upload the photo or file to the server through the interface. The server analyzes the received data and activates a generative AI model to extract the necessary information from the source code. The generative AI model uses natural language processing technology to identify and extract comments, variable names, function names, control structures, and test cases. It then automatically generates a specification document written in natural language based on the extracted information. The final generated specification document is stored on the server, and users can obtain it via a download link.

[1835] Hardware and software used

[1836] Server: The computer system that receives the data and runs the generative AI model.

[1837] Smart Device: A device (smartphone, tablet, etc.) for taking photos of and uploading source code.

[1838] Generative AI model: A model that uses natural language processing techniques such as the OpenAI API.

[1839] Interface: A web application (using the Flask framework, for example) that manages the exchange of data between the user and the server.

[1840] Program processing explanation

[1841] The server receives the source code uploaded by the user through the interface and stores it in a temporary storage area. The server then launches a generative AI model (e.g., OpenAI API) to begin analyzing the received source code. During this analysis process, comments, variable names, function names, control structures, and test cases within the source code are identified and extracted. A specification written in natural language is then generated based on the extracted information. The generated specification is stored on the server, and the user can obtain it via a download link.

[1842] Examples and prompts

[1843] Here is the Python code that a user might upload as an example:

[1844] Upload Code:

[1845] python

[1846] Functions that control the robot's behavior

[1847] def control_robot(action):

[1848] """

[1849] Functions that control the robot's behavior

[1850] argument:

[1851] action: Action command (str)

[1852] Returns:

[1853] Operation result (str)

[1854] """

[1855] if action == "forward":

[1856] return "The robot moves forward"

[1857] elif action == "backward":

[1858] return "Robot retreats"

[1859] else:

[1860] return "Invalid command"

[1861] Example of generated prompt:

[1862] Generate a specification from the following source code:

[1863] python

[1864] Functions that control the robot's behavior

[1865] def control_robot(action):

[1866] """

[1867] Functions that control the robot's behavior

[1868] argument:

[1869] action: Action command (str)

[1870] Returns:

[1871] Operation result (str)

[1872] """

[1873] if action == "forward":

[1874] return "The robot moves forward"

[1875] elif action == "backward":

[1876] return "Robot retreats"

[1877] else:

[1878] return "Invalid command"

[1879] This system makes it possible to grasp the details of factory robot operations and quickly generate high-quality specifications, thereby reducing man-hours and improving the quality of specifications.

[1880] The flow of the specific processing in the application example 1 will be described with reference to FIG.

[1881] Step 1:

[1882] A user takes a photo of the source code or selects a source code file using a smart device. The photo or selected file is uploaded to the server through the interface. The input of this step is the source code image or file. The output is the image data or file data transferred to the server.

[1883] Step 2:

[1884] The server receives the uploaded image data or file data and stores it in a temporary storage area. The input of this step is the image data or file data sent by the user. The output is the data stored in the temporary storage area.

[1885] Step 3:

[1886] The server identifies the format of the received data (image or file) and performs appropriate preprocessing. If it is image data, it uses OCR (Optical Character Recognition) technology to extract text from the image. If it is file data, it uses it as text. The input at this stage is image data or file data from a temporary storage area. The output is source code in text format.

[1887] Step 4:

[1888] The server launches the generative AI model and inputs the textual source code into the model. The generative AI model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases. The input of this stage is the textual source code. The output is a set of extracted information.

[1889] Step 5:

[1890] The server uses a generative AI model to automatically generate a specification written in natural language based on the extracted information. The input to this stage is the set of extracted information. The output is a specification written in natural language.

[1891] Step 6:

[1892] The server stores the generated specification and generates a download link that users can access. The input to this stage is a specification written in natural language. The output is a download link to the location where the specification is stored.

[1893] Step 7:

[1894] The user accesses the download link through the interface and downloads the generated specification. The input of this step is the download link. The output is the locally saved specification.

[1895] This series of steps allows users to efficiently generate high-quality specifications.

[1896] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.

[1897] The present invention provides a system that automates the creation and updating of system specifications during system construction and modification, reducing the number of steps and providing high-quality specifications. The present invention also includes an emotion engine that recognizes a user's emotions and provides feedback based on the results. Embodiments of the present invention are described in detail below.

[1898] System Overview

[1899] The system analysis process begins when a user uploads source code from their device to the server via an interface. The server then launches a generative model to analyze the received source code. The generative model extracts comments, variable names, function names, control structures, and test cases from the source code, and automatically generates a specification document written in natural language based on the extracted information. The generated specification document is stored on the server, and a download link is provided.

[1900] The emotion engine uses sensor data and input information to recognize the user's emotions, analyzes the user's emotional state, and provides appropriate feedback to the user according to the analysis results and the contents of the generated specifications.

[1901] Program processing

[1902] The user uploads the source code on the terminal. For example, the user clicks the "Select File" button on the web interface, selects the source code file from the local disk, and clicks the "Upload" button. The server receives the uploaded source code and stores it in a temporary storage area.

[1903] The server then launches a generative model, which uses natural language processing (NLP) techniques to analyze the source code and extract the necessary information: specifically, it identifies and extracts comment content, variable names and data types, function names and arguments, control structures, and test cases.

[1904] Based on the extracted information, the server uses a generative model to automatically generate a specification written in natural language, which includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and test case content.

[1905] The emotion engine recognizes the user's emotional state by analyzing the user's facial expression, tone of voice, typing pace, etc. For example, if the user types at a faster pace than usual or their facial expression becomes grim, the emotion engine will determine that the user is feeling stressed.

[1906] Based on the analysis results of the emotion engine, the server provides feedback to the user. For example, it can display a message such as "Please relax" based on the analysis results, or automatically generate an explanation to supplement the contents of the specification.

[1907] Finally, the server saves the generated specification. Once the saving is complete, the server generates a download link and provides it to the user. The user can click the link to download the specification and save it locally. In addition, the emotion engine's feedback can reduce the user's stress and improve work efficiency.

[1908] Specific examples

[1909] For example, if a user uploads the following Python code:

[1910] python

[1911] Function: Double a number

[1912] def double_number(x):

[1913] """

[1914] A function that doubles a number

[1915] argument:

[1916] x: an integer or floating point number

[1917] Returns:

[1918] twice the value of x

[1919] """

[1920] return x 2

[1921] Unit Testing

[1922] assert double_number(2) == 4

[1923] double assert_number(1.5) == 3.0

[1924] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, and test cases from the code, and generates a specification that looks like this:

[1925] System Specifications

[1926] overview

[1927] The system includes a function that doubles an input number and its unit test.

[1928] Function Details

[1929] double_number

[1930] Description: Doubles the given number.

[1931] argument:

[1932] x: an integer or floating point number

[1933] Returns:

[1934] twice the value of x

[1935] Control Structures

[1936] It does not include conditional branches or loop structures.

[1937] Test Cases

[1938] assert double_number(2) == 4

[1939] double assert_number(1.5) == 3.0

[1940] This specification provides detailed explanations of function behavior and test content, making it easy for users and programmers to understand, and providing high-quality documentation that is free of any omissions or omissions.

[1941] If the emotion engine analyzes the user's facial expressions and input pace and detects that the user is feeling stressed, it can display a message such as "Please relax," thereby improving the user's work efficiency and mental comfort. In this way, by combining emotion engines, a system can be realized that provides appropriate feedback according to the user's emotional state.

[1942] In this way, the system of the present invention not only efficiently analyzes source code, extracts necessary information, and generates high-quality specifications, but also recognizes user emotions and provides appropriate feedback, thereby significantly reducing the labor hours and risks involved in system development.

[1943] The processing flow will be explained below.

[1944] Step 1:

[1945] A user accesses the web interface from a terminal, clicks the "Choose File" button, selects a source code file from the local disk, and clicks the "Upload" button.

[1946] Step 2:

[1947] The server receives the uploaded source code file and stores it in a temporary storage area. It verifies the file format and content to ensure there are no problems.

[1948] Step 3:

[1949] The server launches the generative model, which begins analyzing the source code using natural language processing (NLP) techniques.

[1950] Step 4:

[1951] The generative model extracts comments in the source code, specifically by detecting comment blocks in the code and associating them with the corresponding code blocks.

[1952] Step 5:

[1953] The generative model extracts variable names and data types, identifies variable declarations in the program, and determines what data type the variables are.

[1954] Step 6:

[1955] The generative model extracts function names and arguments by detecting function definitions in the code and analyzing the function name, its arguments, and the return value information.

[1956] Step 7:

[1957] The generative model extracts control structures, detecting conditional branches (if statements, switch statements, etc.) and loop structures (for statements, while statements, etc.) and analyzing their flow.

[1958] Step 8:

[1959] The generative model extracts test cases, identifying and organizing unit and integration tests defined in the source code.

[1960] Step 9:

[1961] The server automatically generates a specification written in natural language based on the information extracted from the generative model, which includes an overview of the entire system and detailed descriptions of each element.

[1962] Step 10:

[1963] The server uses an emotion engine to analyze the user's emotions, specifically by analyzing the user's facial expressions, tone of voice, and typing pace to recognize the user's emotional state.

[1964] Step 11:

[1965] Based on the analysis results of the emotion engine, the server provides feedback to the user. For example, if the user is feeling stressed, a message encouraging them to relax is displayed.

[1966] Step 12:

[1967] The server saves the generated specification, and after saving is complete, it generates a download link and provides it to the user.

[1968] Step 13:

[1969] The user clicks on the download link provided by the server to download the generated specification, save it locally, and share it with the project team and stakeholders.

[1970] Example 2

[1971] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."

[1972] In conventional system development, analyzing source code and creating specifications are often done manually, which is time-consuming, labor-intensive, and prone to human error. Furthermore, while the user's emotional state can affect the efficiency and quality of system development, few systems take this into account. Therefore, a system that automates analysis, efficiently generates high-quality specifications, and recognizes the user's emotions and provides appropriate feedback is needed.

[1973] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.

[1974] In this invention, the server includes means for receiving source code, means for launching a generative AI model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative AI model, means for automatically generating specifications written in natural language based on the extracted information, means for launching an emotion analysis engine that recognizes user emotions and provides feedback based on the results, and means for saving the generated specifications and providing a download link. This enables the automation of source code analysis and specification generation, and provides feedback according to the user's emotional state, enabling efficient and high-quality system development.

[1975] "Source code" is a text file that describes the behavior of a program and is the input before it is converted into a form that a computer can run.

[1976] "Means for receiving" refers to the communication functions and protocols used to transfer data from a terminal to a server and receive the data on the server side.

[1977] A "generative AI model" refers to an algorithm or program that uses machine learning and natural language processing techniques to analyze source code, extract specific information, and perform specified tasks.

[1978] A "comment" is text written in source code to add supplementary explanations without affecting the operation of the program.

[1979] A "variable name" is a named symbol for storing data within a program, and serves to hold a value in a series of operations or calculations.

[1980] A "function name" is an identifier used to call a code block that performs a specific process or calculation.

[1981] A "control structure" is a syntax for controlling the execution flow of a program, and includes conditional branches and loops.

[1982] A "test case" defines specific inputs and expected outputs to verify the functionality and behavior of a program.

[1983] A "specification written in natural language" is a document that provides a detailed explanation of the operation of a system or program in a format that is easy to understand even for people without specialized programming knowledge.

[1984] An "emotion analysis engine" is a software module for detecting a user's emotional state, analyzing data such as facial expressions, voice, and input speed to classify emotions.

[1985] "Providing feedback" means that the system provides the user with information such as analysis results, suggestions, and warnings in a timely manner.

[1986] DETAILED DESCRIPTION OF THE INVENTION The present invention provides a system for automating the creation and updating of system specifications, and for analyzing a user's emotional state and providing feedback. The following describes in detail an embodiment of the present invention.

[1987] A user uses a terminal to upload source code to the server. To do this, the user launches a browser and accesses a web interface. For example, the user clicks the "Choose File" button, selects the source code file from the local disk, and clicks the "Upload" button to send the file from the terminal to the server.

[1988] The server receives the HTTP request and saves the file data in the request in a temporary storage area. This makes the source code available for subsequent analysis steps. The server then launches a generative AI model using natural language processing (NLP) techniques. This generative AI model is an algorithm built in Python or similar language and analyzes the uploaded source code.

[1989] The generative AI model identifies and extracts comments, variable names, function names, control structures, and test cases from the source code. This information is stored as a data structure in the server's memory. The server then automatically generates a specification written in natural language based on the extracted information. This specification includes a system overview, detailed function descriptions, a list of variables, a description of the control flow, and the contents of the test cases.

[1990] The emotion analysis engine recognizes the user's emotional state by analyzing their facial expressions, tone of voice, typing pace, etc. For example, if the user types at a faster pace than usual or if the camera image shows a grim expression, the emotion analysis engine will determine that the user is feeling stressed.

[1991] Based on the analysis, the server can provide appropriate feedback to the user, for example, a message such as "Relax" can be displayed in the web interface, and comments can be provided to supplement the content of the specification, if necessary.

[1992] The server stores the final generated specification in long-term storage. Once the storage process is complete, the server generates a download link for the user and displays it on the web interface. The user can click the link to download the specification and save it to their local disk.

[1993] As a concrete example, consider the following Python code uploaded by a user:

[1994] python

[1995] Function: Double a number

[1996] def double_number(x):

[1997] """

[1998] A function that doubles a number

[1999] argument:

[2000] x: an integer or floating point number

[2001] Returns:

[2002] twice the value of x

[2003] """

[2004] return x 2

[2005] Unit Testing

[2006] assert double_number(2) == 4

[2007] double assert_number(1.5) == 3.0

[2008] The server receives this source code and begins analyzing it. A generative AI model extracts comments, function names, arguments, and test cases from the code, generating a specification that looks like this:

[2009] markdown

[2010] System Specifications

[2011] overview

[2012] The system includes a function that doubles an input number and its unit test.

[2013] Function Details

[2014] double_number

[2015] Description: Doubles the given number.

[2016] argument:

[2017] x: an integer or floating point number

[2018] Returns:

[2019] twice the value of x

[2020] Control Structures

[2021] It does not include conditional branches or loop structures.

[2022] Test Cases

[2023] assert double_number(2) == 4

[2024] double assert_number(1.5) == 3.0

[2025] The generated specifications provide detailed explanations of function behavior and test content, making it easier for engineers and programmers to understand. In this way, the system of the present invention automates a series of processes, from analyzing source code to generating specifications, and even recognizing user emotions and providing appropriate feedback, achieving highly efficient and high-quality development support.

[2026] The flow of the identification process in the second embodiment will be described with reference to FIG.

[2027] Step 1:

[2028] The user uploads the source code from the terminal to the server.

[2029] Specifically, the user launches a browser on their device, accesses the provided web interface, clicks the "Choose File" button, selects the source code file from their local disk, and then clicks the "Upload" button, which sends the source code to the server as an HTTP request.

[2030] Input: Source code files stored on your local disk

[2031] Output: Source code data sent to the server

[2032] Step 2:

[2033] The server receives the source code and stores it in a temporary storage area.

[2034] Specifically, the server receives an HTTP request, extracts the file data from it, and saves the extracted file data in a designated temporary storage area. This file is used for analysis by the generative AI model.

[2035] Input: Source code data in the HTTP request

[2036] Output: Source code file saved in temporary storage area on the server

[2037] Step 3:

[2038] The server launches the generative AI model and analyzes the source code.

[2039] Specifically, the server launches a generative AI model built in Python or similar. This model uses natural language processing (NLP) techniques to analyze source code, identifying comments, variable names, function names, control structures, and test cases, and extracting information from each.

[2040] Input: Source code files stored on the server

[2041] Output: Comments, variable names, function names, control structures, and test case information extracted by the analysis.

[2042] Step 4:

[2043] The server automatically generates specifications based on the extracted information.

[2044] Specifically, the server provides the extracted information as input to the generative AI model to generate a specification written in natural language. This specification includes an overview of the system, detailed descriptions of functions, a list of variables, a description of the control flow, and the contents of test cases. The generated specification is then saved in a temporary storage area.

[2045] Input: Comments, variable names, function names, control structures, and test case information

[2046] Output: A specification written in natural language

[2047] Step 5:

[2048] The emotion analysis engine analyzes the user's emotional state.

[2049] Specifically, the emotion analysis engine analyzes the user's facial expression data (camera input), voice data (microphone input), and typing pace (keyboard input speed) to evaluate the user's emotional state and detect, for example, stress.

[2050] Input: facial expression data, voice data, input pace

[2051] Output: Evaluated user emotional state

[2052] Step 6:

[2053] The server provides feedback based on the results of the sentiment analysis engine.

[2054] Specifically, the server displays an appropriate message on the web interface based on the results of the emotion analysis engine. For example, displaying a message such as "Please relax" can improve the user's mental comfort. It can also display supplementary explanations to the content of the specifications as needed.

[2055] Input: Evaluated emotional state of the user

[2056] Output: Feedback message to the user

[2057] Step 7:

[2058] The server saves the generated specification and generates a download link.

[2059] Specifically, the server writes the generated specification to long-term storage. Once saved, the server generates a download link and displays it on the web interface. Users can click the link to download the specification and save it to their local disk.

[2060] Input: Generated specification

[2061] Output: Download link, save specification

[2062] (Application example 2)

[2063] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."

[2064] In modern system development, manually creating source code specifications requires a significant amount of time and effort, and is prone to human error. Robot control programs, especially those used on factory production lines, are complex, making the creation and updating of specifications extremely important. However, high levels of stress and fatigue can hinder efficient work. Therefore, there is a need for an efficient system development environment that not only automatically generates specifications but also monitors the emotional state of workers and provides appropriate feedback.

[2065] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 2 is realized by the following means.

[2066] In this invention, the server includes means for receiving source code, means for activating a generative model for analyzing the received source code, means for extracting comments, variable names, function names, control structures, and test cases from the source code using the generative model, means for automatically generating specifications written in natural language based on the extracted information, means for saving the generated specifications and providing a download link, means for activating an emotion engine for recognizing the emotional state of a worker and providing feedback, means for analyzing sensor data such as facial expressions, voice, and input speed using the emotion engine, and means for providing appropriate feedback to the worker based on the analysis results. This enables both the automatic generation of specifications and feedback according to the worker's emotional state, thereby realizing efficient and high-quality system construction.

[2067] The "means for receiving source code" is a function that allows a user to upload source code to the system and have the code received by the server.

[2068] "Means for launching a generative model" refers to a function for running an AI model or machine learning model to analyze received source code.

[2069] "Means for extracting comments, variable names, function names, control structures, and test cases from source code" refers to a function for automatically identifying and extracting annotations, variable names, function names, control flow structures, and test cases from source code.

[2070] "Means for automatically generating specifications written in natural language" is a function for automatically creating documents in a format that is easy for humans to understand, based on extracted information.

[2071] The "means for saving the generated specifications and providing a download link" is a function for saving the automatically generated specifications on a server and providing a link that allows the user to download the specifications.

[2072] The "means for activating an emotion engine to recognize the worker's emotional state and provide feedback" is a function for acquiring sensor data necessary to recognize the user's emotions and executing an engine that processes the data.

[2073] "Means for analyzing sensor data such as facial expressions, voice, and input speed" is a function that collects information such as a worker's facial expressions, voice changes, and keystroke speed, and analyzes them to determine their emotional state.

[2074] "Means for providing appropriate feedback to workers based on the analysis results" is a function for providing feedback and suggestions to relieve workers' stress and fatigue based on the results of the emotion engine.

[2075] This invention is a system that efficiently analyzes robot control programs for factory production lines and automatically generates specifications. It also monitors the emotional state of workers and provides appropriate feedback to improve work efficiency and quality. Specific embodiments for implementing this invention are described below.

[2076] System configuration

[2077] The system mainly consists of the following components:

[2078] 1. Server

[2079] 2. Terminal

[2080] 3. Emotion Engine

[2081] 4. Generative Model

[2082] What the program does

[2083] The server has a means for receiving source code sent by users. The process begins when a user selects and uploads source code from a web interface via their terminal. Once the source code is received by the server, it is stored in a temporary storage area.

[2084] The server then launches a generative model, which analyzes and extracts comments, variable names, function names, control structures, and test cases from the source code. Using natural language processing (NLP) techniques, the analysis automatically generates a specification written in natural language based on the extracted information. The specification is then stored on the server, and a download link is provided for users to download.

[2085] The server then activates an emotion engine, which analyzes the worker's emotional state using sensor data such as the user's facial expressions, voice, and input speed. Based on the analysis results, the server provides appropriate feedback to the worker. If the emotion engine detects stress or fatigue based on the sensor information, it displays a message such as "Please relax."

[2086] Hardware and software used

[2087] Server: a high-performance computer system

[2088] Device: The computer or tablet used by the user

[2089] Generative Model: A generative AI model that uses natural language processing (NLP) techniques

[2090] Emotion engine: Software that performs facial expression recognition, voice analysis, and keystroke analysis

[2091] Specific examples

[2092] Suppose a user uploads the following Python code from their terminal:

[2093] python

[2094] Robot arm initialization function

[2095] def initialize_arm():

[2096] """

[2097] A function to initialize the robot arm

[2098] """

[2099] print("Initializing arm.")

[2100] A function to move the arm to a specific position

[2101] def move_arm_to_position(position):

[2102] """

[2103] A function that moves the robot arm to a specified position.

[2104] argument:

[2105] position: target position of the arm

[2106] """

[2107] print(f"Moving arm to {position}")

[2108] Unit Testing

[2109] initialize_arm()

[2110] move_arm_to_position('home')

[2111] The server receives this source code and begins parsing it. The generative model extracts comments, function names, arguments, etc. from the code and generates a specification document like this:

[2112] System Specifications

[2113] overview

[2114] The system includes functionality to initialize and move the robotic arm to a specific position.

[2115] Function Details

[2116] initialize_arm

[2117] Description: Initializes the robot arm.

[2118] Arguments: None

[2119] move_arm_to_position

[2120] Description: Moves the robot arm to the specified position.

[2121] argument:

[2122] position: target position of the arm

[2123] Test Cases

[2124] initialize_arm()

[2125] move_arm_to_position('home')

[2126] Furthermore, if the user types information into the system too quickly or their facial expression becomes grim, the emotion engine will determine that the user is feeling stressed. Based on the analysis results, the server will display messages such as "Please relax" to reduce the worker's stress.

[2127] Prompt Sentence Examples

[2128] The prompt is fed to the generative AI model in the following format:

[2129] Parse the following Python code and generate its specification:

[2130] Robot arm initialization function

[2131] def initialize_arm():

[2132] """

[2133] A function to initialize the robot arm

[2134] """

[2135] print("Initializing arm.")

[2136] A function to move the arm to a specific position

[2137] def move_arm_to_position(position):

[2138] """

[2139] A function that moves the robot arm to a specified position.

[2140] argument:

[2141] position: target position of the arm

[2142] """

[2143] print(f"Moving arm to {position}")

[2144] Unit Testing

[2145] initialize_arm()

[2146] move_arm_to_position('home')

[2147] This prompt allows the generative model to extract the necessary information and generate a high-quality specification.

[2148] The flow of the specific processing in the application example 2 will be described with reference to FIG.

[2149] Step 1:

[2150] The user uploads the source code.

[2151] The user uses the terminal and clicks the "Choose File" button in the web interface to select the source code file from the local disk and then clicks the "Upload" button. The input is the source code file, and the output is that this source code is sent to the server.

[2152] Step 2:

[2153] The server receives the source code and stores it in a temporary storage area.

[2154] The server receives the submitted source code file and saves it in the server's temporary storage area (e.g., a specified temporary directory). The input is the source code file submitted by the user, and the output is the path of the saved source code file.

[2155] Step 3:

[2156] The server launches the generative model.

[2157] The server passes the path of the saved source code file to the generative model and launches the model. The input is the path of the source code file, and the output is the generative model ready for analysis.

[2158] Step 4:

[2159] A generative model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases.

[2160] The generative model analyzes the source code and extracts comments, variable names, function names, control structures, and test cases written in the code. The input is the content of the source code file, and the output is each analyzed element (comments, variable names, function names, control structures, and test cases).

[2161] Step 5:

[2162] The server generates a specification based on the extracted information.

[2163] The server uses the analysis results obtained from the generative model to automatically generate specifications written in natural language. The input is the analysis results, and the output is the generated specification.

[2164] Step 6:

[2165] The server stores the generated specification and provides a download link.

[2166] The server stores the generated specification and creates and provides a link for users to download the specification. The input is the generated specification and the output is the download link.

[2167] Step 7:

[2168] The server starts the emotion engine.

[2169] The server invokes the emotion engine to recognize the user's emotional state. The input is the invocation command and the output is the running emotion engine.

[2170] Step 8:

[2171] The emotion engine analyzes sensor data such as facial expressions, voice, and input speed.

[2172] The emotion engine analyzes sensor data such as facial expressions, voice, and typing speed to measure the user's emotional state. The input is the sensor data, and the output is the analyzed emotional state.

[2173] Step 9:

[2174] The server provides appropriate feedback to the user based on the analysis results.

[2175] The server displays appropriate feedback to the user based on the analysis results of the emotion engine, for example, a message such as "Please relax." The input is the analyzed emotional state, and the output is the feedback message.

[2176] The specific processing unit 290 transmits the result of the specific processing to the robot 414. In the robot 414, the control unit 46A causes the speaker 240 and the control target 443 to output the result of the specific processing. The microphone 238 acquires voice indicating a user input regarding the result of the specific processing. The control unit 46A transmits voice data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the voice data.

[2177] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.

[2178] In the above embodiment, an example was given in which the specific processing is performed by the data processing device 12, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the robot 414.

[2179] The emotion identification model 59 as an emotion engine may determine the user's emotion according to a specific mapping. Specifically, the emotion identification model 59 may determine the user's emotion according to an emotion map (see FIG. 9), which is a specific mapping. Similarly, the emotion identification model 59 may determine the robot's emotion, and the identification processing unit 290 may perform identification processing using the robot's emotion.

[2180] FIG. 9 is a diagram illustrating an emotion map 400 on which multiple emotions are mapped. In the emotion map 400, emotions are arranged in concentric circles radiating from the center. Emotions closer to the center of the concentric circles are more primitive. Emotions representing states and actions arising from a state of mind are arranged on the outer edges of the concentric circles. The concept of emotion includes both affect and mental states. Emotions generally generated from reactions occurring in the brain are arranged on the left side of the concentric circles. Emotions generally induced by situational judgment are arranged on the right side of the concentric circles. Emotions generally generated from reactions occurring in the brain and induced by situational judgment are arranged on the upper and lower sides of the concentric circles. Furthermore, the emotion of "pleasure" is arranged on the upper side of the concentric circles, and the emotion of "discomfort" is arranged on the lower side. In this way, in the emotion map 400, multiple emotions are mapped based on the structure by which emotions are generated, and emotions that tend to occur simultaneously are mapped close to each other.

[2181] These emotions are distributed in the 3 o'clock direction on emotion map 400, and typically fluctuate between relief and anxiety. In the right half of emotion map 400, situational awareness dominates over internal sensations, resulting in a sense of calm.

[2182] The inside of emotion map 400 represents what is going on in the mind, and the outside of emotion map 400 represents behavior, so the further you go outside emotion map 400, the more visible the emotions become (the more they are expressed in behavior).

[2183] Human emotions are based on various balances, such as posture and blood sugar levels. When these balances deviate from the ideal, a state of discomfort is indicated, and when they approach the ideal, a state of pleasure is indicated. Emotions can also be created for robots, automobiles, and motorcycles, based on various balances, such as posture and remaining battery life. When these balances deviate from the ideal, a state of discomfort is indicated, and when they approach the ideal, a state of pleasure is indicated. An emotion map can be generated, for example, based on Dr. Mitsuyoshi's emotion map (Research on Voice Emotion Recognition and Emotional Brain Physiological Signal Analysis Systems, Tokushima University, Doctoral Dissertation: https: / / ci.nii.ac.jp / naid / 500000375379). The left half of the emotion map lists emotions belonging to the "reaction" domain, where sensation is dominant. The right half of the emotion map lists emotions belonging to the "situation" domain, where situational awareness is dominant.

[2184] The emotion map defines two emotions that promote learning. One is a negative emotion on the situation side, around the middle of "repentance" or "reflection." In other words, this occurs when the robot experiences negative emotions such as "I never want to feel this way again" or "I don't want to be scolded again." The other is a positive emotion on the response side, around "desire." In other words, this occurs when the robot experiences positive feelings such as "I want more" or "I want to know more."

[2185] The emotion identification model 59 inputs user input into a pre-trained neural network, obtains emotion values ​​indicating each emotion shown in the emotion map 400, and determines the user's emotion. This neural network is pre-trained based on multiple pieces of training data that are combinations of user input and emotion values ​​indicating each emotion shown in the emotion map 400. Furthermore, this neural network is trained so that emotions that are located close to each other have similar values, as in the emotion map 900 shown in FIG. 10. FIG. 10 shows an example in which multiple emotions, "relieved," "calm," and "reassuring," have similar emotion values.

[2186] The system according to the present disclosure has been described above mainly with respect to the functions of the data processing device 12, but the system according to the present disclosure is not necessarily implemented on a server. The system according to the present disclosure may be implemented as a general information processing system. The present disclosure may be implemented, for example, as a software program running on a personal computer or an application running on a smartphone, etc. The method according to the present disclosure may be provided to users in the form of SaaS (Software as a Service).

[2187] In the above embodiment, an example was given in which the specific processing is performed by one computer 22, but the technology of the present disclosure is not limited to this, and the specific processing may be distributed and performed by a plurality of computers including the computer 22. For example, the data generation model 58 may be provided in an external device of the data processing device 12, and data may be generated in the external device in accordance with input data.

[2188] In the above embodiment, an example in which the specific processing program 56 is stored in the storage 32 has been described, but the technology of the present disclosure is not limited to this. For example, the specific processing program 56 may be stored in a portable, computer-readable, non-transitory storage medium such as a USB (Universal Serial Bus) memory. The specific processing program 56 stored in the non-transitory storage medium is installed in the computer 22 of the data processing device 12. The processor 28 executes the specific processing in accordance with the specific processing program 56.

[2189] Alternatively, the specific processing program 56 may be stored in a storage device such as a server connected to the data processing device 12 via the network 54, and the specific processing program 56 may be downloaded and installed on the computer 22 in response to a request from the data processing device 12.

[2190] It is not necessary to store all of the specific processing program 56 in a storage device such as a server connected to the data processing device 12 via the network 54, or to store all of the specific processing program 56 in the storage 32; only a portion of the specific processing program 56 may be stored.

[2191] The hardware resource for executing a specific process can be any of the following processors: An example of a processor is a CPU, which is a general-purpose processor that functions as a hardware resource for executing a specific process by executing software, i.e., a program. Another example of a processor is a dedicated electrical circuit, such as an FPGA (Field-Programmable Gate Array), a PLD (Programmable Logic Device), or an ASIC (Application Specific Integrated Circuit), which is a processor with a circuit configuration designed specifically for executing a specific process. Each processor has built-in or connected memory, and each processor uses the memory to execute the specific process.

[2192] The hardware resource that executes the specific processing may be configured with one of these various processors, or may be configured with a combination of two or more processors of the same or different types (for example, a combination of multiple FPGAs, or a combination of a CPU and an FPGA). Also, the hardware resource that executes the specific processing may be a single processor.

[2193] As an example of a system configured with a single processor, first, one processor is configured by combining one or more CPUs and software, and this processor functions as a hardware resource that executes a specific process. Second, there is a system that uses a processor that realizes the functions of an entire system including multiple hardware resources that execute a specific process on a single IC chip, as typified by SoC (System-on-a-chip). In this way, a specific process is realized using one or more of the above-mentioned various processors as hardware resources.

[2194] Furthermore, the hardware structure of these various processors can be, more specifically, an electric circuit that combines circuit elements such as semiconductor devices. The specific processing described above is merely an example. Therefore, it goes without saying that unnecessary steps may be deleted, new steps may be added, or the processing order may be rearranged, without departing from the spirit of the invention.

[2195] The above-described description and illustrations are a detailed explanation of the parts related to the technology of the present disclosure and are merely an example of the technology of the present disclosure. For example, the above description of the configuration, functions, actions, and effects is an explanation of an example of the configuration, functions, actions, and effects of the parts related to the technology of the present disclosure. Therefore, it goes without saying that unnecessary parts may be deleted, new elements may be added, or replacements may be made to the above-described description and illustrations within the scope of the gist of the technology of the present disclosure. Furthermore, to avoid confusion and facilitate understanding of the parts related to the technology of the present disclosure, the above-described description and illustrations omit explanations of common technical knowledge that do not require particular explanation to enable the implementation of the technology of the present disclosure.

[2196] All publications, patent applications, and technical standards mentioned in this specification are herein incorporated by reference to the same extent as if each individual publication, patent application, or technical standard was specifically and individually indicated to be incorporated by reference.

[2197] The following is further disclosed regarding the above embodiment.

[2198] (Claim 1)

[2199] means for receiving the source code;

[2200] means for invoking a generative model to analyze the received source code;

[2201] A means for extracting comments, variable names, function names, control structures, and test cases in source code using a generative model;

[2202] A means for automatically generating specifications written in natural language based on the extracted information;

[2203] a means for saving the generated specification and providing a download link;

[2204] A system including:

[2205] (Claim 2)

[2206] The system of claim 1, further comprising an interface for displaying the receipt and progress of the source code.

[2207] (Claim 3)

[2208] 10. The system of claim 1, further comprising: a preview of the generated specification.

[2209] "Example 1"

[2210] (Claim 1)

[2211] means for receiving the source code;

[2212] means for storing the received source code in a temporary storage area;

[2213] means for invoking a generative AI model to analyze the received source code;

[2214] A means for setting a prompt sentence in the generative AI model and instructing it to analyze the source code;

[2215] A means for extracting comments, variable names, function names, control structures, and test cases in source code using a generative AI model;

[2216] A means for automatically generating specifications written in natural language based on the extracted information;

[2217] a means for saving the generated specification as a file;

[2218] means for generating and providing a download link for the stored specification;

[2219] A system including:

[2220] (Claim 2)

[2221] The system of claim 1, further comprising an interface for displaying the receipt and progress of the source code.

[2222] (Claim 3)

[2223] 10. The system of claim 1, further comprising: a preview of the generated specification.

[2224] "Application Example 1"

[2225] (Claim 1)

[2226] means for receiving the source code;

[2227] means for invoking a generative model to analyze the received source code;

[2228] A means for extracting comments, variable names, function names, control structures, and test cases in source code using a generative model;

[2229] A means for automatically generating specifications written in natural language based on the extracted information;

[2230] a means for saving the generated specification and providing a download link;

[2231] A means to upload photos of source code using a smart device;

[2232] A means for generating specifications from photographs of source code;

[2233] A system including:

[2234] (Claim 2)

[2235] The system of claim 1, further comprising an interface for displaying the receipt and progress of the source code.

[2236] (Claim 3)

[2237] 10. The system of claim 1, further comprising: a preview of the generated specification.

[2238] "Example 2: Combining Emotion Engines"

[2239] (Claim 1)

[2240] means for receiving the source code;

[2241] means for invoking a generative AI model to analyze the received source code;

[2242] A means for extracting comments, variable names, function names, control structures, and test cases in source code using a generative AI model;

[2243] A means for automatically generating specifications written in natural language based on the extracted information;

[2244] means for activating a sentiment analysis engine that recognizes the user's sentiment and provides feedback based on the recognition results;

[2245] a means for saving the generated specification and providing a download link;

[2246] A system including:

[2247] (Claim 2)

[2248] The system of claim 1, further comprising an interface for displaying the receipt and progress of the source code.

[2249] (Claim 3)

[2250] 10. The system of claim 1, further comprising: a preview of the generated specification.

[2251] "Application example 2 when combining emotion engines"

[2252] (Claim 1)

[2253] means for receiving the source code;

[2254] means for invoking a generative model to analyze the received source code;

[2255] A means for extracting comments, variable names, function names, control structures, and test cases in source code using a generative model;

[2256] A means for automatically generating specifications written in natural language based on the extracted information;

[2257] a means for saving the generated specification and providing a download link;

[2258] means for activating an emotion engine for recognizing the emotional state of the worker and providing feedback;

[2259] A means of analyzing sensor data such as facial expressions, voice, and typing speed using an emotion engine;

[2260] A means for providing appropriate feedback to the worker based on the analysis results;

[2261] A system including:

[2262] (Claim 2)

[2263] The system of claim 1, further comprising an interface for displaying the receipt and progress of the source code.

[2264] (Claim 3)

[2265] 10. The system of claim 1, further comprising: a preview of the generated specification. [Explanation of symbols]

[2266] 10, 210, 310, 410 Data Processing Systems 12 Data Processing Device 14 Smart Devices 214 Smart Glasses 314 Headset-type terminal 414 Robot< / url:> < / url:> < / url:> < / url:>

Claims

1. means for receiving the source code; means for invoking a generative model to analyze the received source code; A means for extracting comments, variable names, function names, control structures, and test cases in source code using a generative model; A means for automatically generating specifications written in natural language based on the extracted information; a means for saving the generated specification and providing a download link; A system including:

2. The system of claim 1 , wherein the interface displays the receipt and progress of the source code.

3. The system of claim 1 provides a preview of the generated specification.

Citation Information

Patent Citations

  • Persona chatbot control method and system

    JP2022180282A