system
The system addresses the inefficiencies in software development documentation by automating the generation of flowcharts, class diagrams, and procedure manuals, enhancing program understanding and facilitating smooth handovers.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2026-03-10
AI Technical Summary
Maintaining program quality and ensuring smooth project handovers in software development is challenging due to the time-consuming and labor-intensive process of documenting programs, particularly when they are highly dependent on individual developers, leading to inefficient creation of flowcharts, class diagrams, and procedure manuals.
A system that receives program source code, syntactically analyzes it to generate flowcharts, class diagrams, and procedure manuals, allowing users to download these documents and reducing dependency on individual users through automated documentation generation.
The system significantly reduces the effort required for program documentation and handover by providing efficient, automated generation of high-quality flowcharts, class diagrams, and procedure manuals, enabling easy understanding and sharing of program structures and processes.
Smart Images

Figure 2026041271000001_ABST
Abstract
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] In recent years, maintaining program quality and ensuring smooth project handovers have become important issues in software development. However, documenting programs requires a great deal of effort and time, and documenting programs that are highly dependent on individual developers is particularly difficult. With existing tools and manual processes, creating flowcharts, class diagrams, procedure manuals, and other documents requires a significant amount of man-hours and is not efficient. This invention solves these problems and provides a system that supports efficient documentation generation. [Means for solving the problem]
[0005] The present invention solves the above problems by the following means. First, a system is provided with means for receiving program source code. Next, a means for syntactically analyzing the received source code is introduced, and a means for automatically generating a flowchart based on the analysis results is provided. Similarly, a means for generating a class diagram based on the syntactic analysis results is provided, and a means for generating a procedure manual is also included. Furthermore, by providing a means for allowing users to download the generated flowcharts, class diagrams, and procedure manuals, efficient document creation and sharing is achieved. Furthermore, by adding a means for extracting each function and major processing block in the source code and generating a procedure manual in natural language based on them, and an upload means for users to select and specify programs, a system is provided that prevents dependency on individual users and supports smooth handover.
[0006] A "program" is software code that contains a set of instructions that causes a computer to perform a particular task.
[0007] "Source code" is a textual representation of a program written in a programming language.
[0008] "Syntax analysis" is the process of breaking down source code into tokens and analyzing their structure according to grammatical rules.
[0009] A "flowchart" is a diagram that visually represents the flow of a program's processing, showing processing steps and branching.
[0010] A "class diagram" is a visual representation of classes, their relationships, methods, and attributes in object-oriented programming.
[0011] A "procedure manual" is a document that describes the processing procedures and operations of a program in natural language.
[0012] "User" means a person or organization that uses the system to upload source code and obtain analysis results and generated materials.
[0013] "System" refers to the set of computer processes and hardware that receives source code, analyzes it, generates documentation based on the analysis results, and provides the generated documentation. [Brief explanation of the drawings]
[0014] [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
[0015] 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.
[0016] First, the terms used in the following description will be explained.
[0017] 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).
[0018] 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.
[0019] 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.
[0020] 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.
[0021] 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."
[0022] [First embodiment]
[0023] FIG. 1 shows an example of the configuration of a data processing system 10 according to the first embodiment.
[0024] 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.
[0025] 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).
[0026] 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.
[0027] 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.
[0028] 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.
[0029] 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.
[0030] FIG. 2 shows an example of the main functions of the data processing device 12 and the smart device 14.
[0031] 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.
[0032] 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.
[0033] 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.
[0034] 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."
[0035] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. This system makes it easy to document programs that are dependent on individual users, and can significantly reduce the amount of work required for handover.
[0036] Overall system configuration
[0037] The system has the following main functions:
[0038] 1. Receiving source code (user uploads program)
[0039] 2. Parsing (the server analyzes the source code)
[0040] 3. Flowchart generation (the server visualizes the processing flow)
[0041] 4. Class diagram generation (the server visualizes object relationships)
[0042] 5. Procedure generation (the server describes the processing procedure in natural language)
[0043] 6. Providing the results (the device provides the generated data to the user)
[0044] Program processing
[0045] Receiving the source code
[0046] The user uploads the source code file they wish to analyze through a web interface. For example, they can select a Python source code file such as "sample_program.py." The server receives the uploaded source code and stores it in temporary storage.
[0047] Parsing
[0048] The server passes the received source code to the parsing engine, which automatically detects the language of the file and parses the source code using a parser appropriate for that language. For example, for a Python program, the server uses a Python-specific parsing engine to generate an abstract syntax tree (AST).
[0049] Flowchart generation
[0050] The server extracts each function and major processing block of the program based on the results of syntax analysis. It then builds a flowchart data structure based on the extracted information and uses an external library to draw the flowchart. For example, it visually represents the processing flow, including conditional branching and loop structures.
[0051] Class diagram generation
[0052] For object-oriented programs, the server analyzes all classes and their inheritance relationships to generate a class diagram. It extracts class names, methods, properties, etc. and converts them into data structures for the class diagram. It uses an external library to visually draw the class diagram.
[0053] Procedure generation
[0054] The server generates a natural language description of each function's process and key steps, such as how the function normalize_data normalizes the input data and how the function filter_data filters the data.
[0055] Providing results
[0056] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[0057] Specific examples
[0058] Below is an overview of the materials generated by this system, using the following Python source code as an example. For example, suppose you have the following Python code:
[0059] def normalize_data(data):
[0060] normalized_data = [x / max(data) for x in data]
[0061] return normalized_data
[0062] def filter_data(data):
[0063] filtered_data = [x for x in data if x > 0.5]
[0064] return filtered_data
[0065] def main():
[0066] raw_data = [10, 20, 30, 40, 50]
[0067] normalized_data = normalize_data(raw_data)
[0068] final_data = filter_data(normalized_data)
[0069] print(final_data)
[0070] if __name__ == "__main__":
[0071] main()
[0072] Based on this source code, the server generates the following materials:
[0073] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[0074] Class diagram: Not applicable, as this example does not contain any classes.
[0075] Instructions:
[0076] 1. The function normalize_data normalizes the input data.
[0077] 2. The function filter_data filters the normalized data.
[0078] 3. The main function processes the data as follows:
[0079] Create raw_data.
[0080] Call the normalize_data function to get normalized_data.
[0081] Call the filter_data function and get the final_data.
[0082] Output final_data.
[0083] In this way, users can easily understand the results of program analysis without any special knowledge or effort, and can share and take over efficiently.
[0084] The processing flow will be explained below.
[0085] Step 1:
[0086] The user uploads the source code file they wish to analyze through the web interface, for example, by selecting a Python file called "sample_program.py" and clicking the upload button.
[0087] Step 2:
[0088] The server receives the uploaded source code file, saves it in temporary storage, and notifies the user that the save is complete.
[0089] Step 3:
[0090] The server passes the received source code to the parsing engine, which automatically identifies the programming language of the source code and begins parsing it using the corresponding parser.
[0091] Step 4:
[0092] The server parses the source code, breaking it down into tokens and generating an Abstract Syntax Tree (AST). For Python programs, the AST is created using the ast module.
[0093] Step 5:
[0094] The server analyzes the AST and extracts key functions and processing blocks. Based on the extracted information, it builds a flowchart data structure. For example, it models conditional branches, loop structures, and other elements as nodes and edges that visually represent them.
[0095] Step 6:
[0096] The server draws the flowchart using an external library (e.g., Graphviz) and saves the generated results in temporary storage.
[0097] Step 7:
[0098] If the server is also an object-oriented program, it analyzes all classes and their relationships, extracting class names, methods, properties, and inheritance relationships, and converting them into a data structure for a class diagram.
[0099] Step 8:
[0100] The server draws the class diagram using an external library (e.g., PlantUML) and saves the generated results in temporary storage.
[0101] Step 9:
[0102] The server generates a procedure manual that describes the processing flow for each function in natural language. It analyzes the role and operation procedures of each function and creates a procedure manual as a summary.
[0103] Step 10:
[0104] The server converts the generated flowcharts, class diagrams, and procedure manuals into PDF or image format and generates a download link.
[0105] Step 11:
[0106] The terminal provides the link of the generated material from the server to the user, and the user uses the provided link to download the required material and save it in the local environment.
[0107] Step 12:
[0108] Users can check the downloaded materials and share them with their own work or team members, which prevents dependency on individual people and enables efficient handover.
[0109] Example 1
[0110] 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."
[0111] Traditionally, documenting program source code has been a time-consuming and labor-intensive process, and the resulting documentation often contains subjective descriptions, resulting in inconsistent quality. This has resulted in difficulties in program handover and maintenance, leading to inefficient work. It has also been difficult to quickly understand the overall structure and main processing content of a program. Therefore, there is a need for a system that can automatically generate flowcharts, class diagrams, and procedure manuals from source code analysis, providing consistent documentation.
[0112] 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.
[0113] In this invention, the server includes means for receiving program source code, means for automatically determining the language of the received source code, means for syntactically analyzing the received source code and generating an abstract syntax tree, means for extracting each function and major processing blocks, means for generating a flowchart based on the extracted information, means for analyzing the classes and inheritance relationships of an object-oriented program and generating a class diagram, means for generating a procedure manual that describes the processing content and important steps of each function in natural language, means for making the generated flowcharts, class diagrams, and procedure manuals available for download by users, means for allowing users to select and specify programs by uploading source code, and means for a syntax analysis engine that supports multiple languages and selects an appropriate parser based on the file extension and content to perform syntax analysis.This automatically generates high-quality documentation from the program source code, allowing users to quickly and efficiently understand the overall structure and major processing content of the program.
[0114] "Program source code" means the textual instructions that describe a computer program.
[0115] The "means for receiving" is a mechanism that has the function of receiving data sent from a user and storing it in temporary storage for use in processing.
[0116] "Means for automatic language detection" is a function that automatically identifies the programming language from the file extension and contents of the source code, and selects the appropriate analysis method based on the results.
[0117] "Syntax analysis" is the process of analyzing the grammar and structure of program source code and is a method of generating an abstract syntax tree (AST).
[0118] An "abstract syntax tree (AST)" is a data structure that represents the syntactic structure of source code as a tree structure, with each node representing a program element (such as a statement or expression).
[0119] "Means for extracting each function and major processing block" is a function that automatically extracts each function and processing element within a program from the results of syntax analysis.
[0120] A "flowchart" is a diagram that visually represents the processing flow of a program, and shows the order of processing, branches, and loops.
[0121] A "class diagram" is a diagram that visually represents the structure of classes and the relationships between them in an object-oriented program.
[0122] A "procedure manual" is a document that describes each function and processing procedure of a program in natural language.
[0123] "Means for generating procedures written in natural language" refers to a function that organizes and describes each function and processing content of a program in natural language based on the analysis results.
[0124] "Means for making documents and diagrams available for download" refers to the function of providing a link or button that allows users to easily obtain the generated documents and diagrams.
[0125] The "means by which a user can select and specify a program through uploading" is an interface that allows a user to select the source code file of a program that they wish to analyze and send it via the online system.
[0126] A "syntax parsing engine" is a software component that analyzes source code according to the grammar of a particular programming language and generates an abstract syntax tree.
[0127] "Supporting multiple languages" means supporting a variety of programming languages and having the ability to perform analysis according to the characteristics of each language.
[0128] "Selecting an appropriate parser" is the process of determining the language of the source code, then selecting a parser specialized for that language to perform accurate parsing.
[0129] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. This system makes it easy to document programs that are dependent on individual users, and can significantly reduce the amount of work required for handover.
[0130] System Overview
[0131] The system of the present invention is composed of three main entities: a server, a terminal, and a user. The roles of each are explained below.
[0132] Server Roles
[0133] The server plays a central role in receiving source code provided by users and automatically generating various documents based on it. Specifically, it has the following functions:
[0134] 1. Receiving the Source Code:
[0135] The server receives source code files uploaded by users through a web interface and stores them in temporary storage, during which the files are also checked for integrity and scanned for viruses.
[0136] 2. Parsing:
[0137] The server automatically determines the language of the received source code and selects an appropriate parsing engine based on the results. For example, in the case of Python, it uses a Python-specific parsing engine (e.g., AST module) to generate an abstract syntax tree (AST).
[0138] 3. Flowchart generation:
[0139] The server extracts each function and major processing block based on the parsing results, and generates a flowchart based on that information, which is then visually represented using an external library (e.g., Graphviz).
[0140] 4. Class diagram generation:
[0141] For object-oriented programs, the server analyzes all classes and their inheritance relationships and generates a class diagram, which is visually drawn using an external library (e.g., PlantUML).
[0142] 5. Procedure generation:
[0143] Generates a procedure manual that describes the processing details and important steps of each function in natural language. Organizes the analysis results and provides them as an easy-to-understand natural language procedure manual.
[0144] 6. Results provided:
[0145] The server saves the generated flowcharts, class diagrams, and procedure manuals in PDF or image format and generates a link that allows users to download them.
[0146] Device Role
[0147] The terminal provides an interface through which users can access the system, upload source code, and view and download generated documentation.
[0148] 1. User Interface:
[0149] The terminal provides the user with an interface through a web browser, allowing them to upload source code, view documentation, and download it.
[0150] User Roles
[0151] Users upload the source code they wish to analyze and can then review and download the generated flowcharts, class diagrams, and procedure manuals.
[0152] Specific examples
[0153] Here we will use some Python source code as an example to explain how this system works.
[0154] Suppose you have the following Python code:
[0155] def normalize_data(data):
[0156] normalized_data = [x / max(data) for x in data]
[0157] return normalized_data
[0158] def filter_data(data):
[0159] filtered_data = [x for x in data if x > 0.5]
[0160] return filtered_data
[0161] def main():
[0162] raw_data = [10, 20, 30, 40, 50]
[0163] normalized_data = normalize_data(raw_data)
[0164] final_data = filter_data(normalized_data)
[0165] print(final_data)
[0166] if __name__ == "__main__":
[0167] main()
[0168] An example of the prompt when uploading this source code is as follows:
[0169] Analyze Python source code and generate flowcharts and instructions, including the auto-detected file language and the parsing engine used.
[0170] The system of the present invention automatically generates the following materials from this source code:
[0171] Flowchart: Visualizes each function and its processing flow, showing the execution flow of the main() function.
[0172] Class diagram: Not applicable, as this example does not contain any classes.
[0173] Instructions:
[0174] 1. The function normalize_data normalizes the input data.
[0175] 2. The function filter_data filters the normalized data.
[0176] 3. The main function processes the data as follows:
[0177] Create raw_data.
[0178] Call the normalize_data function to get normalized_data.
[0179] Call the filter_data function and get the final_data.
[0180] Output final_data.
[0181] Through the above process, users can easily understand the results of program analysis without any special knowledge or effort, and can share and take over efficiently.
[0182] The flow of the identification process in the first embodiment will be described with reference to FIG.
[0183] Step 1: Receive the source code
[0184] (Subject: User, Server)
[0185] 1. User uploads source code file:
[0186] The user uses a web interface to upload the source code file they want to analyze to the server. For example, they select a Python file called "sample_program.py." The input is the source code file, and the output is the file sent to the server.
[0187] 2. The server receives and saves the file:
[0188] The server receives source code files uploaded by users and stores them in temporary storage. The input is the file sent by the user, and the output is the saved file. File integrity checks and virus scans are also performed in this step.
[0189] Step 2: Parsing
[0190] (Subject: Server)
[0191] 1. The server determines the file type:
[0192] The server automatically determines the programming language from the extension and content of the received source code file. The input is the saved source code file, and the output is the language determination result (e.g., Python).
[0193] 2. The server parses it with the appropriate parser:
[0194] The server selects a parsing engine appropriate for the identified language. For example, for a Python program, it generates an abstract syntax tree (AST) using a parsing engine dedicated to Python (e.g., the AST module). The input is the language identification result and the source code content, and the output is the generated AST.
[0195] Step 3: Generate a flowchart
[0196] (Subject: Server)
[0197] 1. The server extracts the processing flow based on the parsing results:
[0198] The server extracts each function and major processing block based on the AST information obtained from the syntax analysis. The input is the AST, and the output is information about each function and processing block.
[0199] 2. The server draws the flowchart:
[0200] The server uses external libraries (e.g., Graphviz) to generate a flowchart that visually represents the extracted information. The input is the information of functions or processing blocks, and the output is a visual flowchart. For example, conditional branch points are drawn as diamonds, and processing blocks are drawn as rectangles.
[0201] Step 4: Generate a class diagram
[0202] (Subject: Server)
[0203] 1. The server analyzes class definitions and inheritance relationships:
[0204] For object-oriented programs, the server analyzes all classes and their inheritance relationships. The input is the AST, and the output is information about classes and inheritance relationships.
[0205] 2. The server draws the class diagram:
[0206] The server uses an external library (e.g., PlantUML) to visually draw class diagrams. The input is class and inheritance relationship information, and the output is a visual class diagram. The relationships and inheritance relationships between classes are visually represented.
[0207] Step 5: Generate instructions
[0208] (Subject: Server)
[0209] 1. The server describes what the function does:
[0210] The server describes the processing details and important steps of each function in natural language. The input is information about each function and process, and the output is the procedure described in natural language.
[0211] 2. The server generates instructions:
[0212] The server organizes the analysis results based on the procedure template and generates an easy-to-understand natural language procedure manual. The input is the natural language description and the procedure manual template, and the output is the final procedure manual.
[0213] Step 6: Delivering results
[0214] (Subject: terminal, user)
[0215] 1. The device displays the results to the user:
[0216] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The inputs are files and data of various products, and the output is a visual display on the user interface.
[0217] 2. User downloads the materials:
[0218] Users can download the displayed materials as needed. The server provides the generated materials in PDF or image format and returns a download link to the user. The input is a download request and the output is a download link.
[0219] (Application example 1)
[0220] 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."
[0221] The control programs of automated machines used in factories are often complex and contain vast amounts of information, requiring a great deal of time and effort to understand and maintain. Furthermore, the introduction of new programs and the updating of existing programs can be difficult, especially when different people are in charge. In these circumstances, there is a need for a method to easily and quickly understand the structure of control programs and to visualize and document their contents.
[0222] 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.
[0223] In this invention, the server includes means for receiving program source code, means for parsing the syntax of the received source code, and means for analyzing the control program of the automated factory machine and automatically generating visual and document materials, thereby enabling complex control programs to be easily and quickly understood and enabling the automatic generation of visual flowcharts, class diagrams, and procedure manuals.
[0224] "Program" means a set of instructions, including source code and its execution steps, that cause a computer or automated machine to perform a specific operation.
[0225] "Source code" is textual code that describes the behavior of a program and is written in a human-readable format.
[0226] "Syntax analysis" is the process of analyzing source code to understand its structure and meaning.
[0227] "Syntax analysis results" refers to the data or information obtained after syntactic analysis, and indicates the structure and processing flow of the source code.
[0228] A "flowchart" is a diagram that visually represents the processing steps of a program, showing the flow of functions and processing blocks.
[0229] A "class diagram" is a visual representation of classes, their attributes, methods, and the relationships between classes in an object-oriented program.
[0230] A "procedure manual" is a document that describes each process and important steps of a program in natural language.
[0231] "Factory automation" refers to machinery used to automate specific tasks within a factory.
[0232] "Analysis" is the act of investigating information or data and clarifying its structure and content.
[0233] "Visual materials" are data or information converted into a format that is easy to understand visually, and include things like flowcharts and class diagrams.
[0234] "Documentation" refers to written information in text format, including procedures and the like.
[0235] This invention relates to a system that analyzes the control programs of automated machines used in factories and automatically generates visual and written materials. This system greatly simplifies the understanding and maintenance of complex control programs, and makes it easy to introduce new programs and update them.
[0236] Overall system configuration
[0237] The system has the following main functions:
[0238] 1. Receiving the program source code
[0239] The server allows users to upload source code files they wish to analyze through a web interface.
[0240] 2. Parsing
[0241] The server passes the received source code to a dedicated parsing engine to analyze the program structure. In the case of Python programs, the server uses a dedicated parsing engine to generate an abstract syntax tree (AST).
[0242] 3. Flowchart generation
[0243] Based on the results of the syntax analysis, the server extracts each function and major processing block of the program, and generates a flowchart based on them. The flowchart is visually drawn using an external library (e.g., graphviz).
[0244] 4. Class diagram generation
[0245] For object-oriented programs, the server analyzes all classes and their inheritance relationships and generates a class diagram. It uses an external library (e.g., docx) to visually render the class diagram.
[0246] 5. Procedure generation
[0247] The server analyzes the abstract syntax tree and generates a procedure manual that describes each function and important steps of the program in natural language.
[0248] 6. Provision of Materials
[0249] The server provides the generated flowcharts, class diagrams, and procedures to the user and displays them in a downloadable format (e.g., PDF, image format).
[0250] Hardware and software used
[0251] The server uses hardware with a powerful processor and sufficient memory, and the following software:
[0252] Parsing engine: the ast module for Python programs
[0253] Flowchart generation: graphviz library
[0254] Class diagram generation: docx library
[0255] Instruction Generation: Custom parsing and generation algorithms
[0256] Specific examples
[0257] An example will be explained using the following source code:
[0258] Source code example:
[0259] def main():
[0260] start_robot()
[0261] move_robot()
[0262] stop_robot()
[0263] def start_robot():
[0264] print('Robot started')
[0265] def move_robot():
[0266] print('Robot moving')
[0267] def stop_robot():
[0268] print('Robot stopped')
[0269] if __name__ == "__main__":
[0270] main()
[0271] flowchart:
[0272] The server visually represents the calling relationship between the start_robot, move_robot, and stop_robot functions called within the main function.
[0273] Class diagram:
[0274] In this example, no classes are included, so no class diagram is generated.
[0275] Instructions:
[0276] The server generates instructions like this:
[0277] 1. The function start_robot displays the robot startup message.
[0278] 2. The function move_robot displays the robot's movement message.
[0279] 3. The function stop_robot displays a message that the robot has stopped.
[0280] 4. The main function controls the robot by following these steps:
[0281] Call start_robot to start the robot.
[0282] Call move_robot to move the robot.
[0283] Call stop_robot to stop the robot.
[0284] Prompt Sentence Examples
[0285] Please upload the source code to be analyzed.
[0286] As a result, the convenience of control programs within factories is improved, and developers can effectively introduce new programs and maintain existing programs.
[0287] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[0288] Step 1:
[0289] Users upload the source code files they wish to analyze through a web interface, where they select the desired source code files using a file selection dialog. The input is the source code file (e.g., a Python file), and the output is the source code data sent to the server.
[0290] Step 2:
[0291] The server saves the received source code file in temporary storage, obtains the saved file path, and prepares for the next process. The input is the source code data sent by the user, and the output is the file path saved in temporary storage.
[0292] Step 3:
[0293] The server passes the stored source code to a parsing engine for analysis. Specifically, it uses a parsing engine (e.g., the ast module for Python) to generate an Abstract Syntax Tree (AST). The input is the source code file path, and the output is an AST data structure.
[0294] Step 4:
[0295] The server extracts each function and major processing block of the program based on the AST data structure. At this stage, function definitions, conditional branches, loop structures, etc. are identified. The input is the AST data, and the output is a list of functions and processing blocks.
[0296] Step 5:
[0297] The server generates a flowchart based on the extracted information. It uses libraries such as graphviz to visually depict function calls and processing flows. The input is a list of functions and processing blocks, and the output is a flowchart image.
[0298] Step 6:
[0299] For object-oriented programs, the server analyzes all classes and their inheritance relationships from the AST data and generates a class diagram using the docx library. The input is the AST data and the output is a class diagram document.
[0300] Step 7:
[0301] The server generates a procedure manual that describes the processing details and important steps of each function in natural language. Specifically, it analyzes the AST data and describes the function's behavior in text format. The input is the AST data, and the output is text data that serves as the procedure manual.
[0302] Step 8:
[0303] The server provides the generated flowcharts, class diagrams, and procedure manuals to the user, who can then review them and download them as PDFs or images if necessary. The inputs are flowchart images, class diagram documents, and procedure manual text, and the output is a download link that is displayed to the user.
[0304] In this way, the server analyzes the source code at each step and generates and provides visual and text-based materials, making it easier to understand and maintain the control programs of automatic machines used in factories.
[0305] 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.
[0306] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. It also improves the user experience by combining it with an emotion engine that recognizes the user's emotions and adaptively changes the interface display content and the format of the generated materials based on the recognition results.
[0307] Overall system configuration
[0308] The system has the following main functions:
[0309] 1. Receiving source code (user uploads program)
[0310] 2. Parsing (the server analyzes the source code)
[0311] 3. Flowchart generation (the server visualizes the processing flow)
[0312] 4. Class diagram generation (the server visualizes object relationships)
[0313] 5. Procedure generation (the server describes the processing procedure in natural language)
[0314] 6. Providing the results (the device provides the generated data to the user)
[0315] 7. Emotion engine (the server recognizes the user's emotions and adaptively adjusts the interface and materials based on those emotions)
[0316] Program processing
[0317] Receiving the source code
[0318] The user uploads the source code file they wish to analyze through the web interface. For example, they select a Python file called "sample_program.py" and click the upload button. The server receives the uploaded source code and stores it in temporary storage.
[0319] Parsing
[0320] The server passes the received source code to the analysis engine, which automatically detects the programming language of the source code and begins analysis using the corresponding parser. For example, in the case of a Python program, the server uses a Python-specific parsing engine to generate an abstract syntax tree (AST).
[0321] Flowchart generation
[0322] The server extracts each function and major processing block of the program based on the results of syntax analysis. It then builds a flowchart data structure based on the extracted information and uses an external library to draw the flowchart. For example, it visually represents the processing flow, including conditional branching and loop structures.
[0323] Class diagram generation
[0324] For object-oriented programs, the server analyzes all classes and their inheritance relationships to generate a class diagram. It extracts class names, methods, properties, etc. and converts them into data structures for the class diagram. It uses an external library to visually draw the class diagram.
[0325] Procedure generation
[0326] The server generates a natural language description of each function's process and key steps, such as how the function normalize_data normalizes input data and how the function filter_data filters data.
[0327] Providing results
[0328] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[0329] Emotion Engine Operation
[0330] When a user uses the system, the server uses an emotion engine to recognize the user's emotions in real time. For example, it can detect when the user is impatient or irritated.
[0331] Based on the recognized emotion, the server adaptively changes the content displayed in the user interface. For example, if the user is impatient, the server simplifies the information and highlights important messages. It also adjusts the content of generated procedure manuals and flowcharts to help the user understand them better. For example, it adds detailed steps or emphasizes important points.
[0332] Specific examples
[0333] Below is an overview of the materials generated by this system, using the following Python source code as an example. For example, suppose you have the following Python code:
[0334] def normalize_data(data):
[0335] normalized_data = [x / max(data) for x in data]
[0336] return normalized_data
[0337] def filter_data(data):
[0338] filtered_data = [x for x in data if x > 0.5]
[0339] return filtered_data
[0340] def main():
[0341] raw_data = [10, 20, 30, 40, 50]
[0342] normalized_data = normalize_data(raw_data)
[0343] final_data = filter_data(normalized_data)
[0344] print(final_data)
[0345] if __name__ == "__main__":
[0346] main()
[0347] Based on this source code, the server generates the following materials:
[0348] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[0349] Class diagram: Not applicable, as this example does not contain any classes.
[0350] Instructions:
[0351] 1. The function normalize_data normalizes the input data.
[0352] 2. The function filter_data filters the normalized data.
[0353] 3. The main function processes the data as follows:
[0354] Create raw_data.
[0355] Call the normalize_data function to get normalized_data.
[0356] Call the filter_data function and get the final_data.
[0357] Output final_data.
[0358] The emotion engine recognizes the user's emotions and, if the user is feeling impatient, adds additional explanations to the instructions and emphasizes important parts. It also adjusts the flow charts and interface display to make them simpler and easier to understand.
[0359] In this way, users can easily understand the results of program analysis and share or take over efficiently without any special knowledge or effort.In addition, an adaptive interface that takes user emotions into consideration can improve the user experience.
[0360] The processing flow will be explained below.
[0361] Step 1:
[0362] The user uploads the source code file they wish to analyze through the web interface, for example, by selecting a Python file called "sample_program.py" and clicking the upload button.
[0363] Step 2:
[0364] The server receives the uploaded source code file, saves it in temporary storage, and notifies the user that the save is complete.
[0365] Step 3:
[0366] The server passes the received source code to a parsing engine, which automatically detects the programming language of the source code and begins parsing it using the corresponding parser. For example, in the case of a Python program, the server uses a parsing engine specifically designed for Python to generate an abstract syntax tree (AST).
[0367] Step 4:
[0368] The server parses the AST and extracts key functions and processing blocks, such as function definitions, conditional branches, and loop structures.
[0369] Step 5:
[0370] The server builds a flowchart data structure based on the analysis results. Each extracted function or processing block is modeled as a node, and the relationships between them are represented as edges.
[0371] Step 6:
[0372] The server uses an external library (e.g., Graphviz) to draw the flowchart and saves the generated results in temporary storage.
[0373] Step 7:
[0374] The server generates a class diagram based on the analysis results. If it is an object-oriented program, it extracts class names, methods, properties, inheritance relationships, etc. and converts them into a data structure for a class diagram. This can then be visualized using an external library (e.g., PlantUML).
[0375] Step 8:
[0376] The server generates a natural language procedural manual detailing each function's operation and key steps, for example, the function normalize_data performs data normalization, and the function filter_data performs filtering.
[0377] Step 9:
[0378] The server activates the emotion engine to recognize the user's emotions in real time. It uses a webcam and microphone to analyze the user's facial expressions and tone of voice to determine the user's emotions.
[0379] Step 10:
[0380] The server adaptively changes the content displayed in the user interface based on the recognized emotion. For example, if the user is feeling impatient, the screen display will be simplified and important messages will be highlighted.
[0381] Step 11:
[0382] The server adjusts the content and format of the instructions and flowcharts it generates based on the recognized emotions, for example adding additional explanations or annotations to instructions if the user is confused.
[0383] Step 12:
[0384] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[0385] Step 13:
[0386] Users can use the provided link to download the generated documents to their local environment and share them with their work or team members, preventing dependency on individual users and enabling efficient handover.
[0387] Example 2
[0388] 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."
[0389] Conventional program analysis systems are limited to analyzing source code and generating flowcharts, class diagrams, and procedure manuals. Furthermore, their user interfaces are fixed and cannot be flexibly adjusted according to the user's feelings and level of understanding. This can limit the user experience and hinder efficient work.
[0390] 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. In this invention, the server includes means for receiving program source code, means for parsing the received source code, means for generating a flowchart based on the parsing result, means for generating a class diagram based on the parsing result, means for generating a procedure manual based on the parsing result, means for enabling the user to download the generated flowchart, class diagram, and procedure manual, and means for recognizing the user's emotions and adaptively changing the interface and materials based on the recognition result. This makes it possible to adaptively adjust the interface and generated materials according to the user's emotions and level of understanding, thereby providing a more efficient and comfortable work environment.
[0391] "Program source code" means the text that describes a computer program, written in a particular programming language.
[0392] "Means for receiving source code" refers to the method or technology by which a computer system receives source code provided by a user.
[0393] "Means of parsing" refers to techniques and tools for analyzing source code and understanding its structure and meaning.
[0394] "Means for generating a flowchart" refers to the methods and techniques used to visually represent the processing flow of a program.
[0395] A "means for generating class diagrams" refers to a method or technique for visually representing the relationships between classes in an object-oriented program.
[0396] "Means for generating a procedure manual" refers to a method or technology for creating a document that describes the program's operations and processing procedures in natural language.
[0397] "Means for making the data downloadable" refers to methods and techniques that allow users to save the generated flowcharts, class diagrams, and procedures to their own computers.
[0398] "Means for recognizing emotions" refers to techniques and methods for identifying a user's emotional state by analyzing the user's facial expressions and operation patterns.
[0399] "Means for adaptively changing interfaces and materials" refers to techniques and methods for dynamically adjusting the display content and structure according to the user's emotions and situation.
[0400] "User" refers to a person who uses this system to check the analysis results of a program and generate materials.
[0401] "Server" refers to a computer system that provides this system and processes requests from users.
[0402] "Terminal" refers to a device such as a computer or smartphone that a user uses to access this system.
[0403] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. It also improves the user experience by combining an emotion engine that recognizes the user's emotions and adaptively changes the interface display content and the format of the generated materials based on the recognition results.
[0404] Overall system configuration
[0405] The system has the following main functions:
[0406] 1. Receiving source code (user uploads program)
[0407] 2. Parsing (the server analyzes the source code)
[0408] 3. Flowchart generation (the server visualizes the processing flow)
[0409] 4. Class diagram generation (the server visualizes object relationships)
[0410] 5. Procedure generation (the server describes the processing procedure in natural language)
[0411] 6. Providing the results (the device provides the generated data to the user)
[0412] 7. Emotion engine (the server recognizes the user's emotions and adaptively adjusts the interface and materials based on those emotions)
[0413] Hardware and software used
[0414] The server includes an analysis engine, a database, an emotion recognition system, and a diagram generation library. The analysis engine uses a Python-specific parsing engine. Graphviz and PlantUML are used for diagram generation, and computer vision technology is used for emotion recognition.
[0415] A terminal is a device, such as a computer or smartphone, that a user uses to operate a web interface, through which the user uploads source code and downloads artifacts.
[0416] Specific examples
[0417] For example, suppose you enter the following Python code:
[0418] def normalize_data(data):
[0419] normalized_data = [x / max(data) for x in data]
[0420] return normalized_data
[0421] def filter_data(data):
[0422] filtered_data = [x for x in data if x > 0.5]
[0423] return filtered_data
[0424] def main():
[0425] raw_data = [10, 20, 30, 40, 50]
[0426] normalized_data = normalize_data(raw_data)
[0427] final_data = filter_data(normalized_data)
[0428] print(final_data)
[0429] if __name__ == "__main__":
[0430] main()
[0431] Based on this source code, the server generates the following materials:
[0432] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[0433] Class diagram: Not applicable, as this example does not contain any classes.
[0434] Instructions:
[0435] 1. The function normalize_data normalizes the input data.
[0436] 2. The function filter_data filters the normalized data.
[0437] 3. The main function processes the data as follows:
[0438] Create raw_data.
[0439] Call the normalize_data function to get normalized_data.
[0440] Call the filter_data function and get the final_data.
[0441] Output final_data.
[0442] The emotion engine recognizes the user's emotions and, if the user is feeling impatient, adds supplementary explanations to the instructions and emphasizes important parts. It also adjusts the display content of flowcharts and interfaces to be simple and easy to understand. In this way, users can easily understand the results of program analysis without requiring special knowledge or effort, and can share and hand over the results efficiently. Furthermore, an adaptive interface that takes the user's emotions into account can improve the user experience.
[0443] The flow of the identification process in the second embodiment will be described with reference to FIG.
[0444] Step 1:
[0445] Selecting the input file
[0446] Using the web interface, users select the source code file they wish to analyze, for example a Python file called "sample_program.py," and click the upload button.
[0447] Input: Source code file (e.g. "sample_program.py")
[0448] Output: Source code files selected and ready to upload
[0449] Step 2:
[0450] Uploading a file
[0451] When the user clicks the upload button, the device sends the selected file to the server, which then stores the received file in temporary storage.
[0452] Input: Selected source code file
[0453] Output: Source code files uploaded to the server and saved in temporary storage
[0454] Step 3:
[0455] Identifying the programming language
[0456] The server automatically determines the programming language from the extension and header information of the received source code file. For example, ".py" is recognized as Python, and ".java (registered trademark)" is recognized as Java.
[0457] Input: Source code files stored on the server
[0458] Output: The identified programming language (e.g. Python)
[0459] Step 4:
[0460] Analysis engine selection
[0461] The server selects the parsing engine that corresponds to the identified programming language. For example, if the language is Python, it uses a parsing engine specifically for Python.
[0462] Input: The determined programming language
[0463] Output: Selected parsing engine (e.g., Python-specific parsing engine)
[0464] Step 5:
[0465] Abstract Syntax Tree Generation
[0466] The server uses the selected parsing engine to analyze the source code and generate an Abstract Syntax Tree (AST). In the case of Python, the AST is generated by the Python parsing engine.
[0467] Input: Source code files, selected analysis engine
[0468] Output: Abstract Syntax Tree (AST)
[0469] Step 6:
[0470] Extracting functions and processing blocks
[0471] The server extracts each function and major processing block from the parsed result, for example, identifying each function, loop, conditional branch, etc.
[0472] Input: Abstract Syntax Tree (AST)
[0473] Output: Information about extracted functions and processing blocks
[0474] Step 7:
[0475] Flowchart data structure construction
[0476] The server builds a flowchart data structure based on the extracted information. The data structure includes processing blocks as nodes and edges connecting them.
[0477] Input: Information about the extracted function or processing block
[0478] Output: Flowchart data structure
[0479] Step 8:
[0480] Drawing a flowchart
[0481] The server uses an external library (e.g., Graphviz) to visually draw the flowchart.
[0482] Input: Flowchart data structure
[0483] Output: A visually rendered flowchart
[0484] Step 9:
[0485] Class Relationship Analysis
[0486] The server analyzes all classes, their inheritance relationships, methods, and properties from the source code of an object-oriented program. For example, it extracts information such as class A inherits class B, and class B has five methods.
[0487] Input: Source code file
[0488] Output: Extracted class relationship information
[0489] Step 10:
[0490] Building data structures for class diagrams
[0491] The server constructs a data structure of a class diagram based on the extracted class relationship information.
[0492] Input: Extracted class relationship information
[0493] Output: Class diagram data structure
[0494] Step 11:
[0495] Drawing a class diagram
[0496] The server uses an external library (e.g., PlantUML) to visually draw class diagrams.
[0497] Input: Class diagram data structure
[0498] Output: A visually rendered class diagram
[0499] Step 12:
[0500] Description of processing content
[0501] The server generates a procedure that describes in natural language what each function does and the key steps it takes, for example, the function normalize_data normalizes the input data, and the function filter_data filters the data for specific conditions.
[0502] Input: Information about the extracted function or processing block
[0503] Output: Natural language instructions
[0504] Step 13:
[0505] View generated materials
[0506] The terminal displays the generated flowcharts, class diagrams, and procedures to the user, who can then check them and download them as needed.
[0507] Input: Flowcharts, class diagrams, procedures
[0508] Output: User-visible materials, downloadable links
[0509] Step 14:
[0510] Provide download links for materials
[0511] The server provides the generated materials in PDF or image format and returns a download link to the user.
[0512] Input: Flowcharts, class diagrams, procedures
[0513] Output: PDF and image documents, download links
[0514] Step 15:
[0515] Emotion recognition
[0516] When a user uses the system, the server uses an emotion engine to recognize emotions in real time from the user's facial expressions and operation patterns. For example, it analyzes "irritation" or "impatience" from the speed of camera and mouse operations.
[0517] Input: User's facial expression data and operation patterns
[0518] Output: Recognized user emotional state
[0519] Step 16:
[0520] Adaptive change of display content
[0521] Based on the recognized emotion, the server adaptively changes the content displayed in the user interface, for example, simplifying information and highlighting important messages if the user is impatient.
[0522] Input: Perceived emotional state of the user
[0523] Output: adaptively modified interface and document display
[0524] (Application example 2)
[0525] 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."
[0526] Conventional program analysis systems analyze program source code and automatically generate flowcharts, class diagrams, and procedure manuals, but they are unable to provide an adaptive interface that takes user emotions into account. Furthermore, they do not automatically generate security procedure manuals, which are particularly important for electronic payment systems. Therefore, there is a need for a method that not only improves user experience but also implements security measures efficiently and effectively.
[0527] 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.
[0528] In this invention, the server includes means for receiving program source code, means for parsing the received source code, means for generating a flowchart based on the parsing result, means for generating a class diagram based on the parsing result, means for generating a procedure manual based on the parsing result, means for making the generated flowchart, class diagram, and procedure manual available for download by users, means for recognizing user emotions and adaptively changing the display content of the interface and the format of the generated materials, means for generating a security procedure manual for the electronic payment system, and means for making the generated security procedure manual available for download by users. This improves the user experience and makes it possible to efficiently implement advanced security measures for the electronic payment system.
[0529] "Program source code" is a set of instructions written to implement a computer program.
[0530] "Means for receiving" refers to a device or program that has the function of taking in data transmitted from outside and storing or analyzing it.
[0531] "Syntax analysis" is the operation of analyzing the structure of a program's source code using a syntax analysis engine.
[0532] A "flowchart" is a diagram that visually represents the processing flow of a program or process.
[0533] A "class diagram" is a visual representation of the class structure and relationships in an object-oriented program.
[0534] A "procedure manual" is a document that describes in natural language the steps and methods for performing a specific task.
[0535] "Means for making the data available for download" refers to a function that allows users to save the generated data to their own devices.
[0536] "Means for recognizing user emotions" refers to technology that detects emotions from the user's facial expressions, voice, text data, etc.
[0537] "Means for adaptive change" is a function that dynamically changes the interface and output results based on the detected user emotions.
[0538] An "electronic payment system" is a system that processes payments electronically via a network such as the Internet.
[0539] A "security procedure manual" is a document that describes specific procedures and instructions for strengthening system security.
[0540] The objective of this invention is to provide a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. Furthermore, it aims to improve the user experience by recognizing the user's emotions and adaptively changing the interface display content and the format of the generated materials.
[0541] The entire system mainly functions among the three parties: the server, the terminal, and the user. A specific embodiment of the system is shown below.
[0542] System Configuration
[0543] The server includes means for receiving program source code, means for parsing the source code, means for generating flowcharts based on the analysis results, means for generating class diagrams, and means for generating procedure manuals. The server also includes means for recognizing user emotions and adaptively changing the interface and generated materials, and means for generating security procedure manuals for electronic payment systems. All generated materials are configured to be downloadable by users via their terminals.
[0544] Software Configuration
[0545] The main software running on the server includes:
[0546] 1. Flask: Used as a web framework, it receives source code files from users, processes emotion recognition results, and provides the generated results.
[0547] 2. EmotionEngine: A module for recognizing user emotions, analyzing facial expressions, voice, text data, etc. to identify the user's emotions.
[0548] 3. CodeAnalyzer: A module that analyzes source code syntax and automatically generates flowcharts, class diagrams, and procedure manuals.
[0549] Program processing
[0550] The process flow can be explained as follows: A user uploads the source code of an electronic payment system to the server via a smartphone application. The server receives the source code and performs syntax analysis using the CodeAnalyzer module. Based on the analysis results, a program flowchart, class diagram, and procedure manual are automatically generated.
[0551] The server simultaneously recognizes the user's emotions in real time using the EmotionEngine module. For example, if the user is feeling stressed, the server adaptively changes the generated results and interface to make them simpler and easier to understand. The generated flowcharts, class diagrams, procedure manuals, and security procedures manuals can then be downloaded by the user.
[0552] Specific examples
[0553] Here is a concrete example: A user is performing a security check on an electronic payment system and performs the following operations:
[0554] 1. The user launches the application and uploads the source code files.
[0555] 2. The server parses the received source code and generates flowcharts, class diagrams, and procedure manuals.
[0556] 3. The server uses the EmotionEngine to recognize the user's emotions and adaptively change the product and interface as needed.
[0557] 4. Finally, the generated materials are available for users to download.
[0558] Prompt Sentence Examples
[0559] "If you want to upload the source code of an electronic payment system and perform a security check, select the source code file and press the 'Upload' button. The system will automatically generate flowcharts and security procedures, and display them appropriately based on the user's emotions."
[0560] This system allows users to obtain analysis results of electronic payment systems quickly and adaptively, significantly improving safety and efficiency.
[0561] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[0562] Step 1:
[0563] A user launches the application, selects and uploads a source code file for an electronic payment system. The input is the source code file, which is sent to the server. The output is the state in which the server has received the source code file.
[0564] Step 2:
[0565] The server stores the received source code in temporary storage. The input is the uploaded source code file, and the output is the source code file stored in the server's temporary storage. This operation includes storing the binary data of the file.
[0566] Step 3:
[0567] The server passes the source code to the CodeAnalyzer module for syntax analysis. The input is the saved source code file, and the output is the analysis result of the source code (abstract syntax tree and symbol table). In this step, the structure of the program is analyzed.
[0568] Step 4:
[0569] The server generates flowcharts, class diagrams, and procedure manuals based on the analysis results of CodeAnalyzer. The input is the source code analysis results, and the output is flowcharts, class diagrams, and procedure manuals. Flowcharts visualize the program's processing flow, class diagrams show object relationships, and procedure manuals are documents that explain processing procedures in natural language.
[0570] Step 5:
[0571] The server uses the EmotionEngine module to recognize the user's emotions in real time. The input is emotional data such as the user's facial expressions, voice, and text data, and the output is the recognized emotional state (e.g., stress, relaxation, irritation, etc.). Specifically, data is collected using a camera and microphone.
[0572] Step 6:
[0573] The server adaptively changes the generated materials and interface based on the recognized emotions. The input is the recognized emotional state and the generated flowchart, class diagram, and procedure manual. The output is the display content and format of the materials adjusted according to the emotional state. For example, if stress is detected, the materials will be simplified and important parts will be highlighted.
[0574] Step 7:
[0575] The server generates links to provide the generated flowcharts, class diagrams, procedures, and security measures procedures to the user and sends them to the user's device. The input is the adjusted materials, and the output is a link that the user can download. Specifically, this includes converting the materials to PDF or image format and saving them in cloud storage.
[0576] Step 8:
[0577] The user can download the generated materials (flowcharts, class diagrams, procedures, and security procedures) via the provided link and use them to strengthen and understand the security of the system. The input is the download link, and the output is the materials saved in the user's local environment.
[0578] This allows users to quickly and adaptively obtain the results of source code analysis of electronic payment systems, which can be useful for security measures and system understanding.
[0579] 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.
[0580] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (registered trademark) (Internet search engine).<URL: https: / / openai.com / blog / chatgpt> ), Gemini (registered trademark) (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.
[0581] 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.
[0582] [Second embodiment]
[0583] FIG. 3 shows an example of the configuration of a data processing system 210 according to the second embodiment.
[0584] 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.
[0585] 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).
[0586] 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.
[0587] 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.
[0588] 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).
[0589] 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.
[0590] 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.
[0591] 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.
[0592] 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.
[0593] In the smart glasses 214, 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.
[0594] 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."
[0595] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. This system makes it easy to document programs that are dependent on individual users, and can significantly reduce the amount of work required for handover.
[0596] Overall system configuration
[0597] The system has the following main functions:
[0598] 1. Receiving source code (user uploads program)
[0599] 2. Parsing (the server analyzes the source code)
[0600] 3. Flowchart generation (the server visualizes the processing flow)
[0601] 4. Class diagram generation (the server visualizes object relationships)
[0602] 5. Procedure generation (the server describes the processing procedure in natural language)
[0603] 6. Providing the results (the device provides the generated data to the user)
[0604] Program processing
[0605] Receiving the source code
[0606] The user uploads the source code file they wish to analyze through a web interface. For example, they can select a Python source code file such as "sample_program.py." The server receives the uploaded source code and stores it in temporary storage.
[0607] Parsing
[0608] The server passes the received source code to the parsing engine, which automatically detects the language of the file and parses the source code using a parser appropriate for that language. For example, for a Python program, the server uses a Python-specific parsing engine to generate an abstract syntax tree (AST).
[0609] Flowchart generation
[0610] The server extracts each function and major processing block of the program based on the results of syntax analysis. It then builds a flowchart data structure based on the extracted information and uses an external library to draw the flowchart. For example, it visually represents the processing flow, including conditional branching and loop structures.
[0611] Class diagram generation
[0612] For object-oriented programs, the server analyzes all classes and their inheritance relationships to generate a class diagram. It extracts class names, methods, properties, etc. and converts them into data structures for the class diagram. It uses an external library to visually draw the class diagram.
[0613] Procedure generation
[0614] The server generates a natural language description of each function's process and key steps, such as how the function normalize_data normalizes input data and how the function filter_data filters data.
[0615] Providing results
[0616] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[0617] Specific examples
[0618] Below is an overview of the materials generated by this system, using the following Python source code as an example. For example, suppose you have the following Python code:
[0619] def normalize_data(data):
[0620] normalized_data = [x / max(data) for x in data]
[0621] return normalized_data
[0622] def filter_data(data):
[0623] filtered_data = [x for x in data if x > 0.5]
[0624] return filtered_data
[0625] def main():
[0626] raw_data = [10, 20, 30, 40, 50]
[0627] normalized_data = normalize_data(raw_data)
[0628] final_data = filter_data(normalized_data)
[0629] print(final_data)
[0630] if __name__ == "__main__":
[0631] main()
[0632] Based on this source code, the server generates the following materials:
[0633] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[0634] Class diagram: Not applicable, as this example does not contain any classes.
[0635] Instructions:
[0636] 1. The function normalize_data normalizes the input data.
[0637] 2. The function filter_data filters the normalized data.
[0638] 3. The main function processes the data as follows:
[0639] Create raw_data.
[0640] Call the normalize_data function to get normalized_data.
[0641] Call the filter_data function and get the final_data.
[0642] Output final_data.
[0643] In this way, users can easily understand the results of program analysis without any special knowledge or effort, and can share and take over efficiently.
[0644] The processing flow will be explained below.
[0645] Step 1:
[0646] The user uploads the source code file they wish to analyze through the web interface, for example, by selecting a Python file called "sample_program.py" and clicking the upload button.
[0647] Step 2:
[0648] The server receives the uploaded source code file, saves it in temporary storage, and notifies the user that the save is complete.
[0649] Step 3:
[0650] The server passes the received source code to the parsing engine, which automatically identifies the programming language of the source code and begins parsing it using the corresponding parser.
[0651] Step 4:
[0652] The server parses the source code, breaking it down into tokens and generating an Abstract Syntax Tree (AST). For Python programs, the AST is created using the ast module.
[0653] Step 5:
[0654] The server analyzes the AST and extracts key functions and processing blocks. Based on the extracted information, it builds a flowchart data structure. For example, it models conditional branches, loop structures, and other elements as nodes and edges that visually represent them.
[0655] Step 6:
[0656] The server draws the flowchart using an external library (e.g., Graphviz) and saves the generated results in temporary storage.
[0657] Step 7:
[0658] If the server is also an object-oriented program, it analyzes all classes and their relationships, extracting class names, methods, properties, and inheritance relationships, and converting them into a data structure for a class diagram.
[0659] Step 8:
[0660] The server draws the class diagram using an external library (e.g., PlantUML) and saves the generated results in temporary storage.
[0661] Step 9:
[0662] The server generates a procedure manual that describes the processing flow for each function in natural language. It analyzes the role and operation procedures of each function and creates a procedure manual as a summary.
[0663] Step 10:
[0664] The server converts the generated flowcharts, class diagrams, and procedure manuals into PDF or image format and generates a download link.
[0665] Step 11:
[0666] The terminal provides the link of the generated material from the server to the user, and the user uses the provided link to download the required material and save it in the local environment.
[0667] Step 12:
[0668] Users can check the downloaded materials and share them with their own work or team members, which prevents dependency on individual people and enables efficient handover.
[0669] Example 1
[0670] 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."
[0671] Traditionally, documenting program source code has been a time-consuming and labor-intensive process, and the resulting documentation often contains subjective descriptions, resulting in inconsistent quality. This has resulted in difficulties in program handover and maintenance, leading to inefficient work. It has also been difficult to quickly understand the overall structure and main processing content of a program. Therefore, there is a need for a system that can automatically generate flowcharts, class diagrams, and procedure manuals from source code analysis, providing consistent documentation.
[0672] 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.
[0673] In this invention, the server includes means for receiving program source code, means for automatically determining the language of the received source code, means for syntactically analyzing the received source code and generating an abstract syntax tree, means for extracting each function and major processing blocks, means for generating a flowchart based on the extracted information, means for analyzing the classes and inheritance relationships of an object-oriented program and generating a class diagram, means for generating a procedure manual that describes the processing content and important steps of each function in natural language, means for making the generated flowcharts, class diagrams, and procedure manuals available for download by users, means for allowing users to select and specify programs by uploading source code, and means for a syntax analysis engine that supports multiple languages and selects an appropriate parser based on the file extension and content to perform syntax analysis.This automatically generates high-quality documentation from the program source code, allowing users to quickly and efficiently understand the overall structure and major processing content of the program.
[0674] "Program source code" means the textual instructions that describe a computer program.
[0675] The "means for receiving" is a mechanism that has the function of receiving data sent from a user and storing it in temporary storage for use in processing.
[0676] "Means for automatic language detection" is a function that automatically identifies the programming language from the file extension and contents of the source code, and selects the appropriate analysis method based on the results.
[0677] "Syntax analysis" is the process of analyzing the grammar and structure of program source code and is a method of generating an abstract syntax tree (AST).
[0678] An "abstract syntax tree (AST)" is a data structure that represents the syntactic structure of source code as a tree structure, with each node representing a program element (such as a statement or expression).
[0679] "Means for extracting each function and major processing block" is a function that automatically extracts each function and processing element within a program from the results of syntax analysis.
[0680] A "flowchart" is a diagram that visually represents the processing flow of a program, and shows the order of processing, branches, and loops.
[0681] A "class diagram" is a diagram that visually represents the structure of classes and the relationships between them in an object-oriented program.
[0682] A "procedure manual" is a document that describes each function and processing procedure of a program in natural language.
[0683] "Means for generating procedures written in natural language" refers to a function that organizes and describes each function and processing content of a program in natural language based on the analysis results.
[0684] "Means for making documents and diagrams available for download" refers to the function of providing a link or button that allows users to easily obtain the generated documents and diagrams.
[0685] The "means by which a user can select and specify a program through uploading" is an interface that allows a user to select the source code file of a program that they wish to analyze and send it via the online system.
[0686] A "syntax parsing engine" is a software component that analyzes source code according to the grammar of a particular programming language and generates an abstract syntax tree.
[0687] "Supporting multiple languages" means supporting a variety of programming languages and having the ability to perform analysis according to the characteristics of each language.
[0688] "Selecting an appropriate parser" is the process of determining the language of the source code, then selecting a parser specialized for that language to perform accurate parsing.
[0689] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. This system makes it easy to document programs that are dependent on individual users, and can significantly reduce the amount of work required for handover.
[0690] System Overview
[0691] The system of the present invention is composed of three main entities: a server, a terminal, and a user. The roles of each are explained below.
[0692] Server Roles
[0693] The server plays a central role in receiving source code provided by users and automatically generating various documents based on it. Specifically, it has the following functions:
[0694] 1. Receiving the Source Code:
[0695] The server receives source code files uploaded by users through a web interface and stores them in temporary storage, during which the files are also checked for integrity and scanned for viruses.
[0696] 2. Parsing:
[0697] The server automatically determines the language of the received source code and selects an appropriate parsing engine based on the results. For example, in the case of Python, it uses a Python-specific parsing engine (e.g., AST module) to generate an abstract syntax tree (AST).
[0698] 3. Flowchart generation:
[0699] The server extracts each function and major processing block based on the parsing results, and generates a flowchart based on that information, which is then visually represented using an external library (e.g., Graphviz).
[0700] 4. Class diagram generation:
[0701] For object-oriented programs, the server analyzes all classes and their inheritance relationships and generates a class diagram, which is visually drawn using an external library (e.g., PlantUML).
[0702] 5. Procedure generation:
[0703] Generates a procedure manual that describes the processing details and important steps of each function in natural language. Organizes the analysis results and provides them as an easy-to-understand natural language procedure manual.
[0704] 6. Results provided:
[0705] The server saves the generated flowcharts, class diagrams, and procedure manuals in PDF or image format and generates a link that allows users to download them.
[0706] Device Role
[0707] The terminal provides an interface through which users can access the system, upload source code, and view and download generated documentation.
[0708] 1. User Interface:
[0709] The terminal provides the user with an interface through a web browser, allowing them to upload source code, view documentation, and download it.
[0710] User Roles
[0711] Users upload the source code they wish to analyze and can then review and download the generated flowcharts, class diagrams, and procedure manuals.
[0712] Specific examples
[0713] Here we will use some Python source code as an example to explain how this system works.
[0714] Suppose you have the following Python code:
[0715] def normalize_data(data):
[0716] normalized_data = [x / max(data) for x in data]
[0717] return normalized_data
[0718] def filter_data(data):
[0719] filtered_data = [x for x in data if x > 0.5]
[0720] return filtered_data
[0721] def main():
[0722] raw_data = [10, 20, 30, 40, 50]
[0723] normalized_data = normalize_data(raw_data)
[0724] final_data = filter_data(normalized_data)
[0725] print(final_data)
[0726] if __name__ == "__main__":
[0727] main()
[0728] An example of the prompt when uploading this source code is as follows:
[0729] Analyze Python source code and generate flowcharts and instructions, including the auto-detected file language and the parsing engine used.
[0730] The system of the present invention automatically generates the following materials from this source code:
[0731] Flowchart: Visualizes each function and its processing flow, showing the execution flow of the main() function.
[0732] Class diagram: Not applicable, as this example does not contain any classes.
[0733] Instructions:
[0734] 1. The function normalize_data normalizes the input data.
[0735] 2. The function filter_data filters the normalized data.
[0736] 3. The main function processes the data as follows:
[0737] Create raw_data.
[0738] Call the normalize_data function to get normalized_data.
[0739] Call the filter_data function and get the final_data.
[0740] Output final_data.
[0741] Through the above process, users can easily understand the results of program analysis without any special knowledge or effort, and can share and take over efficiently.
[0742] The flow of the identification process in the first embodiment will be described with reference to FIG.
[0743] Step 1: Receive the source code
[0744] (Subject: User, Server)
[0745] 1. User uploads source code file:
[0746] The user uses a web interface to upload the source code file they want to analyze to the server. For example, they select a Python file called "sample_program.py." The input is the source code file, and the output is the file sent to the server.
[0747] 2. The server receives and saves the file:
[0748] The server receives source code files uploaded by users and stores them in temporary storage. The input is the file sent by the user, and the output is the saved file. File integrity checks and virus scans are also performed in this step.
[0749] Step 2: Parsing
[0750] (Subject: Server)
[0751] 1. The server determines the file type:
[0752] The server automatically determines the programming language from the extension and content of the received source code file. The input is the saved source code file, and the output is the language determination result (e.g., Python).
[0753] 2. The server parses it with the appropriate parser:
[0754] The server selects a parsing engine appropriate for the identified language. For example, for a Python program, it generates an abstract syntax tree (AST) using a parsing engine dedicated to Python (e.g., the AST module). The input is the language identification result and the source code content, and the output is the generated AST.
[0755] Step 3: Generate a flowchart
[0756] (Subject: Server)
[0757] 1. The server extracts the processing flow based on the parsing results:
[0758] The server extracts each function and major processing block based on the AST information obtained from the syntax analysis. The input is the AST, and the output is information about each function and processing block.
[0759] 2. The server draws the flowchart:
[0760] The server uses external libraries (e.g., Graphviz) to generate a flowchart that visually represents the extracted information. The input is the information of functions or processing blocks, and the output is a visual flowchart. For example, conditional branch points are drawn as diamonds, and processing blocks are drawn as rectangles.
[0761] Step 4: Generate a class diagram
[0762] (Subject: Server)
[0763] 1. The server analyzes class definitions and inheritance relationships:
[0764] For object-oriented programs, the server analyzes all classes and their inheritance relationships. The input is the AST, and the output is information about classes and inheritance relationships.
[0765] 2. The server draws the class diagram:
[0766] The server uses an external library (e.g., PlantUML) to visually draw class diagrams. The input is class and inheritance relationship information, and the output is a visual class diagram. The relationships and inheritance relationships between classes are visually represented.
[0767] Step 5: Generate instructions
[0768] (Subject: Server)
[0769] 1. The server describes what the function does:
[0770] The server describes the processing details and important steps of each function in natural language. The input is information about each function and process, and the output is the procedure described in natural language.
[0771] 2. The server generates instructions:
[0772] The server organizes the analysis results based on the procedure template and generates an easy-to-understand natural language procedure manual. The input is the natural language description and the procedure manual template, and the output is the final procedure manual.
[0773] Step 6: Delivering results
[0774] (Subject: terminal, user)
[0775] 1. The device displays the results to the user:
[0776] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The inputs are files and data of various products, and the output is a visual display on the user interface.
[0777] 2. User downloads the materials:
[0778] Users can download the displayed materials as needed. The server provides the generated materials in PDF or image format and returns a download link to the user. The input is a download request and the output is a download link.
[0779] (Application example 1)
[0780] 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."
[0781] The control programs of automated machines used in factories are often complex and contain vast amounts of information, requiring a great deal of time and effort to understand and maintain. Furthermore, the introduction of new programs and the updating of existing programs can be difficult, especially when different people are in charge. In these circumstances, there is a need for a method to easily and quickly understand the structure of control programs and to visualize and document their contents.
[0782] 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.
[0783] In this invention, the server includes means for receiving program source code, means for parsing the syntax of the received source code, and means for analyzing the control program of the automated factory machine and automatically generating visual and document materials, thereby enabling complex control programs to be easily and quickly understood and enabling the automatic generation of visual flowcharts, class diagrams, and procedure manuals.
[0784] "Program" means a set of instructions, including source code and its execution steps, that cause a computer or automated machine to perform a specific operation.
[0785] "Source code" is textual code that describes the behavior of a program and is written in a human-readable format.
[0786] "Syntax analysis" is the process of analyzing source code to understand its structure and meaning.
[0787] "Syntax analysis results" refers to the data or information obtained after syntactic analysis, and indicates the structure and processing flow of the source code.
[0788] A "flowchart" is a diagram that visually represents the processing steps of a program, showing the flow of functions and processing blocks.
[0789] A "class diagram" is a visual representation of classes, their attributes, methods, and the relationships between classes in an object-oriented program.
[0790] A "procedure manual" is a document that describes each process and important steps of a program in natural language.
[0791] "Factory automation" refers to machinery used to automate specific tasks within a factory.
[0792] "Analysis" is the act of investigating information or data and clarifying its structure and content.
[0793] "Visual materials" are data or information converted into a format that is easy to understand visually, and include things like flowcharts and class diagrams.
[0794] "Documentation" refers to written information in text format, including procedures and the like.
[0795] This invention relates to a system that analyzes the control programs of automated machines used in factories and automatically generates visual and written materials. This system greatly simplifies the understanding and maintenance of complex control programs, and makes it easy to introduce new programs and update them.
[0796] Overall system configuration
[0797] The system has the following main functions:
[0798] 1. Receiving the program source code
[0799] The server allows users to upload source code files they wish to analyze through a web interface.
[0800] 2. Parsing
[0801] The server passes the received source code to a dedicated parsing engine to analyze the program structure. In the case of Python programs, the server uses a dedicated parsing engine to generate an abstract syntax tree (AST).
[0802] 3. Flowchart generation
[0803] Based on the results of the syntax analysis, the server extracts each function and major processing block of the program, and generates a flowchart based on them. The flowchart is visually drawn using an external library (e.g., graphviz).
[0804] 4. Class diagram generation
[0805] For object-oriented programs, the server analyzes all classes and their inheritance relationships and generates a class diagram. It uses an external library (e.g., docx) to visually render the class diagram.
[0806] 5. Procedure generation
[0807] The server analyzes the abstract syntax tree and generates a procedure manual that describes each function and important steps of the program in natural language.
[0808] 6. Provision of Materials
[0809] The server provides the generated flowcharts, class diagrams, and procedures to the user and displays them in a downloadable format (e.g., PDF, image format).
[0810] Hardware and software used
[0811] The server uses hardware with a powerful processor and sufficient memory, and the following software:
[0812] Parsing engine: the ast module for Python programs
[0813] Flowchart generation: graphviz library
[0814] Class diagram generation: docx library
[0815] Instruction Generation: Custom parsing and generation algorithms
[0816] Specific examples
[0817] An example will be explained using the following source code:
[0818] Source code example:
[0819] def main():
[0820] start_robot()
[0821] move_robot()
[0822] stop_robot()
[0823] def start_robot():
[0824] print('Robot started')
[0825] def move_robot():
[0826] print('Robot moving')
[0827] def stop_robot():
[0828] print('Robot stopped')
[0829] if __name__ == "__main__":
[0830] main()
[0831] flowchart:
[0832] The server visually represents the calling relationship between the start_robot, move_robot, and stop_robot functions called within the main function.
[0833] Class diagram:
[0834] In this example, no classes are included, so no class diagram is generated.
[0835] Instructions:
[0836] The server generates instructions like this:
[0837] 1. The function start_robot displays the robot startup message.
[0838] 2. The function move_robot displays the robot's movement message.
[0839] 3. The function stop_robot displays a message that the robot has stopped.
[0840] 4. The main function controls the robot by following these steps:
[0841] Call start_robot to start the robot.
[0842] Call move_robot to move the robot.
[0843] Call stop_robot to stop the robot.
[0844] Prompt Sentence Examples
[0845] Please upload the source code to be analyzed.
[0846] As a result, the convenience of control programs within factories is improved, and developers can effectively introduce new programs and maintain existing programs.
[0847] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[0848] Step 1:
[0849] Users upload the source code files they wish to analyze through a web interface, where they select the desired source code files using a file selection dialog. The input is the source code file (e.g., a Python file), and the output is the source code data sent to the server.
[0850] Step 2:
[0851] The server saves the received source code file in temporary storage, obtains the saved file path, and prepares for the next process. The input is the source code data sent by the user, and the output is the file path saved in temporary storage.
[0852] Step 3:
[0853] The server passes the stored source code to a parsing engine for analysis. Specifically, it uses a parsing engine (e.g., the ast module for Python) to generate an Abstract Syntax Tree (AST). The input is the source code file path, and the output is an AST data structure.
[0854] Step 4:
[0855] The server extracts each function and major processing block of the program based on the AST data structure. At this stage, function definitions, conditional branches, loop structures, etc. are identified. The input is the AST data, and the output is a list of functions and processing blocks.
[0856] Step 5:
[0857] The server generates a flowchart based on the extracted information. It uses libraries such as graphviz to visually depict function calls and processing flows. The input is a list of functions and processing blocks, and the output is a flowchart image.
[0858] Step 6:
[0859] For object-oriented programs, the server analyzes all classes and their inheritance relationships from the AST data and generates a class diagram using the docx library. The input is the AST data and the output is a class diagram document.
[0860] Step 7:
[0861] The server generates a procedure manual that describes the processing details and important steps of each function in natural language. Specifically, it analyzes the AST data and describes the function's behavior in text format. The input is the AST data, and the output is text data that serves as the procedure manual.
[0862] Step 8:
[0863] The server provides the generated flowcharts, class diagrams, and procedure manuals to the user, who can then review them and download them as PDFs or images if necessary. The inputs are flowchart images, class diagram documents, and procedure manual text, and the output is a download link that is displayed to the user.
[0864] In this way, the server analyzes the source code at each step and generates and provides visual and text-based materials, making it easier to understand and maintain the control programs of automatic machines used in factories.
[0865] 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.
[0866] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. It also improves the user experience by combining it with an emotion engine that recognizes the user's emotions and adaptively changes the interface display content and the format of the generated materials based on the recognition results.
[0867] Overall system configuration
[0868] The system has the following main functions:
[0869] 1. Receiving source code (user uploads program)
[0870] 2. Parsing (the server analyzes the source code)
[0871] 3. Flowchart generation (the server visualizes the processing flow)
[0872] 4. Class diagram generation (the server visualizes object relationships)
[0873] 5. Procedure generation (the server describes the processing procedure in natural language)
[0874] 6. Providing the results (the device provides the generated data to the user)
[0875] 7. Emotion engine (the server recognizes the user's emotions and adaptively adjusts the interface and materials based on those emotions)
[0876] Program processing
[0877] Receiving the source code
[0878] The user uploads the source code file they wish to analyze through the web interface. For example, they select a Python file called "sample_program.py" and click the upload button. The server receives the uploaded source code and stores it in temporary storage.
[0879] Parsing
[0880] The server passes the received source code to the analysis engine, which automatically detects the programming language of the source code and begins analysis using the corresponding parser. For example, in the case of a Python program, the server uses a Python-specific parsing engine to generate an abstract syntax tree (AST).
[0881] Flowchart generation
[0882] The server extracts each function and major processing block of the program based on the results of syntax analysis. It then builds a flowchart data structure based on the extracted information and uses an external library to draw the flowchart. For example, it visually represents the processing flow, including conditional branching and loop structures.
[0883] Class diagram generation
[0884] For object-oriented programs, the server analyzes all classes and their inheritance relationships to generate a class diagram. It extracts class names, methods, properties, etc. and converts them into data structures for the class diagram. It uses an external library to visually draw the class diagram.
[0885] Procedure generation
[0886] The server generates a natural language description of each function's process and key steps, such as how the function normalize_data normalizes input data and how the function filter_data filters data.
[0887] Providing results
[0888] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[0889] Emotion Engine Operation
[0890] When a user uses the system, the server uses an emotion engine to recognize the user's emotions in real time. For example, it can detect when the user is impatient or irritated.
[0891] Based on the recognized emotion, the server adaptively changes the content displayed in the user interface. For example, if the user is impatient, the server simplifies the information and highlights important messages. It also adjusts the content of generated procedure manuals and flowcharts to help the user understand them better. For example, it adds detailed steps or emphasizes important points.
[0892] Specific examples
[0893] Below is an overview of the materials generated by this system, using the following Python source code as an example. For example, suppose you have the following Python code:
[0894] def normalize_data(data):
[0895] normalized_data = [x / max(data) for x in data]
[0896] return normalized_data
[0897] def filter_data(data):
[0898] filtered_data = [x for x in data if x > 0.5]
[0899] return filtered_data
[0900] def main():
[0901] raw_data = [10, 20, 30, 40, 50]
[0902] normalized_data = normalize_data(raw_data)
[0903] final_data = filter_data(normalized_data)
[0904] print(final_data)
[0905] if __name__ == "__main__":
[0906] main()
[0907] Based on this source code, the server generates the following materials:
[0908] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[0909] Class diagram: Not applicable, as this example does not contain any classes.
[0910] Instructions:
[0911] 1. The function normalize_data normalizes the input data.
[0912] 2. The function filter_data filters the normalized data.
[0913] 3. The main function processes the data as follows:
[0914] Create raw_data.
[0915] Call the normalize_data function to get normalized_data.
[0916] Call the filter_data function and get the final_data.
[0917] Output final_data.
[0918] The emotion engine recognizes the user's emotions and, if the user is feeling impatient, adds additional explanations to the instructions and emphasizes important parts. It also adjusts the flow charts and interface display to make them simpler and easier to understand.
[0919] In this way, users can easily understand the results of program analysis and share or take over efficiently without any special knowledge or effort.In addition, an adaptive interface that takes user emotions into consideration can improve the user experience.
[0920] The processing flow will be explained below.
[0921] Step 1:
[0922] The user uploads the source code file they wish to analyze through the web interface, for example, by selecting a Python file called "sample_program.py" and clicking the upload button.
[0923] Step 2:
[0924] The server receives the uploaded source code file, saves it in temporary storage, and notifies the user that the save is complete.
[0925] Step 3:
[0926] The server passes the received source code to a parsing engine, which automatically detects the programming language of the source code and begins parsing it using the corresponding parser. For example, in the case of a Python program, the server uses a parsing engine specifically designed for Python to generate an abstract syntax tree (AST).
[0927] Step 4:
[0928] The server parses the AST and extracts key functions and processing blocks, such as function definitions, conditional branches, and loop structures.
[0929] Step 5:
[0930] The server builds a flowchart data structure based on the analysis results. Each extracted function or processing block is modeled as a node, and the relationships between them are represented as edges.
[0931] Step 6:
[0932] The server uses an external library (e.g., Graphviz) to draw the flowchart and saves the generated results in temporary storage.
[0933] Step 7:
[0934] The server generates a class diagram based on the analysis results. If it is an object-oriented program, it extracts class names, methods, properties, inheritance relationships, etc. and converts them into a data structure for a class diagram. This can then be visualized using an external library (e.g., PlantUML).
[0935] Step 8:
[0936] The server generates a natural language procedural manual detailing each function's operation and key steps, for example, the function normalize_data performs data normalization, and the function filter_data performs filtering.
[0937] Step 9:
[0938] The server activates the emotion engine to recognize the user's emotions in real time. It uses a webcam and microphone to analyze the user's facial expressions and tone of voice to determine the user's emotions.
[0939] Step 10:
[0940] The server adaptively changes the content displayed in the user interface based on the recognized emotion. For example, if the user is feeling impatient, the screen display will be simplified and important messages will be highlighted.
[0941] Step 11:
[0942] The server adjusts the content and format of the instructions and flowcharts it generates based on the recognized emotions, for example adding additional explanations or annotations to instructions if the user is confused.
[0943] Step 12:
[0944] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[0945] Step 13:
[0946] Users can use the provided link to download the generated documents to their local environment and share them with their work or team members, preventing dependency on individual users and enabling efficient handover.
[0947] Example 2
[0948] 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."
[0949] Conventional program analysis systems are limited to analyzing source code and generating flowcharts, class diagrams, and procedure manuals. Furthermore, their user interfaces are fixed and cannot be flexibly adjusted according to the user's feelings and level of understanding. This can limit the user experience and hinder efficient work.
[0950] 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. In this invention, the server includes means for receiving program source code, means for parsing the received source code, means for generating a flowchart based on the parsing result, means for generating a class diagram based on the parsing result, means for generating a procedure manual based on the parsing result, means for enabling the user to download the generated flowchart, class diagram, and procedure manual, and means for recognizing the user's emotions and adaptively changing the interface and materials based on the recognition result. This makes it possible to adaptively adjust the interface and generated materials according to the user's emotions and level of understanding, thereby providing a more efficient and comfortable work environment.
[0951] "Program source code" means the text that describes a computer program, written in a particular programming language.
[0952] "Means for receiving source code" refers to the method or technology by which a computer system receives source code provided by a user.
[0953] "Means of parsing" refers to techniques and tools for analyzing source code and understanding its structure and meaning.
[0954] "Means for generating a flowchart" refers to the methods and techniques used to visually represent the processing flow of a program.
[0955] A "means for generating class diagrams" refers to a method or technique for visually representing the relationships between classes in an object-oriented program.
[0956] "Means for generating a procedure manual" refers to a method or technology for creating a document that describes the program's operations and processing procedures in natural language.
[0957] "Means for making the data downloadable" refers to methods and techniques that allow users to save the generated flowcharts, class diagrams, and procedures to their own computers.
[0958] "Means for recognizing emotions" refers to techniques and methods for identifying a user's emotional state by analyzing the user's facial expressions and operation patterns.
[0959] "Means for adaptively changing interfaces and materials" refers to techniques and methods for dynamically adjusting the display content and structure according to the user's emotions and situation.
[0960] "User" refers to a person who uses this system to check the analysis results of a program and generate materials.
[0961] "Server" refers to a computer system that provides this system and processes requests from users.
[0962] "Terminal" refers to a device such as a computer or smartphone that a user uses to access this system.
[0963] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. It also improves the user experience by combining an emotion engine that recognizes the user's emotions and adaptively changes the interface display content and the format of the generated materials based on the recognition results.
[0964] Overall system configuration
[0965] The system has the following main functions:
[0966] 1. Receiving source code (user uploads program)
[0967] 2. Parsing (the server analyzes the source code)
[0968] 3. Flowchart generation (the server visualizes the processing flow)
[0969] 4. Class diagram generation (the server visualizes object relationships)
[0970] 5. Procedure generation (the server describes the processing procedure in natural language)
[0971] 6. Providing the results (the device provides the generated data to the user)
[0972] 7. Emotion engine (the server recognizes the user's emotions and adaptively adjusts the interface and materials based on those emotions)
[0973] Hardware and software used
[0974] The server includes an analysis engine, a database, an emotion recognition system, and a diagram generation library. The analysis engine uses a Python-specific parsing engine. Graphviz and PlantUML are used for diagram generation, and computer vision technology is used for emotion recognition.
[0975] A terminal is a device, such as a computer or smartphone, that a user uses to operate a web interface, through which the user uploads source code and downloads artifacts.
[0976] Specific examples
[0977] For example, suppose you enter the following Python code:
[0978] def normalize_data(data):
[0979] normalized_data = [x / max(data) for x in data]
[0980] return normalized_data
[0981] def filter_data(data):
[0982] filtered_data = [x for x in data if x > 0.5]
[0983] return filtered_data
[0984] def main():
[0985] raw_data = [10, 20, 30, 40, 50]
[0986] normalized_data = normalize_data(raw_data)
[0987] final_data = filter_data(normalized_data)
[0988] print(final_data)
[0989] if __name__ == "__main__":
[0990] main()
[0991] Based on this source code, the server generates the following materials:
[0992] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[0993] Class diagram: Not applicable, as this example does not contain any classes.
[0994] Instructions:
[0995] 1. The function normalize_data normalizes the input data.
[0996] 2. The function filter_data filters the normalized data.
[0997] 3. The main function processes the data as follows:
[0998] Create raw_data.
[0999] Call the normalize_data function to get normalized_data.
[1000] Call the filter_data function and get the final_data.
[1001] Output final_data.
[1002] The emotion engine recognizes the user's emotions and, if the user is feeling impatient, adds supplementary explanations to the instructions and emphasizes important parts. It also adjusts the display content of flowcharts and interfaces to be simple and easy to understand. In this way, users can easily understand the results of program analysis without requiring special knowledge or effort, and can share and hand over the results efficiently. Furthermore, an adaptive interface that takes the user's emotions into account can improve the user experience.
[1003] The flow of the identification process in the second embodiment will be described with reference to FIG.
[1004] Step 1:
[1005] Selecting the input file
[1006] Using the web interface, users select the source code file they wish to analyze, for example a Python file called "sample_program.py," and click the upload button.
[1007] Input: Source code file (e.g. "sample_program.py")
[1008] Output: Source code files selected and ready to upload
[1009] Step 2:
[1010] Uploading a file
[1011] When the user clicks the upload button, the device sends the selected file to the server, which then stores the received file in temporary storage.
[1012] Input: Selected source code file
[1013] Output: Source code files uploaded to the server and saved in temporary storage
[1014] Step 3:
[1015] Identifying the programming language
[1016] The server automatically determines the programming language from the extension and header information of the received source code file. For example, ".py" is recognized as Python, and ".java" as Java.
[1017] Input: Source code files stored on the server
[1018] Output: The identified programming language (e.g. Python)
[1019] Step 4:
[1020] Analysis engine selection
[1021] The server selects the parsing engine that corresponds to the identified programming language. For example, if the language is Python, it uses a parsing engine specifically for Python.
[1022] Input: The determined programming language
[1023] Output: Selected parsing engine (e.g., Python-specific parsing engine)
[1024] Step 5:
[1025] Abstract Syntax Tree Generation
[1026] The server uses the selected parsing engine to analyze the source code and generate an Abstract Syntax Tree (AST). In the case of Python, the AST is generated by the Python parsing engine.
[1027] Input: Source code files, selected analysis engine
[1028] Output: Abstract Syntax Tree (AST)
[1029] Step 6:
[1030] Extracting functions and processing blocks
[1031] The server extracts each function and major processing block from the parsed result, for example, identifying each function, loop, conditional branch, etc.
[1032] Input: Abstract Syntax Tree (AST)
[1033] Output: Information about extracted functions and processing blocks
[1034] Step 7:
[1035] Flowchart data structure construction
[1036] The server builds a flowchart data structure based on the extracted information. The data structure includes processing blocks as nodes and edges connecting them.
[1037] Input: Information about the extracted function or processing block
[1038] Output: Flowchart data structure
[1039] Step 8:
[1040] Drawing a flowchart
[1041] The server uses an external library (e.g., Graphviz) to visually draw the flowchart.
[1042] Input: Flowchart data structure
[1043] Output: A visually rendered flowchart
[1044] Step 9:
[1045] Class Relationship Analysis
[1046] The server analyzes all classes, their inheritance relationships, methods, and properties from the source code of an object-oriented program. For example, it extracts information such as class A inherits class B, and class B has five methods.
[1047] Input: Source code file
[1048] Output: Extracted class relationship information
[1049] Step 10:
[1050] Building data structures for class diagrams
[1051] The server constructs a data structure of a class diagram based on the extracted class relationship information.
[1052] Input: Extracted class relationship information
[1053] Output: Class diagram data structure
[1054] Step 11:
[1055] Drawing a class diagram
[1056] The server uses an external library (e.g., PlantUML) to visually draw class diagrams.
[1057] Input: Class diagram data structure
[1058] Output: A visually rendered class diagram
[1059] Step 12:
[1060] Description of processing content
[1061] The server generates a procedure that describes in natural language what each function does and the key steps it takes, for example, the function normalize_data normalizes the input data, and the function filter_data filters the data for specific conditions.
[1062] Input: Information about the extracted function or processing block
[1063] Output: Natural language instructions
[1064] Step 13:
[1065] View generated materials
[1066] The terminal displays the generated flowcharts, class diagrams, and procedures to the user, who can then check them and download them as needed.
[1067] Input: Flowcharts, class diagrams, procedures
[1068] Output: User-visible materials, downloadable links
[1069] Step 14:
[1070] Provide download links for materials
[1071] The server provides the generated materials in PDF or image format and returns a download link to the user.
[1072] Input: Flowcharts, class diagrams, procedures
[1073] Output: PDF and image documents, download links
[1074] Step 15:
[1075] Emotion recognition
[1076] When a user uses the system, the server uses an emotion engine to recognize emotions in real time from the user's facial expressions and operation patterns. For example, it analyzes "irritation" or "impatience" from the speed of camera and mouse operations.
[1077] Input: User's facial expression data and operation patterns
[1078] Output: Recognized user emotional state
[1079] Step 16:
[1080] Adaptive change of display content
[1081] Based on the recognized emotion, the server adaptively changes the content displayed in the user interface, for example, simplifying information and highlighting important messages if the user is impatient.
[1082] Input: Perceived emotional state of the user
[1083] Output: adaptively modified interface and document display
[1084] (Application example 2)
[1085] 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."
[1086] Conventional program analysis systems analyze program source code and automatically generate flowcharts, class diagrams, and procedure manuals, but they are unable to provide an adaptive interface that takes user emotions into account. Furthermore, they do not automatically generate security procedure manuals, which are particularly important for electronic payment systems. Therefore, there is a need for a method that not only improves user experience but also implements security measures efficiently and effectively.
[1087] 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.
[1088] In this invention, the server includes means for receiving program source code, means for parsing the received source code, means for generating a flowchart based on the parsing result, means for generating a class diagram based on the parsing result, means for generating a procedure manual based on the parsing result, means for making the generated flowchart, class diagram, and procedure manual available for download by users, means for recognizing user emotions and adaptively changing the display content of the interface and the format of the generated materials, means for generating a security procedure manual for the electronic payment system, and means for making the generated security procedure manual available for download by users. This improves the user experience and makes it possible to efficiently implement advanced security measures for the electronic payment system.
[1089] "Program source code" is a set of instructions written to implement a computer program.
[1090] "Means for receiving" refers to a device or program that has the function of taking in data transmitted from outside and storing or analyzing it.
[1091] "Syntax analysis" is the operation of analyzing the structure of a program's source code using a syntax analysis engine.
[1092] A "flowchart" is a diagram that visually represents the processing flow of a program or process.
[1093] A "class diagram" is a visual representation of the class structure and relationships in an object-oriented program.
[1094] A "procedure manual" is a document that describes in natural language the steps and methods for performing a specific task.
[1095] "Means for making the data available for download" refers to a function that allows users to save the generated data to their own devices.
[1096] "Means for recognizing user emotions" refers to technology that detects emotions from the user's facial expressions, voice, text data, etc.
[1097] "Means for adaptive change" is a function that dynamically changes the interface and output results based on the detected user emotions.
[1098] An "electronic payment system" is a system that processes payments electronically via a network such as the Internet.
[1099] A "security procedure manual" is a document that describes specific procedures and instructions for strengthening system security.
[1100] The objective of this invention is to provide a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. Furthermore, it aims to improve the user experience by recognizing the user's emotions and adaptively changing the interface display content and the format of the generated materials.
[1101] The entire system mainly functions among the three parties: the server, the terminal, and the user. A specific embodiment of the system is shown below.
[1102] System Configuration
[1103] The server includes means for receiving program source code, means for parsing the source code, means for generating flowcharts based on the analysis results, means for generating class diagrams, and means for generating procedure manuals. The server also includes means for recognizing user emotions and adaptively changing the interface and generated materials, and means for generating security procedure manuals for electronic payment systems. All generated materials are configured to be downloadable by users via their terminals.
[1104] Software Configuration
[1105] The main software running on the server includes:
[1106] 1. Flask: Used as a web framework, it receives source code files from users, processes emotion recognition results, and provides the generated results.
[1107] 2. EmotionEngine: A module for recognizing user emotions, analyzing facial expressions, voice, text data, etc. to identify the user's emotions.
[1108] 3. CodeAnalyzer: A module that analyzes source code syntax and automatically generates flowcharts, class diagrams, and procedure manuals.
[1109] Program processing
[1110] The process flow can be explained as follows: A user uploads the source code of an electronic payment system to the server via a smartphone application. The server receives the source code and performs syntax analysis using the CodeAnalyzer module. Based on the analysis results, a program flowchart, class diagram, and procedure manual are automatically generated.
[1111] The server simultaneously recognizes the user's emotions in real time using the EmotionEngine module. For example, if the user is feeling stressed, the server adaptively changes the generated results and interface to make them simpler and easier to understand. The generated flowcharts, class diagrams, procedure manuals, and security procedures manuals can then be downloaded by the user.
[1112] Specific examples
[1113] Here is a concrete example: A user is performing a security check on an electronic payment system and performs the following operations:
[1114] 1. The user launches the application and uploads the source code files.
[1115] 2. The server parses the received source code and generates flowcharts, class diagrams, and procedure manuals.
[1116] 3. The server uses the EmotionEngine to recognize the user's emotions and adaptively change the product and interface as needed.
[1117] 4. Finally, the generated materials are available for users to download.
[1118] Prompt Sentence Examples
[1119] "If you want to upload the source code of an electronic payment system and perform a security check, select the source code file and press the 'Upload' button. The system will automatically generate flowcharts and security procedures, and display them appropriately based on the user's emotions."
[1120] This system allows users to obtain analysis results of electronic payment systems quickly and adaptively, significantly improving safety and efficiency.
[1121] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[1122] Step 1:
[1123] A user launches the application, selects and uploads a source code file for an electronic payment system. The input is the source code file, which is sent to the server. The output is the state in which the server has received the source code file.
[1124] Step 2:
[1125] The server stores the received source code in temporary storage. The input is the uploaded source code file, and the output is the source code file stored in the server's temporary storage. This operation includes storing the binary data of the file.
[1126] Step 3:
[1127] The server passes the source code to the CodeAnalyzer module for syntax analysis. The input is the saved source code file, and the output is the analysis result of the source code (abstract syntax tree and symbol table). In this step, the structure of the program is analyzed.
[1128] Step 4:
[1129] The server generates flowcharts, class diagrams, and procedure manuals based on the analysis results of CodeAnalyzer. The input is the source code analysis results, and the output is flowcharts, class diagrams, and procedure manuals. Flowcharts visualize the program's processing flow, class diagrams show object relationships, and procedure manuals are documents that explain processing procedures in natural language.
[1130] Step 5:
[1131] The server uses the EmotionEngine module to recognize the user's emotions in real time. The input is emotional data such as the user's facial expressions, voice, and text data, and the output is the recognized emotional state (e.g., stress, relaxation, irritation, etc.). Specifically, data is collected using a camera and microphone.
[1132] Step 6:
[1133] The server adaptively changes the generated materials and interface based on the recognized emotions. The input is the recognized emotional state and the generated flowchart, class diagram, and procedure manual. The output is the display content and format of the materials adjusted according to the emotional state. For example, if stress is detected, the materials will be simplified and important parts will be highlighted.
[1134] Step 7:
[1135] The server generates links to provide the generated flowcharts, class diagrams, procedures, and security measures procedures to the user and sends them to the user's device. The input is the adjusted materials, and the output is a link that the user can download. Specifically, this includes converting the materials to PDF or image format and saving them in cloud storage.
[1136] Step 8:
[1137] The user can download the generated materials (flowcharts, class diagrams, procedures, and security procedures) via the provided link and use them to strengthen and understand the security of the system. The input is the download link, and the output is the materials saved in the user's local environment.
[1138] This allows users to quickly and adaptively obtain the results of source code analysis of electronic payment systems, which can be useful for security measures and system understanding.
[1139] 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.
[1140] 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.
[1141] 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.
[1142] [Third embodiment]
[1143] FIG. 5 shows an example of the configuration of a data processing system 310 according to the third embodiment.
[1144] 5, the data processing system 310 includes the data processing device 12 and a headset type terminal 314. An example of the data processing device 12 is a server.
[1145] 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).
[1146] 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.
[1147] 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.
[1148] 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).
[1149] 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.
[1150] 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.
[1151] 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.
[1152] 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.
[1153] 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.
[1154] 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."
[1155] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. This system makes it easy to document programs that are dependent on individual users, and can significantly reduce the amount of work required for handover.
[1156] Overall system configuration
[1157] The system has the following main functions:
[1158] 1. Receiving source code (user uploads program)
[1159] 2. Parsing (the server analyzes the source code)
[1160] 3. Flowchart generation (the server visualizes the processing flow)
[1161] 4. Class diagram generation (the server visualizes object relationships)
[1162] 5. Procedure generation (the server describes the processing procedure in natural language)
[1163] 6. Providing the results (the device provides the generated data to the user)
[1164] Program processing
[1165] Receiving the source code
[1166] The user uploads the source code file they wish to analyze through a web interface. For example, they can select a Python source code file such as "sample_program.py." The server receives the uploaded source code and stores it in temporary storage.
[1167] Parsing
[1168] The server passes the received source code to the parsing engine, which automatically detects the language of the file and parses the source code using a parser appropriate for that language. For example, for a Python program, the server uses a Python-specific parsing engine to generate an abstract syntax tree (AST).
[1169] Flowchart generation
[1170] The server extracts each function and major processing block of the program based on the results of syntax analysis. It then builds a flowchart data structure based on the extracted information and uses an external library to draw the flowchart. For example, it visually represents the processing flow, including conditional branching and loop structures.
[1171] Class diagram generation
[1172] For object-oriented programs, the server analyzes all classes and their inheritance relationships to generate a class diagram. It extracts class names, methods, properties, etc. and converts them into data structures for the class diagram. It uses an external library to visually draw the class diagram.
[1173] Procedure generation
[1174] The server generates a natural language description of each function's process and key steps, such as how the function normalize_data normalizes input data and how the function filter_data filters data.
[1175] Providing results
[1176] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[1177] Specific examples
[1178] Below is an overview of the materials generated by this system, using the following Python source code as an example. For example, suppose you have the following Python code:
[1179] def normalize_data(data):
[1180] normalized_data = [x / max(data) for x in data]
[1181] return normalized_data
[1182] def filter_data(data):
[1183] filtered_data = [x for x in data if x > 0.5]
[1184] return filtered_data
[1185] def main():
[1186] raw_data = [10, 20, 30, 40, 50]
[1187] normalized_data = normalize_data(raw_data)
[1188] final_data = filter_data(normalized_data)
[1189] print(final_data)
[1190] if __name__ == "__main__":
[1191] main()
[1192] Based on this source code, the server generates the following materials:
[1193] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[1194] Class diagram: Not applicable, as this example does not contain any classes.
[1195] Instructions:
[1196] 1. The function normalize_data normalizes the input data.
[1197] 2. The function filter_data filters the normalized data.
[1198] 3. The main function processes the data as follows:
[1199] Create raw_data.
[1200] Call the normalize_data function to get normalized_data.
[1201] Call the filter_data function and get the final_data.
[1202] Output final_data.
[1203] In this way, users can easily understand the results of program analysis without any special knowledge or effort, and can share and take over efficiently.
[1204] The processing flow will be explained below.
[1205] Step 1:
[1206] The user uploads the source code file they wish to analyze through the web interface, for example, by selecting a Python file called "sample_program.py" and clicking the upload button.
[1207] Step 2:
[1208] The server receives the uploaded source code file, saves it in temporary storage, and notifies the user that the save is complete.
[1209] Step 3:
[1210] The server passes the received source code to the parsing engine, which automatically identifies the programming language of the source code and begins parsing it using the corresponding parser.
[1211] Step 4:
[1212] The server parses the source code, breaking it down into tokens and generating an Abstract Syntax Tree (AST). For Python programs, the AST is created using the ast module.
[1213] Step 5:
[1214] The server analyzes the AST and extracts key functions and processing blocks. Based on the extracted information, it builds a flowchart data structure. For example, it models conditional branches, loop structures, and other elements as nodes and edges that visually represent them.
[1215] Step 6:
[1216] The server draws the flowchart using an external library (e.g., Graphviz) and saves the generated results in temporary storage.
[1217] Step 7:
[1218] If the server is also an object-oriented program, it analyzes all classes and their relationships, extracting class names, methods, properties, and inheritance relationships, and converting them into a data structure for a class diagram.
[1219] Step 8:
[1220] The server draws the class diagram using an external library (e.g., PlantUML) and saves the generated results in temporary storage.
[1221] Step 9:
[1222] The server generates a procedure manual that describes the processing flow for each function in natural language. It analyzes the role and operation procedures of each function and creates a procedure manual as a summary.
[1223] Step 10:
[1224] The server converts the generated flowcharts, class diagrams, and procedure manuals into PDF or image format and generates a download link.
[1225] Step 11:
[1226] The terminal provides the link of the generated material from the server to the user, and the user uses the provided link to download the required material and save it in the local environment.
[1227] Step 12:
[1228] Users can check the downloaded materials and share them with their own work or team members, which prevents dependency on individual people and enables efficient handover.
[1229] Example 1
[1230] 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."
[1231] Traditionally, documenting program source code has been a time-consuming and labor-intensive process, and the resulting documentation often contains subjective descriptions, resulting in inconsistent quality. This has resulted in difficulties in program handover and maintenance, leading to inefficient work. It has also been difficult to quickly understand the overall structure and main processing content of a program. Therefore, there is a need for a system that can automatically generate flowcharts, class diagrams, and procedure manuals from source code analysis, providing consistent documentation.
[1232] 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.
[1233] In this invention, the server includes means for receiving program source code, means for automatically determining the language of the received source code, means for syntactically analyzing the received source code and generating an abstract syntax tree, means for extracting each function and major processing blocks, means for generating a flowchart based on the extracted information, means for analyzing the classes and inheritance relationships of an object-oriented program and generating a class diagram, means for generating a procedure manual that describes the processing content and important steps of each function in natural language, means for making the generated flowcharts, class diagrams, and procedure manuals available for download by users, means for allowing users to select and specify programs by uploading source code, and means for a syntax analysis engine that supports multiple languages and selects an appropriate parser based on the file extension and content to perform syntax analysis.This automatically generates high-quality documentation from the program source code, allowing users to quickly and efficiently understand the overall structure and major processing content of the program.
[1234] "Program source code" means the textual instructions that describe a computer program.
[1235] The "means for receiving" is a mechanism that has the function of receiving data sent from a user and storing it in temporary storage for use in processing.
[1236] "Means for automatic language detection" is a function that automatically identifies the programming language from the file extension and contents of the source code, and selects the appropriate analysis method based on the results.
[1237] "Syntax analysis" is the process of analyzing the grammar and structure of program source code and is a method of generating an abstract syntax tree (AST).
[1238] An "abstract syntax tree (AST)" is a data structure that represents the syntactic structure of source code as a tree structure, with each node representing a program element (such as a statement or expression).
[1239] "Means for extracting each function and major processing block" is a function that automatically extracts each function and processing element within a program from the results of syntax analysis.
[1240] A "flowchart" is a diagram that visually represents the processing flow of a program, and shows the order of processing, branches, and loops.
[1241] A "class diagram" is a diagram that visually represents the structure of classes and the relationships between them in an object-oriented program.
[1242] A "procedure manual" is a document that describes each function and processing procedure of a program in natural language.
[1243] "Means for generating procedures written in natural language" refers to a function that organizes and describes each function and processing content of a program in natural language based on the analysis results.
[1244] "Means for making documents and diagrams available for download" refers to the function of providing a link or button that allows users to easily obtain the generated documents and diagrams.
[1245] The "means by which a user can select and specify a program through uploading" is an interface that allows a user to select the source code file of a program that they wish to analyze and send it via the online system.
[1246] A "syntax parsing engine" is a software component that analyzes source code according to the grammar of a particular programming language and generates an abstract syntax tree.
[1247] "Supporting multiple languages" means supporting a variety of programming languages and having the ability to perform analysis according to the characteristics of each language.
[1248] "Selecting an appropriate parser" is the process of determining the language of the source code, then selecting a parser specialized for that language to perform accurate parsing.
[1249] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. This system makes it easy to document programs that are dependent on individual users, and can significantly reduce the amount of work required for handover.
[1250] System Overview
[1251] The system of the present invention is composed of three main entities: a server, a terminal, and a user. The roles of each are explained below.
[1252] Server Roles
[1253] The server plays a central role in receiving source code provided by users and automatically generating various documents based on it. Specifically, it has the following functions:
[1254] 1. Receiving the Source Code:
[1255] The server receives source code files uploaded by users through a web interface and stores them in temporary storage, during which the files are also checked for integrity and scanned for viruses.
[1256] 2. Parsing:
[1257] The server automatically determines the language of the received source code and selects an appropriate parsing engine based on the results. For example, in the case of Python, it uses a Python-specific parsing engine (e.g., AST module) to generate an abstract syntax tree (AST).
[1258] 3. Flowchart generation:
[1259] The server extracts each function and major processing block based on the parsing results, and generates a flowchart based on that information, which is then visually represented using an external library (e.g., Graphviz).
[1260] 4. Class diagram generation:
[1261] For object-oriented programs, the server analyzes all classes and their inheritance relationships and generates a class diagram, which is visually drawn using an external library (e.g., PlantUML).
[1262] 5. Procedure generation:
[1263] Generates a procedure manual that describes the processing details and important steps of each function in natural language. Organizes the analysis results and provides them as an easy-to-understand natural language procedure manual.
[1264] 6. Results provided:
[1265] The server saves the generated flowcharts, class diagrams, and procedure manuals in PDF or image format and generates a link that allows users to download them.
[1266] Device Role
[1267] The terminal provides an interface through which users can access the system, upload source code, and view and download generated documentation.
[1268] 1. User Interface:
[1269] The terminal provides the user with an interface through a web browser, allowing them to upload source code, view documentation, and download it.
[1270] User Roles
[1271] Users upload the source code they wish to analyze and can then review and download the generated flowcharts, class diagrams, and procedure manuals.
[1272] Specific examples
[1273] Here we will use some Python source code as an example to explain how this system works.
[1274] Suppose you have the following Python code:
[1275] def normalize_data(data):
[1276] normalized_data = [x / max(data) for x in data]
[1277] return normalized_data
[1278] def filter_data(data):
[1279] filtered_data = [x for x in data if x > 0.5]
[1280] return filtered_data
[1281] def main():
[1282] raw_data = [10, 20, 30, 40, 50]
[1283] normalized_data = normalize_data(raw_data)
[1284] final_data = filter_data(normalized_data)
[1285] print(final_data)
[1286] if __name__ == "__main__":
[1287] main()
[1288] An example of the prompt when uploading this source code is as follows:
[1289] Analyze Python source code and generate flowcharts and instructions, including the auto-detected file language and the parsing engine used.
[1290] The system of the present invention automatically generates the following materials from this source code:
[1291] Flowchart: Visualizes each function and its processing flow, showing the execution flow of the main() function.
[1292] Class diagram: Not applicable, as this example does not contain any classes.
[1293] Instructions:
[1294] 1. The function normalize_data normalizes the input data.
[1295] 2. The function filter_data filters the normalized data.
[1296] 3. The main function processes the data as follows:
[1297] Create raw_data.
[1298] Call the normalize_data function to get normalized_data.
[1299] Call the filter_data function and get the final_data.
[1300] Output final_data.
[1301] Through the above process, users can easily understand the results of program analysis without any special knowledge or effort, and can share and take over efficiently.
[1302] The flow of the identification process in the first embodiment will be described with reference to FIG.
[1303] Step 1: Receive the source code
[1304] (Subject: User, Server)
[1305] 1. User uploads source code file:
[1306] The user uses a web interface to upload the source code file they want to analyze to the server. For example, they select a Python file called "sample_program.py." The input is the source code file, and the output is the file sent to the server.
[1307] 2. The server receives and saves the file:
[1308] The server receives source code files uploaded by users and stores them in temporary storage. The input is the file sent by the user, and the output is the saved file. File integrity checks and virus scans are also performed in this step.
[1309] Step 2: Parsing
[1310] (Subject: Server)
[1311] 1. The server determines the file type:
[1312] The server automatically determines the programming language from the extension and content of the received source code file. The input is the saved source code file, and the output is the language determination result (e.g., Python).
[1313] 2. The server parses it with the appropriate parser:
[1314] The server selects a parsing engine appropriate for the identified language. For example, for a Python program, it generates an abstract syntax tree (AST) using a parsing engine dedicated to Python (e.g., the AST module). The input is the language identification result and the source code content, and the output is the generated AST.
[1315] Step 3: Generate a flowchart
[1316] (Subject: Server)
[1317] 1. The server extracts the processing flow based on the parsing results:
[1318] The server extracts each function and major processing block based on the AST information obtained from the syntax analysis. The input is the AST, and the output is information about each function and processing block.
[1319] 2. The server draws the flowchart:
[1320] The server uses external libraries (e.g., Graphviz) to generate a flowchart that visually represents the extracted information. The input is the information of functions or processing blocks, and the output is a visual flowchart. For example, conditional branch points are drawn as diamonds, and processing blocks are drawn as rectangles.
[1321] Step 4: Generate a class diagram
[1322] (Subject: Server)
[1323] 1. The server analyzes class definitions and inheritance relationships:
[1324] For object-oriented programs, the server analyzes all classes and their inheritance relationships. The input is the AST, and the output is information about classes and inheritance relationships.
[1325] 2. The server draws the class diagram:
[1326] The server uses an external library (e.g., PlantUML) to visually draw class diagrams. The input is class and inheritance relationship information, and the output is a visual class diagram. The relationships and inheritance relationships between classes are visually represented.
[1327] Step 5: Generate instructions
[1328] (Subject: Server)
[1329] 1. The server describes what the function does:
[1330] The server describes the processing details and important steps of each function in natural language. The input is information about each function and process, and the output is the procedure described in natural language.
[1331] 2. The server generates instructions:
[1332] The server organizes the analysis results based on the procedure template and generates an easy-to-understand natural language procedure manual. The input is the natural language description and the procedure manual template, and the output is the final procedure manual.
[1333] Step 6: Delivering results
[1334] (Subject: terminal, user)
[1335] 1. The device displays the results to the user:
[1336] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The inputs are files and data of various products, and the output is a visual display on the user interface.
[1337] 2. User downloads the materials:
[1338] Users can download the displayed materials as needed. The server provides the generated materials in PDF or image format and returns a download link to the user. The input is a download request and the output is a download link.
[1339] (Application example 1)
[1340] 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."
[1341] The control programs of automated machines used in factories are often complex and contain vast amounts of information, requiring a great deal of time and effort to understand and maintain. Furthermore, the introduction of new programs and the updating of existing programs can be difficult, especially when different people are in charge. In these circumstances, there is a need for a method to easily and quickly understand the structure of control programs and to visualize and document their contents.
[1342] 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.
[1343] In this invention, the server includes means for receiving program source code, means for parsing the syntax of the received source code, and means for analyzing the control program of the automated factory machine and automatically generating visual and document materials, thereby enabling complex control programs to be easily and quickly understood and enabling the automatic generation of visual flowcharts, class diagrams, and procedure manuals.
[1344] "Program" means a set of instructions, including source code and its execution steps, that cause a computer or automated machine to perform a specific operation.
[1345] "Source code" is textual code that describes the behavior of a program and is written in a human-readable format.
[1346] "Syntax analysis" is the process of analyzing source code to understand its structure and meaning.
[1347] "Syntax analysis results" refers to the data or information obtained after syntactic analysis, and indicates the structure and processing flow of the source code.
[1348] A "flowchart" is a diagram that visually represents the processing steps of a program, showing the flow of functions and processing blocks.
[1349] A "class diagram" is a visual representation of classes, their attributes, methods, and the relationships between classes in an object-oriented program.
[1350] A "procedure manual" is a document that describes each process and important steps of a program in natural language.
[1351] "Factory automation" refers to machinery used to automate specific tasks within a factory.
[1352] "Analysis" is the act of investigating information or data and clarifying its structure and content.
[1353] "Visual materials" are data or information converted into a format that is easy to understand visually, and include things like flowcharts and class diagrams.
[1354] "Documentation" refers to written information in text format, including procedures and the like.
[1355] This invention relates to a system that analyzes the control programs of automated machines used in factories and automatically generates visual and written materials. This system greatly simplifies the understanding and maintenance of complex control programs, and makes it easy to introduce new programs and update them.
[1356] Overall system configuration
[1357] The system has the following main functions:
[1358] 1. Receiving the program source code
[1359] The server allows users to upload source code files they wish to analyze through a web interface.
[1360] 2. Parsing
[1361] The server passes the received source code to a dedicated parsing engine to analyze the program structure. In the case of Python programs, the server uses a dedicated parsing engine to generate an abstract syntax tree (AST).
[1362] 3. Flowchart generation
[1363] Based on the results of the syntax analysis, the server extracts each function and major processing block of the program, and generates a flowchart based on them. The flowchart is visually drawn using an external library (e.g., graphviz).
[1364] 4. Class diagram generation
[1365] For object-oriented programs, the server analyzes all classes and their inheritance relationships and generates a class diagram. It uses an external library (e.g., docx) to visually render the class diagram.
[1366] 5. Procedure generation
[1367] The server analyzes the abstract syntax tree and generates a procedure manual that describes each function and important steps of the program in natural language.
[1368] 6. Provision of Materials
[1369] The server provides the generated flowcharts, class diagrams, and procedures to the user and displays them in a downloadable format (e.g., PDF, image format).
[1370] Hardware and software used
[1371] The server uses hardware with a powerful processor and sufficient memory, and the following software:
[1372] Parsing engine: the ast module for Python programs
[1373] Flowchart generation: graphviz library
[1374] Class diagram generation: docx library
[1375] Instruction Generation: Custom parsing and generation algorithms
[1376] Specific examples
[1377] An example will be explained using the following source code:
[1378] Source code example:
[1379] def main():
[1380] start_robot()
[1381] move_robot()
[1382] stop_robot()
[1383] def start_robot():
[1384] print('Robot started')
[1385] def move_robot():
[1386] print('Robot moving')
[1387] def stop_robot():
[1388] print('Robot stopped')
[1389] if __name__ == "__main__":
[1390] main()
[1391] flowchart:
[1392] The server visually represents the calling relationship between the start_robot, move_robot, and stop_robot functions called within the main function.
[1393] Class diagram:
[1394] In this example, no classes are included, so no class diagram is generated.
[1395] Instructions:
[1396] The server generates instructions like this:
[1397] 1. The function start_robot displays the robot startup message.
[1398] 2. The function move_robot displays the robot's movement message.
[1399] 3. The function stop_robot displays a message that the robot has stopped.
[1400] 4. The main function controls the robot by following these steps:
[1401] Call start_robot to start the robot.
[1402] Call move_robot to move the robot.
[1403] Call stop_robot to stop the robot.
[1404] Prompt Sentence Examples
[1405] Please upload the source code to be analyzed.
[1406] As a result, the convenience of control programs within factories is improved, and developers can effectively introduce new programs and maintain existing programs.
[1407] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[1408] Step 1:
[1409] Users upload the source code files they wish to analyze through a web interface, where they select the desired source code files using a file selection dialog. The input is the source code file (e.g., a Python file), and the output is the source code data sent to the server.
[1410] Step 2:
[1411] The server saves the received source code file in temporary storage, obtains the saved file path, and prepares for the next process. The input is the source code data sent by the user, and the output is the file path saved in temporary storage.
[1412] Step 3:
[1413] The server passes the stored source code to a parsing engine for analysis. Specifically, it uses a parsing engine (e.g., the ast module for Python) to generate an Abstract Syntax Tree (AST). The input is the source code file path, and the output is an AST data structure.
[1414] Step 4:
[1415] The server extracts each function and major processing block of the program based on the AST data structure. At this stage, function definitions, conditional branches, loop structures, etc. are identified. The input is the AST data, and the output is a list of functions and processing blocks.
[1416] Step 5:
[1417] The server generates a flowchart based on the extracted information. It uses libraries such as graphviz to visually depict function calls and processing flows. The input is a list of functions and processing blocks, and the output is a flowchart image.
[1418] Step 6:
[1419] For object-oriented programs, the server analyzes all classes and their inheritance relationships from the AST data and generates a class diagram using the docx library. The input is the AST data and the output is a class diagram document.
[1420] Step 7:
[1421] The server generates a procedure manual that describes the processing details and important steps of each function in natural language. Specifically, it analyzes the AST data and describes the function's behavior in text format. The input is the AST data, and the output is text data that serves as the procedure manual.
[1422] Step 8:
[1423] The server provides the generated flowcharts, class diagrams, and procedure manuals to the user, who can then review them and download them as PDFs or images if necessary. The inputs are flowchart images, class diagram documents, and procedure manual text, and the output is a download link that is displayed to the user.
[1424] In this way, the server analyzes the source code at each step and generates and provides visual and text-based materials, making it easier to understand and maintain the control programs of automatic machines used in factories.
[1425] 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.
[1426] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. It also improves the user experience by combining it with an emotion engine that recognizes the user's emotions and adaptively changes the interface display content and the format of the generated materials based on the recognition results.
[1427] Overall system configuration
[1428] The system has the following main functions:
[1429] 1. Receiving source code (user uploads program)
[1430] 2. Parsing (the server analyzes the source code)
[1431] 3. Flowchart generation (the server visualizes the processing flow)
[1432] 4. Class diagram generation (the server visualizes object relationships)
[1433] 5. Procedure generation (the server describes the processing procedure in natural language)
[1434] 6. Providing the results (the device provides the generated data to the user)
[1435] 7. Emotion engine (the server recognizes the user's emotions and adaptively adjusts the interface and materials based on those emotions)
[1436] Program processing
[1437] Receiving the source code
[1438] The user uploads the source code file they wish to analyze through the web interface. For example, they select a Python file called "sample_program.py" and click the upload button. The server receives the uploaded source code and stores it in temporary storage.
[1439] Parsing
[1440] The server passes the received source code to the analysis engine, which automatically detects the programming language of the source code and begins analysis using the corresponding parser. For example, in the case of a Python program, the server uses a Python-specific parsing engine to generate an abstract syntax tree (AST).
[1441] Flowchart generation
[1442] The server extracts each function and major processing block of the program based on the results of syntax analysis. It then builds a flowchart data structure based on the extracted information and uses an external library to draw the flowchart. For example, it visually represents the processing flow, including conditional branching and loop structures.
[1443] Class diagram generation
[1444] For object-oriented programs, the server analyzes all classes and their inheritance relationships to generate a class diagram. It extracts class names, methods, properties, etc. and converts them into data structures for the class diagram. It uses an external library to visually draw the class diagram.
[1445] Procedure generation
[1446] The server generates a natural language description of each function's process and key steps, such as how the function normalize_data normalizes input data and how the function filter_data filters data.
[1447] Providing results
[1448] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[1449] Emotion Engine Operation
[1450] When a user uses the system, the server uses an emotion engine to recognize the user's emotions in real time. For example, it can detect when the user is impatient or irritated.
[1451] Based on the recognized emotion, the server adaptively changes the content displayed in the user interface. For example, if the user is impatient, the server simplifies the information and highlights important messages. It also adjusts the content of generated procedure manuals and flowcharts to help the user understand them better. For example, it adds detailed steps or emphasizes important points.
[1452] Specific examples
[1453] Below is an overview of the materials generated by this system, using the following Python source code as an example. For example, suppose you have the following Python code:
[1454] def normalize_data(data):
[1455] normalized_data = [x / max(data) for x in data]
[1456] return normalized_data
[1457] def filter_data(data):
[1458] filtered_data = [x for x in data if x > 0.5]
[1459] return filtered_data
[1460] def main():
[1461] raw_data = [10, 20, 30, 40, 50]
[1462] normalized_data = normalize_data(raw_data)
[1463] final_data = filter_data(normalized_data)
[1464] print(final_data)
[1465] if __name__ == "__main__":
[1466] main()
[1467] Based on this source code, the server generates the following materials:
[1468] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[1469] Class diagram: Not applicable, as this example does not contain any classes.
[1470] Instructions:
[1471] 1. The function normalize_data normalizes the input data.
[1472] 2. The function filter_data filters the normalized data.
[1473] 3. The main function processes the data as follows:
[1474] Create raw_data.
[1475] Call the normalize_data function to get normalized_data.
[1476] Call the filter_data function and get the final_data.
[1477] Output final_data.
[1478] The emotion engine recognizes the user's emotions and, if the user is feeling impatient, adds additional explanations to the instructions and emphasizes important parts. It also adjusts the flow charts and interface display to make them simpler and easier to understand.
[1479] In this way, users can easily understand the results of program analysis and share or take over efficiently without any special knowledge or effort.In addition, an adaptive interface that takes user emotions into consideration can improve the user experience.
[1480] The processing flow will be explained below.
[1481] Step 1:
[1482] The user uploads the source code file they wish to analyze through the web interface, for example, by selecting a Python file called "sample_program.py" and clicking the upload button.
[1483] Step 2:
[1484] The server receives the uploaded source code file, saves it in temporary storage, and notifies the user that the save is complete.
[1485] Step 3:
[1486] The server passes the received source code to a parsing engine, which automatically detects the programming language of the source code and begins parsing it using the corresponding parser. For example, in the case of a Python program, the server uses a parsing engine specifically designed for Python to generate an abstract syntax tree (AST).
[1487] Step 4:
[1488] The server parses the AST and extracts key functions and processing blocks, such as function definitions, conditional branches, and loop structures.
[1489] Step 5:
[1490] The server builds a flowchart data structure based on the analysis results. Each extracted function or processing block is modeled as a node, and the relationships between them are represented as edges.
[1491] Step 6:
[1492] The server uses an external library (e.g., Graphviz) to draw the flowchart and saves the generated results in temporary storage.
[1493] Step 7:
[1494] The server generates a class diagram based on the analysis results. If it is an object-oriented program, it extracts class names, methods, properties, inheritance relationships, etc. and converts them into a data structure for a class diagram. This can then be visualized using an external library (e.g., PlantUML).
[1495] Step 8:
[1496] The server generates a natural language procedural manual detailing each function's operation and key steps, for example, the function normalize_data performs data normalization, and the function filter_data performs filtering.
[1497] Step 9:
[1498] The server activates the emotion engine to recognize the user's emotions in real time. It uses a webcam and microphone to analyze the user's facial expressions and tone of voice to determine the user's emotions.
[1499] Step 10:
[1500] The server adaptively changes the content displayed in the user interface based on the recognized emotion. For example, if the user is feeling impatient, the screen display will be simplified and important messages will be highlighted.
[1501] Step 11:
[1502] The server adjusts the content and format of the instructions and flowcharts it generates based on the recognized emotions, for example adding additional explanations or annotations to instructions if the user is confused.
[1503] Step 12:
[1504] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[1505] Step 13:
[1506] Users can use the provided link to download the generated documents to their local environment and share them with their work or team members, preventing dependency on individual users and enabling efficient handover.
[1507] Example 2
[1508] 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."
[1509] Conventional program analysis systems are limited to analyzing source code and generating flowcharts, class diagrams, and procedure manuals. Furthermore, their user interfaces are fixed and cannot be flexibly adjusted according to the user's feelings and level of understanding. This can limit the user experience and hinder efficient work.
[1510] 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. In this invention, the server includes means for receiving program source code, means for parsing the received source code, means for generating a flowchart based on the parsing result, means for generating a class diagram based on the parsing result, means for generating a procedure manual based on the parsing result, means for enabling the user to download the generated flowchart, class diagram, and procedure manual, and means for recognizing the user's emotions and adaptively changing the interface and materials based on the recognition result. This makes it possible to adaptively adjust the interface and generated materials according to the user's emotions and level of understanding, thereby providing a more efficient and comfortable work environment.
[1511] "Program source code" means the text that describes a computer program, written in a particular programming language.
[1512] "Means for receiving source code" refers to the method or technology by which a computer system receives source code provided by a user.
[1513] "Means of parsing" refers to techniques and tools for analyzing source code and understanding its structure and meaning.
[1514] "Means for generating a flowchart" refers to the methods and techniques used to visually represent the processing flow of a program.
[1515] A "means for generating class diagrams" refers to a method or technique for visually representing the relationships between classes in an object-oriented program.
[1516] "Means for generating a procedure manual" refers to a method or technology for creating a document that describes the program's operations and processing procedures in natural language.
[1517] "Means for making the data downloadable" refers to methods and techniques that allow users to save the generated flowcharts, class diagrams, and procedures to their own computers.
[1518] "Means for recognizing emotions" refers to techniques and methods for identifying a user's emotional state by analyzing the user's facial expressions and operation patterns.
[1519] "Means for adaptively changing interfaces and materials" refers to techniques and methods for dynamically adjusting the display content and structure according to the user's emotions and situation.
[1520] "User" refers to a person who uses this system to check the analysis results of a program and generate materials.
[1521] "Server" refers to a computer system that provides this system and processes requests from users.
[1522] "Terminal" refers to a device such as a computer or smartphone that a user uses to access this system.
[1523] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. It also improves the user experience by combining an emotion engine that recognizes the user's emotions and adaptively changes the interface display content and the format of the generated materials based on the recognition results.
[1524] Overall system configuration
[1525] The system has the following main functions:
[1526] 1. Receiving source code (user uploads program)
[1527] 2. Parsing (the server analyzes the source code)
[1528] 3. Flowchart generation (the server visualizes the processing flow)
[1529] 4. Class diagram generation (the server visualizes object relationships)
[1530] 5. Procedure generation (the server describes the processing procedure in natural language)
[1531] 6. Providing the results (the device provides the generated data to the user)
[1532] 7. Emotion engine (the server recognizes the user's emotions and adaptively adjusts the interface and materials based on those emotions)
[1533] Hardware and software used
[1534] The server includes an analysis engine, a database, an emotion recognition system, and a diagram generation library. The analysis engine uses a Python-specific parsing engine. Graphviz and PlantUML are used for diagram generation, and computer vision technology is used for emotion recognition.
[1535] A terminal is a device, such as a computer or smartphone, that a user uses to operate a web interface, through which the user uploads source code and downloads artifacts.
[1536] Specific examples
[1537] For example, suppose you enter the following Python code:
[1538] def normalize_data(data):
[1539] normalized_data = [x / max(data) for x in data]
[1540] return normalized_data
[1541] def filter_data(data):
[1542] filtered_data = [x for x in data if x > 0.5]
[1543] return filtered_data
[1544] def main():
[1545] raw_data = [10, 20, 30, 40, 50]
[1546] normalized_data = normalize_data(raw_data)
[1547] final_data = filter_data(normalized_data)
[1548] print(final_data)
[1549] if __name__ == "__main__":
[1550] main()
[1551] Based on this source code, the server generates the following materials:
[1552] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[1553] Class diagram: Not applicable, as this example does not contain any classes.
[1554] Instructions:
[1555] 1. The function normalize_data normalizes the input data.
[1556] 2. The function filter_data filters the normalized data.
[1557] 3. The main function processes the data as follows:
[1558] Create raw_data.
[1559] Call the normalize_data function to get normalized_data.
[1560] Call the filter_data function and get the final_data.
[1561] Output final_data.
[1562] The emotion engine recognizes the user's emotions and, if the user is feeling impatient, adds supplementary explanations to the instructions and emphasizes important parts. It also adjusts the display content of flowcharts and interfaces to be simple and easy to understand. In this way, users can easily understand the results of program analysis without requiring special knowledge or effort, and can share and hand over the results efficiently. Furthermore, an adaptive interface that takes the user's emotions into account can improve the user experience.
[1563] The flow of the identification process in the second embodiment will be described with reference to FIG.
[1564] Step 1:
[1565] Selecting the input file
[1566] Using the web interface, users select the source code file they wish to analyze, for example a Python file called "sample_program.py," and click the upload button.
[1567] Input: Source code file (e.g. "sample_program.py")
[1568] Output: Source code files selected and ready to upload
[1569] Step 2:
[1570] Uploading a file
[1571] When the user clicks the upload button, the device sends the selected file to the server, which then stores the received file in temporary storage.
[1572] Input: Selected source code file
[1573] Output: Source code files uploaded to the server and saved in temporary storage
[1574] Step 3:
[1575] Identifying the programming language
[1576] The server automatically determines the programming language from the extension and header information of the received source code file. For example, ".py" is recognized as Python, and ".java" as Java.
[1577] Input: Source code files stored on the server
[1578] Output: The identified programming language (e.g. Python)
[1579] Step 4:
[1580] Analysis engine selection
[1581] The server selects the parsing engine that corresponds to the identified programming language. For example, if the language is Python, it uses a parsing engine specifically for Python.
[1582] Input: The determined programming language
[1583] Output: Selected parsing engine (e.g., Python-specific parsing engine)
[1584] Step 5:
[1585] Abstract Syntax Tree Generation
[1586] The server uses the selected parsing engine to analyze the source code and generate an abstract syntax tree (AST). In the case of Python, the AST is generated by the Python parsing engine.
[1587] Input: Source code files, selected analysis engine
[1588] Output: Abstract Syntax Tree (AST)
[1589] Step 6:
[1590] Extracting functions and processing blocks
[1591] The server extracts each function and major processing block from the parsed result, for example, identifying each function, loop, conditional branch, etc.
[1592] Input: Abstract Syntax Tree (AST)
[1593] Output: Information about extracted functions and processing blocks
[1594] Step 7:
[1595] Flowchart data structure construction
[1596] The server builds a flowchart data structure based on the extracted information. The data structure includes processing blocks as nodes and edges connecting them.
[1597] Input: Information about the extracted function or processing block
[1598] Output: Flowchart data structure
[1599] Step 8:
[1600] Drawing a flowchart
[1601] The server uses an external library (e.g., Graphviz) to visually draw the flowchart.
[1602] Input: Flowchart data structure
[1603] Output: A visually rendered flowchart
[1604] Step 9:
[1605] Class Relationship Analysis
[1606] The server analyzes all classes, their inheritance relationships, methods, and properties from the source code of an object-oriented program. For example, it extracts information such as class A inherits class B, and class B has five methods.
[1607] Input: Source code file
[1608] Output: Extracted class relationship information
[1609] Step 10:
[1610] Building data structures for class diagrams
[1611] The server constructs a data structure of a class diagram based on the extracted class relationship information.
[1612] Input: Extracted class relationship information
[1613] Output: Class diagram data structure
[1614] Step 11:
[1615] Drawing a class diagram
[1616] The server uses an external library (e.g., PlantUML) to visually draw class diagrams.
[1617] Input: Class diagram data structure
[1618] Output: A visually rendered class diagram
[1619] Step 12:
[1620] Description of processing content
[1621] The server generates a procedure that describes in natural language what each function does and the key steps it takes, for example, the function normalize_data normalizes the input data, and the function filter_data filters the data for specific conditions.
[1622] Input: Information about the extracted function or processing block
[1623] Output: Natural language instructions
[1624] Step 13:
[1625] View generated materials
[1626] The terminal displays the generated flowcharts, class diagrams, and procedures to the user, who can then check them and download them as needed.
[1627] Input: Flowcharts, class diagrams, procedures
[1628] Output: User-visible materials, downloadable links
[1629] Step 14:
[1630] Provide download links for materials
[1631] The server provides the generated materials in PDF or image format and returns a download link to the user.
[1632] Input: Flowcharts, class diagrams, procedures
[1633] Output: PDF and image documents, download links
[1634] Step 15:
[1635] Emotion recognition
[1636] When a user uses the system, the server uses an emotion engine to recognize emotions in real time from the user's facial expressions and operation patterns. For example, it analyzes "irritation" or "impatience" from the speed of camera and mouse operations.
[1637] Input: User's facial expression data and operation patterns
[1638] Output: Recognized user emotional state
[1639] Step 16:
[1640] Adaptive change of display content
[1641] Based on the recognized emotion, the server adaptively changes the content displayed in the user interface, for example, simplifying information and highlighting important messages if the user is impatient.
[1642] Input: Perceived emotional state of the user
[1643] Output: adaptively modified interface and document display
[1644] (Application example 2)
[1645] 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."
[1646] Conventional program analysis systems analyze program source code and automatically generate flowcharts, class diagrams, and procedure manuals, but they are unable to provide an adaptive interface that takes user emotions into account. Furthermore, they do not automatically generate security procedure manuals, which are particularly important for electronic payment systems. Therefore, there is a need for a method that not only improves user experience but also implements security measures efficiently and effectively.
[1647] 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.
[1648] In this invention, the server includes means for receiving program source code, means for parsing the received source code, means for generating a flowchart based on the parsing result, means for generating a class diagram based on the parsing result, means for generating a procedure manual based on the parsing result, means for making the generated flowchart, class diagram, and procedure manual available for download by users, means for recognizing user emotions and adaptively changing the display content of the interface and the format of the generated materials, means for generating a security procedure manual for the electronic payment system, and means for making the generated security procedure manual available for download by users. This improves the user experience and makes it possible to efficiently implement advanced security measures for the electronic payment system.
[1649] "Program source code" is a set of instructions written to implement a computer program.
[1650] "Means for receiving" refers to a device or program that has the function of taking in data transmitted from outside and storing or analyzing it.
[1651] "Syntax analysis" is the operation of analyzing the structure of a program's source code using a syntax analysis engine.
[1652] A "flowchart" is a diagram that visually represents the processing flow of a program or process.
[1653] A "class diagram" is a visual representation of the class structure and relationships in an object-oriented program.
[1654] A "procedure manual" is a document that describes in natural language the steps and methods for performing a specific task.
[1655] "Means for making the data available for download" refers to a function that allows users to save the generated data to their own devices.
[1656] "Means for recognizing user emotions" refers to technology that detects emotions from the user's facial expressions, voice, text data, etc.
[1657] "Means for adaptive change" is a function that dynamically changes the interface and output results based on the detected user emotions.
[1658] An "electronic payment system" is a system that processes payments electronically via a network such as the Internet.
[1659] A "security procedure manual" is a document that describes specific procedures and instructions for strengthening system security.
[1660] The objective of this invention is to provide a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. Furthermore, it aims to improve the user experience by recognizing the user's emotions and adaptively changing the interface display content and the format of the generated materials.
[1661] The entire system mainly functions among the three parties: the server, the terminal, and the user. A specific embodiment of the system is shown below.
[1662] System Configuration
[1663] The server includes means for receiving program source code, means for parsing the source code, means for generating flowcharts based on the analysis results, means for generating class diagrams, and means for generating procedure manuals. The server also includes means for recognizing user emotions and adaptively changing the interface and generated materials, and means for generating security procedure manuals for electronic payment systems. All generated materials are configured to be downloadable by users via their terminals.
[1664] Software Configuration
[1665] The main software running on the server includes:
[1666] 1. Flask: Used as a web framework, it receives source code files from users, processes emotion recognition results, and provides the generated results.
[1667] 2. EmotionEngine: A module for recognizing user emotions, analyzing facial expressions, voice, text data, etc. to identify the user's emotions.
[1668] 3. CodeAnalyzer: A module that analyzes source code syntax and automatically generates flowcharts, class diagrams, and procedure manuals.
[1669] Program processing
[1670] The process flow can be explained as follows: A user uploads the source code of an electronic payment system to the server via a smartphone application. The server receives the source code and performs syntax analysis using the CodeAnalyzer module. Based on the analysis results, a program flowchart, class diagram, and procedure manual are automatically generated.
[1671] The server simultaneously recognizes the user's emotions in real time using the EmotionEngine module. For example, if the user is feeling stressed, the server adaptively changes the generated results and interface to make them simpler and easier to understand. The generated flowcharts, class diagrams, procedure manuals, and security procedures manuals can then be downloaded by the user.
[1672] Specific examples
[1673] Here is a concrete example: A user is performing a security check on an electronic payment system and performs the following operations:
[1674] 1. The user launches the application and uploads the source code files.
[1675] 2. The server parses the received source code and generates flowcharts, class diagrams, and procedure manuals.
[1676] 3. The server uses the EmotionEngine to recognize the user's emotions and adaptively change the product and interface as needed.
[1677] 4. Finally, the generated materials are available for users to download.
[1678] Prompt Sentence Examples
[1679] "If you want to upload the source code of an electronic payment system and perform a security check, select the source code file and press the 'Upload' button. The system will automatically generate flowcharts and security procedures, and display them appropriately based on the user's emotions."
[1680] This system allows users to obtain analysis results of electronic payment systems quickly and adaptively, significantly improving safety and efficiency.
[1681] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[1682] Step 1:
[1683] A user launches the application, selects and uploads a source code file for an electronic payment system. The input is the source code file, which is sent to the server. The output is the state in which the server has received the source code file.
[1684] Step 2:
[1685] The server stores the received source code in temporary storage. The input is the uploaded source code file, and the output is the source code file stored in the server's temporary storage. This operation includes storing the binary data of the file.
[1686] Step 3:
[1687] The server passes the source code to the CodeAnalyzer module for syntax analysis. The input is the saved source code file, and the output is the analysis result of the source code (abstract syntax tree and symbol table). In this step, the structure of the program is analyzed.
[1688] Step 4:
[1689] The server generates flowcharts, class diagrams, and procedure manuals based on the analysis results of CodeAnalyzer. The input is the source code analysis results, and the output is flowcharts, class diagrams, and procedure manuals. Flowcharts visualize the program's processing flow, class diagrams show object relationships, and procedure manuals are documents that explain processing procedures in natural language.
[1690] Step 5:
[1691] The server uses the EmotionEngine module to recognize the user's emotions in real time. The input is emotional data such as the user's facial expressions, voice, and text data, and the output is the recognized emotional state (e.g., stress, relaxation, irritation, etc.). Specifically, data is collected using a camera and microphone.
[1692] Step 6:
[1693] The server adaptively changes the generated materials and interface based on the recognized emotions. The input is the recognized emotional state and the generated flowchart, class diagram, and procedure manual. The output is the display content and format of the materials adjusted according to the emotional state. For example, if stress is detected, the materials will be simplified and important parts will be highlighted.
[1694] Step 7:
[1695] The server generates links to provide the generated flowcharts, class diagrams, procedures, and security measures procedures to the user and sends them to the user's device. The input is the adjusted materials, and the output is a link that the user can download. Specifically, this includes converting the materials to PDF or image format and saving them in cloud storage.
[1696] Step 8:
[1697] The user can download the generated materials (flowcharts, class diagrams, procedures, and security procedures) via the provided link and use them to strengthen and understand the security of the system. The input is the download link, and the output is the materials saved in the user's local environment.
[1698] This allows users to quickly and adaptively obtain the results of source code analysis of electronic payment systems, which can be useful for security measures and system understanding.
[1699] 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.
[1700] 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.
[1701] 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.
[1702] [Fourth embodiment]
[1703] FIG. 7 shows an example of the configuration of a data processing system 410 according to the fourth embodiment.
[1704] 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.
[1705] 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).
[1706] 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.
[1707] 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.
[1708] 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).
[1709] 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.
[1710] 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.
[1711] 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.
[1712] 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.
[1713] 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.
[1714] 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.
[1715] 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."
[1716] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. This system makes it easy to document programs that are dependent on individual users, and can significantly reduce the amount of work required for handover.
[1717] Overall system configuration
[1718] The system has the following main functions:
[1719] 1. Receiving source code (user uploads program)
[1720] 2. Parsing (the server analyzes the source code)
[1721] 3. Flowchart generation (the server visualizes the processing flow)
[1722] 4. Class diagram generation (the server visualizes object relationships)
[1723] 5. Procedure generation (the server describes the processing procedure in natural language)
[1724] 6. Providing the results (the device provides the generated data to the user)
[1725] Program processing
[1726] Receiving the source code
[1727] The user uploads the source code file they wish to analyze through a web interface. For example, they can select a Python source code file such as "sample_program.py." The server receives the uploaded source code and stores it in temporary storage.
[1728] Parsing
[1729] The server passes the received source code to the parsing engine, which automatically detects the language of the file and parses the source code using a parser appropriate for that language. For example, for a Python program, the server uses a Python-specific parsing engine to generate an abstract syntax tree (AST).
[1730] Flowchart generation
[1731] The server extracts each function and major processing block of the program based on the results of syntax analysis. It then builds a flowchart data structure based on the extracted information and uses an external library to draw the flowchart. For example, it visually represents the processing flow, including conditional branching and loop structures.
[1732] Class diagram generation
[1733] For object-oriented programs, the server analyzes all classes and their inheritance relationships to generate a class diagram. It extracts class names, methods, properties, etc. and converts them into data structures for the class diagram. It uses an external library to visually draw the class diagram.
[1734] Procedure generation
[1735] The server generates a natural language description of each function's process and key steps, such as how the function normalize_data normalizes input data and how the function filter_data filters data.
[1736] Providing results
[1737] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[1738] Specific examples
[1739] Below is an overview of the materials generated by this system, using the following Python source code as an example. For example, suppose you have the following Python code:
[1740] def normalize_data(data):
[1741] normalized_data = [x / max(data) for x in data]
[1742] return normalized_data
[1743] def filter_data(data):
[1744] filtered_data = [x for x in data if x > 0.5]
[1745] return filtered_data
[1746] def main():
[1747] raw_data = [10, 20, 30, 40, 50]
[1748] normalized_data = normalize_data(raw_data)
[1749] final_data = filter_data(normalized_data)
[1750] print(final_data)
[1751] if __name__ == "__main__":
[1752] main()
[1753] Based on this source code, the server generates the following materials:
[1754] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[1755] Class diagram: Not applicable, as this example does not contain any classes.
[1756] Instructions:
[1757] 1. The function normalize_data normalizes the input data.
[1758] 2. The function filter_data filters the normalized data.
[1759] 3. The main function processes the data as follows:
[1760] Create raw_data.
[1761] Call the normalize_data function to get normalized_data.
[1762] Call the filter_data function and get the final_data.
[1763] Output final_data.
[1764] In this way, users can easily understand the results of program analysis without any special knowledge or effort, and can share and take over efficiently.
[1765] The processing flow will be explained below.
[1766] Step 1:
[1767] The user uploads the source code file they wish to analyze through the web interface, for example, by selecting a Python file called "sample_program.py" and clicking the upload button.
[1768] Step 2:
[1769] The server receives the uploaded source code file, saves it in temporary storage, and notifies the user that the save is complete.
[1770] Step 3:
[1771] The server passes the received source code to the parsing engine, which automatically identifies the programming language of the source code and begins parsing it using the corresponding parser.
[1772] Step 4:
[1773] The server parses the source code, breaking it down into tokens and generating an Abstract Syntax Tree (AST). For Python programs, the AST is created using the ast module.
[1774] Step 5:
[1775] The server analyzes the AST and extracts key functions and processing blocks. Based on the extracted information, it builds a flowchart data structure. For example, it models conditional branches, loop structures, and other elements as nodes and edges that visually represent them.
[1776] Step 6:
[1777] The server draws the flowchart using an external library (e.g., Graphviz) and saves the generated results in temporary storage.
[1778] Step 7:
[1779] If the server is also an object-oriented program, it analyzes all classes and their relationships, extracting class names, methods, properties, and inheritance relationships, and converting them into a data structure for a class diagram.
[1780] Step 8:
[1781] The server draws the class diagram using an external library (e.g., PlantUML) and saves the generated results in temporary storage.
[1782] Step 9:
[1783] The server generates a procedure manual that describes the processing flow for each function in natural language. It analyzes the role and operation procedures of each function and creates a procedure manual as a summary.
[1784] Step 10:
[1785] The server converts the generated flowcharts, class diagrams, and procedure manuals into PDF or image format and generates a download link.
[1786] Step 11:
[1787] The terminal provides the link of the generated material from the server to the user, and the user uses the provided link to download the required material and save it in the local environment.
[1788] Step 12:
[1789] Users can check the downloaded materials and share them with their own work or team members, which prevents dependency on individual people and enables efficient handover.
[1790] Example 1
[1791] 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."
[1792] Traditionally, documenting program source code has been a time-consuming and labor-intensive process, and the resulting documentation often contains subjective descriptions, resulting in inconsistent quality. This has resulted in difficulties in program handover and maintenance, leading to inefficient work. It has also been difficult to quickly understand the overall structure and main processing content of a program. Therefore, there is a need for a system that can automatically generate flowcharts, class diagrams, and procedure manuals from source code analysis, providing consistent documentation.
[1793] 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.
[1794] In this invention, the server includes means for receiving program source code, means for automatically determining the language of the received source code, means for syntactically analyzing the received source code and generating an abstract syntax tree, means for extracting each function and major processing blocks, means for generating a flowchart based on the extracted information, means for analyzing the classes and inheritance relationships of an object-oriented program and generating a class diagram, means for generating a procedure manual that describes the processing content and important steps of each function in natural language, means for making the generated flowcharts, class diagrams, and procedure manuals available for download by users, means for allowing users to select and specify programs by uploading source code, and means for a syntax analysis engine that supports multiple languages and selects an appropriate parser based on the file extension and content to perform syntax analysis.This automatically generates high-quality documentation from the program source code, allowing users to quickly and efficiently understand the overall structure and major processing content of the program.
[1795] "Program source code" means the textual instructions that describe a computer program.
[1796] The "means for receiving" is a mechanism that has the function of receiving data sent from a user and storing it in temporary storage for use in processing.
[1797] "Means for automatic language detection" is a function that automatically identifies the programming language from the file extension and contents of the source code, and selects the appropriate analysis method based on the results.
[1798] "Syntax analysis" is the process of analyzing the grammar and structure of program source code and is a method of generating an abstract syntax tree (AST).
[1799] An "abstract syntax tree (AST)" is a data structure that represents the syntactic structure of source code as a tree structure, with each node representing a program element (such as a statement or expression).
[1800] "Means for extracting each function and major processing block" is a function that automatically extracts each function and processing element within a program from the results of syntax analysis.
[1801] A "flowchart" is a diagram that visually represents the processing flow of a program, and shows the order of processing, branches, and loops.
[1802] A "class diagram" is a diagram that visually represents the structure of classes and the relationships between them in an object-oriented program.
[1803] A "procedure manual" is a document that describes each function and processing procedure of a program in natural language.
[1804] "Means for generating procedures written in natural language" refers to a function that organizes and describes each function and processing content of a program in natural language based on the analysis results.
[1805] "Means for making documents and diagrams available for download" refers to the function of providing a link or button that allows users to easily obtain the generated documents and diagrams.
[1806] The "means by which a user can select and specify a program through uploading" is an interface that allows a user to select the source code file of a program that they wish to analyze and send it via the online system.
[1807] A "syntax parsing engine" is a software component that analyzes source code according to the grammar of a particular programming language and generates an abstract syntax tree.
[1808] "Supporting multiple languages" means supporting a variety of programming languages and having the ability to perform analysis according to the characteristics of each language.
[1809] "Selecting an appropriate parser" is the process of determining the language of the source code, then selecting a parser specialized for that language to perform accurate parsing.
[1810] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. This system makes it easy to document programs that are dependent on individual users, and can significantly reduce the amount of work required for handover.
[1811] System Overview
[1812] The system of the present invention is composed of three main entities: a server, a terminal, and a user. The roles of each are explained below.
[1813] Server Roles
[1814] The server plays a central role in receiving source code provided by users and automatically generating various documents based on it. Specifically, it has the following functions:
[1815] 1. Receiving the Source Code:
[1816] The server receives source code files uploaded by users through a web interface and stores them in temporary storage, during which the files are also checked for integrity and scanned for viruses.
[1817] 2. Parsing:
[1818] The server automatically determines the language of the received source code and selects an appropriate parsing engine based on the results. For example, in the case of Python, it uses a Python-specific parsing engine (e.g., AST module) to generate an abstract syntax tree (AST).
[1819] 3. Flowchart generation:
[1820] The server extracts each function and major processing block based on the parsing results, and generates a flowchart based on that information, which is then visually represented using an external library (e.g., Graphviz).
[1821] 4. Class diagram generation:
[1822] For object-oriented programs, the server analyzes all classes and their inheritance relationships and generates a class diagram, which is visually drawn using an external library (e.g., PlantUML).
[1823] 5. Procedure generation:
[1824] Generates a procedure manual that describes the processing details and important steps of each function in natural language. Organizes the analysis results and provides them as an easy-to-understand natural language procedure manual.
[1825] 6. Results provided:
[1826] The server saves the generated flowcharts, class diagrams, and procedure manuals in PDF or image format and generates a link that allows users to download them.
[1827] Device Role
[1828] The terminal provides an interface through which users can access the system, upload source code, and view and download generated documentation.
[1829] 1. User Interface:
[1830] The terminal provides the user with an interface through a web browser, allowing them to upload source code, view documentation, and download it.
[1831] User Roles
[1832] Users upload the source code they wish to analyze and can then review and download the generated flowcharts, class diagrams, and procedure manuals.
[1833] Specific examples
[1834] Here we will use some Python source code as an example to explain how this system works.
[1835] Suppose you have the following Python code:
[1836] def normalize_data(data):
[1837] normalized_data = [x / max(data) for x in data]
[1838] return normalized_data
[1839] def filter_data(data):
[1840] filtered_data = [x for x in data if x > 0.5]
[1841] return filtered_data
[1842] def main():
[1843] raw_data = [10, 20, 30, 40, 50]
[1844] normalized_data = normalize_data(raw_data)
[1845] final_data = filter_data(normalized_data)
[1846] print(final_data)
[1847] if __name__ == "__main__":
[1848] main()
[1849] An example of the prompt when uploading this source code is as follows:
[1850] Analyze Python source code and generate flowcharts and instructions, including the auto-detected file language and the parsing engine used.
[1851] The system of the present invention automatically generates the following materials from this source code:
[1852] Flowchart: Visualizes each function and its processing flow, showing the execution flow of the main() function.
[1853] Class diagram: Not applicable, as this example does not contain any classes.
[1854] Instructions:
[1855] 1. The function normalize_data normalizes the input data.
[1856] 2. The function filter_data filters the normalized data.
[1857] 3. The main function processes the data as follows:
[1858] Create raw_data.
[1859] Call the normalize_data function to get normalized_data.
[1860] Call the filter_data function and get the final_data.
[1861] Output final_data.
[1862] Through the above process, users can easily understand the results of program analysis without any special knowledge or effort, and can share and take over efficiently.
[1863] The flow of the identification process in the first embodiment will be described with reference to FIG.
[1864] Step 1: Receive the source code
[1865] (Subject: User, Server)
[1866] 1. User uploads source code file:
[1867] The user uses a web interface to upload the source code file they want to analyze to the server. For example, they select a Python file called "sample_program.py." The input is the source code file, and the output is the file sent to the server.
[1868] 2. The server receives and saves the file:
[1869] The server receives source code files uploaded by users and stores them in temporary storage. The input is the file sent by the user, and the output is the saved file. File integrity checks and virus scans are also performed in this step.
[1870] Step 2: Parsing
[1871] (Subject: Server)
[1872] 1. The server determines the file type:
[1873] The server automatically determines the programming language from the extension and content of the received source code file. The input is the saved source code file, and the output is the language determination result (e.g., Python).
[1874] 2. The server parses it with the appropriate parser:
[1875] The server selects a parsing engine appropriate for the identified language. For example, for a Python program, it generates an abstract syntax tree (AST) using a parsing engine dedicated to Python (e.g., the AST module). The input is the language identification result and the source code content, and the output is the generated AST.
[1876] Step 3: Generate a flowchart
[1877] (Subject: Server)
[1878] 1. The server extracts the processing flow based on the parsing results:
[1879] The server extracts each function and major processing block based on the AST information obtained from the syntax analysis. The input is the AST, and the output is information about each function and processing block.
[1880] 2. The server draws the flowchart:
[1881] The server uses external libraries (e.g., Graphviz) to generate a flowchart that visually represents the extracted information. The input is the information of functions or processing blocks, and the output is a visual flowchart. For example, conditional branch points are drawn as diamonds, and processing blocks are drawn as rectangles.
[1882] Step 4: Generate a class diagram
[1883] (Subject: Server)
[1884] 1. The server analyzes class definitions and inheritance relationships:
[1885] For object-oriented programs, the server analyzes all classes and their inheritance relationships. The input is the AST, and the output is information about classes and inheritance relationships.
[1886] 2. The server draws the class diagram:
[1887] The server uses an external library (e.g., PlantUML) to visually draw class diagrams. The input is class and inheritance relationship information, and the output is a visual class diagram. The relationships and inheritance relationships between classes are visually represented.
[1888] Step 5: Generate instructions
[1889] (Subject: Server)
[1890] 1. The server describes what the function does:
[1891] The server describes the processing details and important steps of each function in natural language. The input is information about each function and process, and the output is the procedure described in natural language.
[1892] 2. The server generates instructions:
[1893] The server organizes the analysis results based on the procedure template and generates an easy-to-understand natural language procedure manual. The input is the natural language description and the procedure manual template, and the output is the final procedure manual.
[1894] Step 6: Delivering results
[1895] (Subject: terminal, user)
[1896] 1. The device displays the results to the user:
[1897] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The inputs are files and data of various products, and the output is a visual display on the user interface.
[1898] 2. User downloads the materials:
[1899] Users can download the displayed materials as needed. The server provides the generated materials in PDF or image format and returns a download link to the user. The input is a download request and the output is a download link.
[1900] (Application example 1)
[1901] 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."
[1902] The control programs of automated machines used in factories are often complex and contain vast amounts of information, requiring a great deal of time and effort to understand and maintain. Furthermore, the introduction of new programs and the updating of existing programs can be difficult, especially when different people are in charge. In these circumstances, there is a need for a method to easily and quickly understand the structure of control programs and to visualize and document their contents.
[1903] 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.
[1904] In this invention, the server includes means for receiving program source code, means for parsing the syntax of the received source code, and means for analyzing the control program of the automated factory machine and automatically generating visual and document materials, thereby enabling complex control programs to be easily and quickly understood and enabling the automatic generation of visual flowcharts, class diagrams, and procedure manuals.
[1905] "Program" means a set of instructions, including source code and its execution steps, that cause a computer or automated machine to perform a specific operation.
[1906] "Source code" is textual code that describes the behavior of a program and is written in a human-readable format.
[1907] "Syntax analysis" is the process of analyzing source code to understand its structure and meaning.
[1908] "Syntax analysis results" refers to the data or information obtained after syntactic analysis, and indicates the structure and processing flow of the source code.
[1909] A "flowchart" is a diagram that visually represents the processing steps of a program, showing the flow of functions and processing blocks.
[1910] A "class diagram" is a visual representation of classes, their attributes, methods, and the relationships between classes in an object-oriented program.
[1911] A "procedure manual" is a document that describes each process and important steps of a program in natural language.
[1912] "Factory automation" refers to machinery used to automate specific tasks within a factory.
[1913] "Analysis" is the act of investigating information or data and clarifying its structure and content.
[1914] "Visual materials" are data or information converted into a format that is easy to understand visually, and include things like flowcharts and class diagrams.
[1915] "Documentation" refers to written information in text format, including procedures and the like.
[1916] This invention relates to a system that analyzes the control programs of automated machines used in factories and automatically generates visual and written materials. This system greatly simplifies the understanding and maintenance of complex control programs, and makes it easy to introduce new programs and update them.
[1917] Overall system configuration
[1918] The system has the following main functions:
[1919] 1. Receiving the program source code
[1920] The server allows users to upload source code files they wish to analyze through a web interface.
[1921] 2. Parsing
[1922] The server passes the received source code to a dedicated parsing engine to analyze the program structure. In the case of Python programs, the server uses a dedicated parsing engine to generate an abstract syntax tree (AST).
[1923] 3. Flowchart generation
[1924] Based on the results of the syntax analysis, the server extracts each function and major processing block of the program, and generates a flowchart based on them. The flowchart is visually drawn using an external library (e.g., graphviz).
[1925] 4. Class diagram generation
[1926] For object-oriented programs, the server analyzes all classes and their inheritance relationships and generates a class diagram. It uses an external library (e.g., docx) to visually render the class diagram.
[1927] 5. Procedure generation
[1928] The server analyzes the abstract syntax tree and generates a procedure manual that describes each function and important steps of the program in natural language.
[1929] 6. Provision of Materials
[1930] The server provides the generated flowcharts, class diagrams, and procedures to the user and displays them in a downloadable format (e.g., PDF, image format).
[1931] Hardware and software used
[1932] The server uses hardware with a powerful processor and sufficient memory, and the following software:
[1933] Parsing engine: the ast module for Python programs
[1934] Flowchart generation: graphviz library
[1935] Class diagram generation: docx library
[1936] Instruction Generation: Custom parsing and generation algorithms
[1937] Specific examples
[1938] An example will be explained using the following source code:
[1939] Source code example:
[1940] def main():
[1941] start_robot()
[1942] move_robot()
[1943] stop_robot()
[1944] def start_robot():
[1945] print('Robot started')
[1946] def move_robot():
[1947] print('Robot moving')
[1948] def stop_robot():
[1949] print('Robot stopped')
[1950] if __name__ == "__main__":
[1951] main()
[1952] flowchart:
[1953] The server visually represents the calling relationship between the start_robot, move_robot, and stop_robot functions called within the main function.
[1954] Class diagram:
[1955] In this example, no classes are included, so no class diagram is generated.
[1956] Instructions:
[1957] The server generates instructions like this:
[1958] 1. The function start_robot displays the robot startup message.
[1959] 2. The function move_robot displays the robot's movement message.
[1960] 3. The function stop_robot displays a message that the robot has stopped.
[1961] 4. The main function controls the robot by following these steps:
[1962] Call start_robot to start the robot.
[1963] Call move_robot to move the robot.
[1964] Call stop_robot to stop the robot.
[1965] Prompt Sentence Examples
[1966] Please upload the source code to be analyzed.
[1967] As a result, the convenience of control programs within factories is improved, and developers can effectively introduce new programs and maintain existing programs.
[1968] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[1969] Step 1:
[1970] Users upload the source code files they wish to analyze through a web interface, where they select the desired source code files using a file selection dialog. The input is the source code file (e.g., a Python file), and the output is the source code data sent to the server.
[1971] Step 2:
[1972] The server saves the received source code file in temporary storage, obtains the saved file path, and prepares for the next process. The input is the source code data sent by the user, and the output is the file path saved in temporary storage.
[1973] Step 3:
[1974] The server passes the stored source code to a parsing engine for analysis. Specifically, it uses a parsing engine (e.g., the ast module for Python) to generate an Abstract Syntax Tree (AST). The input is the source code file path, and the output is an AST data structure.
[1975] Step 4:
[1976] The server extracts each function and major processing block of the program based on the AST data structure. At this stage, function definitions, conditional branches, loop structures, etc. are identified. The input is the AST data, and the output is a list of functions and processing blocks.
[1977] Step 5:
[1978] The server generates a flowchart based on the extracted information. It uses libraries such as graphviz to visually depict function calls and processing flows. The input is a list of functions and processing blocks, and the output is a flowchart image.
[1979] Step 6:
[1980] For object-oriented programs, the server analyzes all classes and their inheritance relationships from the AST data and generates a class diagram using the docx library. The input is the AST data and the output is a class diagram document.
[1981] Step 7:
[1982] The server generates a procedure manual that describes the processing details and important steps of each function in natural language. Specifically, it analyzes the AST data and describes the function's behavior in text format. The input is the AST data, and the output is text data that serves as the procedure manual.
[1983] Step 8:
[1984] The server provides the generated flowcharts, class diagrams, and procedure manuals to the user, who can then review them and download them as PDFs or images if necessary. The inputs are flowchart images, class diagram documents, and procedure manual text, and the output is a download link that is displayed to the user.
[1985] In this way, the server analyzes the source code at each step and generates and provides visual and text-based materials, making it easier to understand and maintain the control programs of automatic machines used in factories.
[1986] 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.
[1987] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. It also improves the user experience by combining it with an emotion engine that recognizes the user's emotions and adaptively changes the interface display content and the format of the generated materials based on the recognition results.
[1988] Overall system configuration
[1989] The system has the following main functions:
[1990] 1. Receiving source code (user uploads program)
[1991] 2. Parsing (the server analyzes the source code)
[1992] 3. Flowchart generation (the server visualizes the processing flow)
[1993] 4. Class diagram generation (the server visualizes object relationships)
[1994] 5. Procedure generation (the server describes the processing procedure in natural language)
[1995] 6. Providing the results (the device provides the generated data to the user)
[1996] 7. Emotion engine (the server recognizes the user's emotions and adaptively adjusts the interface and materials based on those emotions)
[1997] Program processing
[1998] Receiving the source code
[1999] The user uploads the source code file they wish to analyze through the web interface. For example, they select a Python file called "sample_program.py" and click the upload button. The server receives the uploaded source code and stores it in temporary storage.
[2000] Parsing
[2001] The server passes the received source code to the analysis engine, which automatically detects the programming language of the source code and begins analysis using the corresponding parser. For example, in the case of a Python program, the server uses a Python-specific parsing engine to generate an abstract syntax tree (AST).
[2002] Flowchart generation
[2003] The server extracts each function and major processing block of the program based on the results of syntax analysis. It then builds a flowchart data structure based on the extracted information and uses an external library to draw the flowchart. For example, it visually represents the processing flow, including conditional branching and loop structures.
[2004] Class diagram generation
[2005] For object-oriented programs, the server analyzes all classes and their inheritance relationships to generate a class diagram. It extracts class names, methods, properties, etc. and converts them into data structures for the class diagram. It uses an external library to visually draw the class diagram.
[2006] Procedure generation
[2007] The server generates a natural language description of each function's process and key steps, such as how the function normalize_data normalizes input data and how the function filter_data filters data.
[2008] Providing results
[2009] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[2010] Emotion Engine Operation
[2011] When a user uses the system, the server uses an emotion engine to recognize the user's emotions in real time. For example, it can detect when the user is impatient or irritated.
[2012] Based on the recognized emotion, the server adaptively changes the content displayed in the user interface. For example, if the user is impatient, the server simplifies the information and highlights important messages. It also adjusts the content of generated procedure manuals and flowcharts to help the user understand them better. For example, it adds detailed steps or emphasizes important points.
[2013] Specific examples
[2014] Below is an overview of the materials generated by this system, using the following Python source code as an example. For example, suppose you have the following Python code:
[2015] def normalize_data(data):
[2016] normalized_data = [x / max(data) for x in data]
[2017] return normalized_data
[2018] def filter_data(data):
[2019] filtered_data = [x for x in data if x > 0.5]
[2020] return filtered_data
[2021] def main():
[2022] raw_data = [10, 20, 30, 40, 50]
[2023] normalized_data = normalize_data(raw_data)
[2024] final_data = filter_data(normalized_data)
[2025] print(final_data)
[2026] if __name__ == "__main__":
[2027] main()
[2028] Based on this source code, the server generates the following materials:
[2029] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[2030] Class diagram: Not applicable, as this example does not contain any classes.
[2031] Instructions:
[2032] 1. The function normalize_data normalizes the input data.
[2033] 2. The function filter_data filters the normalized data.
[2034] 3. The main function processes the data as follows:
[2035] Create raw_data.
[2036] Call the normalize_data function to get normalized_data.
[2037] Call the filter_data function and get the final_data.
[2038] Output final_data.
[2039] The emotion engine recognizes the user's emotions and, if the user is feeling impatient, adds additional explanations to the instructions and emphasizes important parts. It also adjusts the flow charts and interface display to make them simpler and easier to understand.
[2040] In this way, users can easily understand the results of program analysis and share or take over efficiently without any special knowledge or effort.In addition, an adaptive interface that takes user emotions into consideration can improve the user experience.
[2041] The processing flow will be explained below.
[2042] Step 1:
[2043] The user uploads the source code file they wish to analyze through the web interface, for example, by selecting a Python file called "sample_program.py" and clicking the upload button.
[2044] Step 2:
[2045] The server receives the uploaded source code file, saves it in temporary storage, and notifies the user that the save is complete.
[2046] Step 3:
[2047] The server passes the received source code to a parsing engine, which automatically detects the programming language of the source code and begins parsing it using the corresponding parser. For example, in the case of a Python program, the server uses a parsing engine specifically designed for Python to generate an abstract syntax tree (AST).
[2048] Step 4:
[2049] The server parses the AST and extracts key functions and processing blocks, such as function definitions, conditional branches, and loop structures.
[2050] Step 5:
[2051] The server builds a flowchart data structure based on the analysis results. Each extracted function or processing block is modeled as a node, and the relationships between them are represented as edges.
[2052] Step 6:
[2053] The server uses an external library (e.g., Graphviz) to draw the flowchart and saves the generated results in temporary storage.
[2054] Step 7:
[2055] The server generates a class diagram based on the analysis results. If it is an object-oriented program, it extracts class names, methods, properties, inheritance relationships, etc. and converts them into a data structure for a class diagram. This can then be visualized using an external library (e.g., PlantUML).
[2056] Step 8:
[2057] The server generates a natural language procedural manual detailing each function's operation and key steps, for example, the function normalize_data performs data normalization, and the function filter_data performs filtering.
[2058] Step 9:
[2059] The server activates the emotion engine to recognize the user's emotions in real time. It uses a webcam and microphone to analyze the user's facial expressions and tone of voice to determine the user's emotions.
[2060] Step 10:
[2061] The server adaptively changes the content displayed in the user interface based on the recognized emotion. For example, if the user is feeling impatient, the screen display will be simplified and important messages will be highlighted.
[2062] Step 11:
[2063] The server adjusts the content and format of the instructions and flowcharts it generates based on the recognized emotions, for example adding additional explanations or annotations to instructions if the user is confused.
[2064] Step 12:
[2065] The terminal displays the generated flowcharts, class diagrams, and procedure manuals to the user. The user can check them and download them as needed. The server provides these materials in PDF or image format and returns a download link to the user.
[2066] Step 13:
[2067] Users can use the provided link to download the generated documents to their local environment and share them with their work or team members, preventing dependency on individual users and enabling efficient handover.
[2068] Example 2
[2069] 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."
[2070] Conventional program analysis systems are limited to analyzing source code and generating flowcharts, class diagrams, and procedure manuals. Furthermore, their user interfaces are fixed and cannot be flexibly adjusted according to the user's feelings and level of understanding. This can limit the user experience and hinder efficient work.
[2071] 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. In this invention, the server includes means for receiving program source code, means for parsing the received source code, means for generating a flowchart based on the parsing result, means for generating a class diagram based on the parsing result, means for generating a procedure manual based on the parsing result, means for enabling the user to download the generated flowchart, class diagram, and procedure manual, and means for recognizing the user's emotions and adaptively changing the interface and materials based on the recognition result. This makes it possible to adaptively adjust the interface and generated materials according to the user's emotions and level of understanding, thereby providing a more efficient and comfortable work environment.
[2072] "Program source code" means the text that describes a computer program, written in a particular programming language.
[2073] "Means for receiving source code" refers to the method or technology by which a computer system receives source code provided by a user.
[2074] "Means of parsing" refers to techniques and tools for analyzing source code and understanding its structure and meaning.
[2075] "Means for generating a flowchart" refers to the methods and techniques used to visually represent the processing flow of a program.
[2076] A "means for generating class diagrams" refers to a method or technique for visually representing the relationships between classes in an object-oriented program.
[2077] "Means for generating a procedure manual" refers to a method or technology for creating a document that describes the program's operations and processing procedures in natural language.
[2078] "Means for making the data downloadable" refers to methods and techniques that allow users to save the generated flowcharts, class diagrams, and procedures to their own computers.
[2079] "Means for recognizing emotions" refers to techniques and methods for identifying a user's emotional state by analyzing the user's facial expressions and operation patterns.
[2080] "Means for adaptively changing interfaces and materials" refers to techniques and methods for dynamically adjusting the display content and structure according to the user's emotions and situation.
[2081] "User" refers to a person who uses this system to check the analysis results of a program and generate materials.
[2082] "Server" refers to a computer system that provides this system and processes requests from users.
[2083] "Terminal" refers to a device such as a computer or smartphone that a user uses to access this system.
[2084] This invention relates to a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. It also improves the user experience by combining an emotion engine that recognizes the user's emotions and adaptively changes the interface display content and the format of the generated materials based on the recognition results.
[2085] Overall system configuration
[2086] The system has the following main functions:
[2087] 1. Receiving source code (user uploads program)
[2088] 2. Parsing (the server analyzes the source code)
[2089] 3. Flowchart generation (the server visualizes the processing flow)
[2090] 4. Class diagram generation (the server visualizes object relationships)
[2091] 5. Procedure generation (the server describes the processing procedure in natural language)
[2092] 6. Providing the results (the device provides the generated data to the user)
[2093] 7. Emotion engine (the server recognizes the user's emotions and adaptively adjusts the interface and materials based on those emotions)
[2094] Hardware and software used
[2095] The server includes an analysis engine, a database, an emotion recognition system, and a diagram generation library. The analysis engine uses a Python-specific parsing engine. Graphviz and PlantUML are used for diagram generation, and computer vision technology is used for emotion recognition.
[2096] A terminal is a device, such as a computer or smartphone, that a user uses to operate a web interface, through which the user uploads source code and downloads artifacts.
[2097] Specific examples
[2098] For example, suppose you enter the following Python code:
[2099] def normalize_data(data):
[2100] normalized_data = [x / max(data) for x in data]
[2101] return normalized_data
[2102] def filter_data(data):
[2103] filtered_data = [x for x in data if x > 0.5]
[2104] return filtered_data
[2105] def main():
[2106] raw_data = [10, 20, 30, 40, 50]
[2107] normalized_data = normalize_data(raw_data)
[2108] final_data = filter_data(normalized_data)
[2109] print(final_data)
[2110] if __name__ == "__main__":
[2111] main()
[2112] Based on this source code, the server generates the following materials:
[2113] Flowchart: Visualize each function and its processing flow. Shows the execution flow of the main() function.
[2114] Class diagram: Not applicable, as this example does not contain any classes.
[2115] Instructions:
[2116] 1. The function normalize_data normalizes the input data.
[2117] 2. The function filter_data filters the normalized data.
[2118] 3. The main function processes the data as follows:
[2119] Create raw_data.
[2120] Call the normalize_data function to get normalized_data.
[2121] Call the filter_data function and get the final_data.
[2122] Output final_data.
[2123] The emotion engine recognizes the user's emotions and, if the user is feeling impatient, adds supplementary explanations to the instructions and emphasizes important parts. It also adjusts the display content of flowcharts and interfaces to be simple and easy to understand. In this way, users can easily understand the results of program analysis without requiring special knowledge or effort, and can share and hand over the results efficiently. Furthermore, an adaptive interface that takes the user's emotions into account can improve the user experience.
[2124] The flow of the identification process in the second embodiment will be described with reference to FIG.
[2125] Step 1:
[2126] Selecting the input file
[2127] Using the web interface, users select the source code file they wish to analyze, for example a Python file called "sample_program.py," and click the upload button.
[2128] Input: Source code file (e.g. "sample_program.py")
[2129] Output: Source code files selected and ready to upload
[2130] Step 2:
[2131] Uploading a file
[2132] When the user clicks the upload button, the device sends the selected file to the server, which then stores the received file in temporary storage.
[2133] Input: Selected source code file
[2134] Output: Source code files uploaded to the server and saved in temporary storage
[2135] Step 3:
[2136] Identifying the programming language
[2137] The server automatically determines the programming language from the extension and header information of the received source code file. For example, ".py" is recognized as Python, and ".java" as Java.
[2138] Input: Source code files stored on the server
[2139] Output: The identified programming language (e.g. Python)
[2140] Step 4:
[2141] Analysis engine selection
[2142] The server selects the parsing engine that corresponds to the identified programming language. For example, if the language is Python, it uses a parsing engine specifically for Python.
[2143] Input: The determined programming language
[2144] Output: Selected parsing engine (e.g., Python-specific parsing engine)
[2145] Step 5:
[2146] Abstract Syntax Tree Generation
[2147] The server uses the selected parsing engine to analyze the source code and generate an Abstract Syntax Tree (AST). In the case of Python, the AST is generated by the Python parsing engine.
[2148] Input: Source code files, selected analysis engine
[2149] Output: Abstract Syntax Tree (AST)
[2150] Step 6:
[2151] Extracting functions and processing blocks
[2152] The server extracts each function and major processing block from the parsed result, for example, identifying each function, loop, conditional branch, etc.
[2153] Input: Abstract Syntax Tree (AST)
[2154] Output: Information about extracted functions and processing blocks
[2155] Step 7:
[2156] Flowchart data structure construction
[2157] The server builds a flowchart data structure based on the extracted information. The data structure includes processing blocks as nodes and edges connecting them.
[2158] Input: Information about the extracted function or processing block
[2159] Output: Flowchart data structure
[2160] Step 8:
[2161] Drawing a flowchart
[2162] The server uses an external library (e.g., Graphviz) to visually draw the flowchart.
[2163] Input: Flowchart data structure
[2164] Output: A visually rendered flowchart
[2165] Step 9:
[2166] Class Relationship Analysis
[2167] The server analyzes all classes, their inheritance relationships, methods, and properties from the source code of an object-oriented program. For example, it extracts information such as class A inherits class B, and class B has five methods.
[2168] Input: Source code file
[2169] Output: Extracted class relationship information
[2170] Step 10:
[2171] Building data structures for class diagrams
[2172] The server constructs a data structure of a class diagram based on the extracted class relationship information.
[2173] Input: Extracted class relationship information
[2174] Output: Class diagram data structure
[2175] Step 11:
[2176] Drawing a class diagram
[2177] The server uses an external library (e.g., PlantUML) to visually draw class diagrams.
[2178] Input: Class diagram data structure
[2179] Output: A visually rendered class diagram
[2180] Step 12:
[2181] Description of processing content
[2182] The server generates a procedure that describes in natural language what each function does and the key steps it takes, for example, the function normalize_data normalizes the input data, and the function filter_data filters the data for specific conditions.
[2183] Input: Information about the extracted function or processing block
[2184] Output: Natural language instructions
[2185] Step 13:
[2186] View generated materials
[2187] The terminal displays the generated flowcharts, class diagrams, and procedures to the user, who can then check them and download them as needed.
[2188] Input: Flowcharts, class diagrams, procedures
[2189] Output: User-visible materials, downloadable links
[2190] Step 14:
[2191] Provide download links for materials
[2192] The server provides the generated materials in PDF or image format and returns a download link to the user.
[2193] Input: Flowcharts, class diagrams, procedures
[2194] Output: PDF and image documents, download links
[2195] Step 15:
[2196] Emotion recognition
[2197] When a user uses the system, the server uses an emotion engine to recognize emotions in real time from the user's facial expressions and operation patterns. For example, it analyzes "irritation" or "impatience" from the speed of camera and mouse operations.
[2198] Input: User's facial expression data and operation patterns
[2199] Output: Recognized user emotional state
[2200] Step 16:
[2201] Adaptive change of display content
[2202] Based on the recognized emotion, the server adaptively changes the content displayed in the user interface, for example, simplifying information and highlighting important messages if the user is impatient.
[2203] Input: Perceived emotional state of the user
[2204] Output: adaptively modified interface and document display
[2205] (Application example 2)
[2206] 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."
[2207] Conventional program analysis systems analyze program source code and automatically generate flowcharts, class diagrams, and procedure manuals, but they are unable to provide an adaptive interface that takes user emotions into account. Furthermore, they do not automatically generate security procedure manuals, which are particularly important for electronic payment systems. Therefore, there is a need for a method that not only improves user experience but also implements security measures efficiently and effectively.
[2208] 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.
[2209] In this invention, the server includes means for receiving program source code, means for parsing the received source code, means for generating a flowchart based on the parsing result, means for generating a class diagram based on the parsing result, means for generating a procedure manual based on the parsing result, means for making the generated flowchart, class diagram, and procedure manual available for download by users, means for recognizing user emotions and adaptively changing the display content of the interface and the format of the generated materials, means for generating a security procedure manual for the electronic payment system, and means for making the generated security procedure manual available for download by users. This improves the user experience and makes it possible to efficiently implement advanced security measures for the electronic payment system.
[2210] "Program source code" is a set of instructions written to implement a computer program.
[2211] "Means for receiving" refers to a device or program that has the function of taking in data transmitted from outside and storing or analyzing it.
[2212] "Syntax analysis" is the operation of analyzing the structure of a program's source code using a syntax analysis engine.
[2213] A "flowchart" is a diagram that visually represents the processing flow of a program or process.
[2214] A "class diagram" is a visual representation of the class structure and relationships in an object-oriented program.
[2215] A "procedure manual" is a document that describes in natural language the steps and methods for performing a specific task.
[2216] "Means for making the data available for download" refers to a function that allows users to save the generated data to their own devices.
[2217] "Means for recognizing user emotions" refers to technology that detects emotions from the user's facial expressions, voice, text data, etc.
[2218] "Means for adaptive change" is a function that dynamically changes the interface and output results based on the detected user emotions.
[2219] An "electronic payment system" is a system that processes payments electronically via a network such as the Internet.
[2220] A "security procedure manual" is a document that describes specific procedures and instructions for strengthening system security.
[2221] The objective of this invention is to provide a system that analyzes program source code and automatically generates flowcharts, class diagrams, procedure manuals, etc. Furthermore, it aims to improve the user experience by recognizing the user's emotions and adaptively changing the interface display content and the format of the generated materials.
[2222] The entire system mainly functions among the three parties: the server, the terminal, and the user. A specific embodiment of the system is shown below.
[2223] System Configuration
[2224] The server includes means for receiving program source code, means for parsing the source code, means for generating flowcharts based on the analysis results, means for generating class diagrams, and means for generating procedure manuals. The server also includes means for recognizing user emotions and adaptively changing the interface and generated materials, and means for generating security procedure manuals for electronic payment systems. All generated materials are configured to be downloadable by users via their terminals.
[2225] Software Configuration
[2226] The main software running on the server includes:
[2227] 1. Flask: Used as a web framework, it receives source code files from users, processes emotion recognition results, and provides the generated results.
[2228] 2. EmotionEngine: A module for recognizing user emotions, analyzing facial expressions, voice, text data, etc. to identify the user's emotions.
[2229] 3. CodeAnalyzer: A module that analyzes source code syntax and automatically generates flowcharts, class diagrams, and procedure manuals.
[2230] Program processing
[2231] The process flow can be explained as follows: A user uploads the source code of an electronic payment system to the server via a smartphone application. The server receives the source code and performs syntax analysis using the CodeAnalyzer module. Based on the analysis results, a program flowchart, class diagram, and procedure manual are automatically generated.
[2232] The server simultaneously recognizes the user's emotions in real time using the EmotionEngine module. For example, if the user is feeling stressed, the server adaptively changes the generated results and interface to make them simpler and easier to understand. The generated flowcharts, class diagrams, procedure manuals, and security procedures manuals can then be downloaded by the user.
[2233] Specific examples
[2234] Here is a concrete example: A user is performing a security check on an electronic payment system and performs the following operations:
[2235] 1. The user launches the application and uploads the source code files.
[2236] 2. The server parses the received source code and generates flowcharts, class diagrams, and procedure manuals.
[2237] 3. The server uses the EmotionEngine to recognize the user's emotions and adaptively change the product and interface as needed.
[2238] 4. Finally, the generated materials are available for users to download.
[2239] Prompt Sentence Examples
[2240] "If you want to upload the source code of an electronic payment system and perform a security check, select the source code file and press the 'Upload' button. The system will automatically generate flowcharts and security procedures, and display them appropriately based on the user's emotions."
[2241] This system allows users to obtain analysis results of electronic payment systems quickly and adaptively, significantly improving safety and efficiency.
[2242] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[2243] Step 1:
[2244] A user launches the application, selects and uploads a source code file for an electronic payment system. The input is the source code file, which is sent to the server. The output is the state in which the server has received the source code file.
[2245] Step 2:
[2246] The server stores the received source code in temporary storage. The input is the uploaded source code file, and the output is the source code file stored in the server's temporary storage. This operation includes storing the binary data of the file.
[2247] Step 3:
[2248] The server passes the source code to the CodeAnalyzer module for syntax analysis. The input is the saved source code file, and the output is the analysis result of the source code (abstract syntax tree and symbol table). In this step, the structure of the program is analyzed.
[2249] Step 4:
[2250] The server generates flowcharts, class diagrams, and procedure manuals based on the analysis results of CodeAnalyzer. The input is the source code analysis results, and the output is flowcharts, class diagrams, and procedure manuals. Flowcharts visualize the program's processing flow, class diagrams show object relationships, and procedure manuals are documents that explain processing procedures in natural language.
[2251] Step 5:
[2252] The server uses the EmotionEngine module to recognize the user's emotions in real time. The input is emotional data such as the user's facial expressions, voice, and text data, and the output is the recognized emotional state (e.g., stress, relaxation, irritation, etc.). Specifically, data is collected using a camera and microphone.
[2253] Step 6:
[2254] The server adaptively changes the generated materials and interface based on the recognized emotions. The input is the recognized emotional state and the generated flowchart, class diagram, and procedure manual. The output is the display content and format of the materials adjusted according to the emotional state. For example, if stress is detected, the materials will be simplified and important parts will be highlighted.
[2255] Step 7:
[2256] The server generates links to provide the generated flowcharts, class diagrams, procedures, and security measures procedures to the user and sends them to the user's device. The input is the adjusted materials, and the output is a link that the user can download. Specifically, this includes converting the materials to PDF or image format and saving them in cloud storage.
[2257] Step 8:
[2258] The user can download the generated materials (flowcharts, class diagrams, procedures, and security procedures) via the provided link and use them to strengthen and understand the security of the system. The input is the download link, and the output is the materials saved in the user's local environment.
[2259] This allows users to quickly and adaptively obtain the results of source code analysis of electronic payment systems, which can be useful for security measures and system understanding.
[2260] 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.
[2261] 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.
[2262] 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 robot 414.
[2263] 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.
[2264] FIG. 9 illustrates 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 behaviors 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.
[2265] 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.
[2266] 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).
[2267] 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.
[2268] 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."
[2269] 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.
[2270] 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).
[2271] 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.
[2272] 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.
[2273] 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.
[2274] 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.
[2275] 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.
[2276] 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.
[2277] 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.
[2278] Furthermore, the hardware structure of these various processors c...
Claims
1. means for receiving the source code of the program; means for parsing the received source code; means for generating a flowchart based on the parsing result; means for generating a class diagram based on the parsing result; means for generating a procedure manual based on the parsing result; and a means for enabling users to download the generated flowcharts, class diagrams, and procedure manuals.
2. 2. The system according to claim 1, further comprising means for extracting each function or major processing block of the source code and generating a procedure manual in natural language based thereon.
3. 10. The system of claim 1, further comprising means for allowing a user to select and specify a program through uploading of source code.
Citation Information
Patent Citations
Persona chatbot control method and system
JP2022180282A