Time sequence diagram determination method, system and device, equipment and storage medium

Through the automation method based on MVC architecture, timing charts are automatically generated and optimized, which solves the problem of low efficiency in timing chart determination in the prior art, and achieves efficient and accurate timing chart generation.

CN119690546APending Publication Date: 2025-03-25NEUSOFT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411747914.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the prior art, the determination efficiency of timing charts is low, mainly because manually creating timing charts is time-consuming and error-prone.

Method used

By obtaining task information for implementing software functions, the task information is analyzed based on the model-view-controller MVC architecture, the timing chart code is automatically generated, and the code is error-detected and corrected, and the target timing chart is finally generated.

Benefits of technology

Automatic generation and automatic revision of timing charts are realized, improving the efficiency of timing chart determination and ensuring the quality of the generated timing chart.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690546A_ABST
    Figure CN119690546A_ABST
Patent Text Reader

Abstract

The invention discloses a time sequence diagram determination method and device, equipment and a storage medium, and the method comprises the steps: obtaining task information used for achieving software functions, and the task information comprises a plurality of to-be-processed tasks; analyzing the task information based on a model-view-controller (MVC) architecture, and determining a time sequence diagram code corresponding to the task information; performing error detection and error correction on the time sequence diagram code to obtain a corrected result; and generating the target time sequence diagram corresponding to the task information according to the corrected result, so that the effect of improving the determination efficiency of the time sequence diagram can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of software development technology, and in particular, relates to a timing diagram determination method, device, equipment and storage medium. Background Art

[0002] In the field of software development, the understanding of user requirements by different software developers and the emergence of inconsistent codes are usually related to deficiencies in the communication and design stages, and the sequence diagram plays an important role as a bridge between requirements transmission and architecture design. Through the sequence diagram, a clear mapping can be established between requirements understanding and system implementation, thereby effectively reducing deviations and consistency issues.

[0003] In the related art, timing Figure 1 It is usually created manually by relevant personnel. Manually creating timing diagrams is time-consuming and error-prone, and the efficiency of determining timing diagrams is low. Summary of the invention

[0004] The embodiment of the present application provides an implementation scheme different from the prior art to solve the technical problem of low efficiency in determining the timing diagram in the related art.

[0005] In a first aspect, the present application provides a method for determining a timing diagram, comprising:

[0006] Acquire task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed;

[0007] Analyze the task information based on the model-view-controller (MVC) architecture to determine the timing diagram code corresponding to the task information;

[0008] Performing error detection and error correction on the timing diagram code to obtain a corrected result;

[0009] A target timing diagram corresponding to the task information is generated according to the corrected result.

[0010] In a second aspect, the present application provides a timing diagram determination system, including: a timing diagram code generation model and a timing diagram correction model, wherein:

[0011] The timing diagram code generation model is used to obtain task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed; the task information is analyzed based on the model-view-controller (MVC) architecture to determine the timing diagram code corresponding to the task information;

[0012] The timing diagram correction model is used to perform error detection and error correction on the timing diagram code to obtain a corrected result; and generate a target timing diagram corresponding to the task information according to the corrected result.

[0013] In a third aspect, the present application provides a timing diagram determination device, comprising:

[0014] An acquisition unit, used to acquire task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed;

[0015] A determination unit, configured to analyze the task information based on a model-view-controller (MVC) architecture to determine a sequence diagram code corresponding to the task information;

[0016] A correction unit, used for performing error detection and error correction on the timing diagram code to obtain a corrected result;

[0017] A generating unit is used to generate a target timing diagram corresponding to the task information according to the corrected result.

[0018] In a fourth aspect, the present application provides an electronic device, including:

[0019] Processor; and

[0020] A memory, configured to store executable instructions of the processor;

[0021] The processor is configured to execute any method in the first aspect or any possible implementation manner of the first aspect by executing the executable instructions.

[0022] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the computer program implements any method in the first aspect or any possible implementation manner of the first aspect.

[0023] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect or any possible implementation manner of the first aspect.

[0024] The present application provides a method for obtaining task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed; analyzing the task information based on a model-view-controller (MVC) architecture to determine a timing diagram code corresponding to the task information; performing error detection and error correction on the timing diagram code to obtain a corrected result; and generating a target timing diagram corresponding to the task information according to the corrected result. The timing diagram can be automatically generated and the timing diagram can be automatically revised, which can not only realize the automatic generation of the timing diagram, but also ensure the quality of the generated timing diagram, thereby improving the efficiency of determining the timing diagram. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0026] Figure 1 A schematic diagram of the structure of a timing diagram determination system provided in an embodiment of the present application;

[0027] Figure 2a A flowchart of a method for determining a timing diagram is provided for an embodiment of the present application;

[0028] Figure 2b A schematic diagram of a timing diagram is provided for an embodiment of the present application;

[0029] Figure 3 A schematic diagram of the structure of a timing diagram determination device provided in an embodiment of the present application;

[0030] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, but cannot be understood as limiting the present application.

[0032] The terms "first" and "second" etc. in the specification, claims and drawings of the embodiments of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0033] First, some terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0034] Prompt refers to a method of adding specific information to the input sequence to stimulate the model's response. It guides the model to respond in the expected output direction by adding task-related keywords or contextual information at the beginning or end of the input sequence.

[0035] LLM, short for Large Language Model, is a model based on deep learning technology that generates and understands natural language by training a large amount of text data. The core capability of LLM is to understand and generate natural language text, and it can complete a variety of tasks such as answering questions, generating text, translating language, summarizing text, etc.

[0036] MVC architecture design is a software design pattern that divides an application into three core components: Model, View, and Controller.

[0037] In software architecture design, Controller, Service, Entity (sometimes also called Model) is a common layered architecture pattern, which helps to achieve separation of concerns and improve the maintainability and scalability of the code. Specifically, Entity (entity / model) represents the data object in the business domain, usually corresponding to a table or document in the database. It encapsulates business data and its related business rules. Service is the business logic layer, responsible for processing business operations and business rules. It usually does not interact directly with the user interface, but receives requests through the Controller. Controller is the bridge between the user interface and the business logic, responsible for receiving user requests, calling the Service layer to process business logic, and returning the response results to the user. The structural relationship between the three is: Controller calls Service: Controller is responsible for receiving user requests and calling the corresponding Service method according to the request type. Service calls Entity: When processing business logic, Service will call Entity or data access layer to perform database operations. Entity interacts with the database: Although Entity itself does not directly perform database operations, it encapsulates business data and its related business rules, and corresponds to tables or documents in the database. This layered architecture pattern helps to achieve separation of concerns, allowing developers to focus more on their respective areas of responsibility, thereby improving the maintainability and scalability of the code. At the same time, it also makes the application more flexible and easy to test.

[0038] Mermaid is a text-based diagram definition language that allows developers to create diagrams using both text and code.

[0039] Participants represent entities that interact in a sequence diagram. These entities can be objects, classes, subsystems, external systems, or even users (often referred to as "actors") within the system. Participants are elements in the vertical direction of the sequence diagram that interact with other participants through messages (method calls, signals, etc.). Participants are usually placed at the top of the sequence diagram and represented by a rectangular box with the name of the participant marked inside the box. During the execution of the sequence diagram, participants send and receive messages in chronological order. These messages are represented in the sequence diagram as solid lines with arrows pointing to the recipient of the message.

[0040] In the field of software development, the understanding of user requirements by different software developers and the emergence of inconsistent codes are usually related to deficiencies in the communication and design stages, and the sequence diagram plays an important role as a bridge between requirements transmission and architecture design. Through the sequence diagram, a clear mapping can be established between requirements understanding and system implementation, thereby effectively reducing deviations and consistency issues.

[0041] In the related art, timing Figure 1 It is usually created manually by relevant personnel. Manually creating timing diagrams is time-consuming and error-prone, and the efficiency of determining timing diagrams is low.

[0042] Applying large language models to the field of software design can realize automated and intelligent design processes, greatly improving development efficiency and design quality. If LLM understands the rules for generating sequence diagrams, it can sort out the Controller, Service, and Entity structures from the input user tasks and automatically generate sequence diagrams, which can effectively reduce the time and cost of manual design, thereby supporting agile development and rapid iteration.

[0043] This application proposes a solution that can use Prompt technology to maximize the guidance of LLM to understand the architectural principles of MVC, obtain the MVC timing diagram pseudo code expressed in Mermaid language from the input user task, and then generate the MVC timing diagram through a rendering tool.

[0044] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0045] Figure 1 A schematic diagram of a timing diagram determination system provided by an exemplary embodiment of the present application is provided. The timing diagram determination system includes: a timing diagram code generation model and a timing diagram correction model, wherein:

[0046] The timing diagram code generation model is used to obtain task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed; the task information is analyzed based on the model-view-controller (MVC) architecture to determine the timing diagram code corresponding to the task information;

[0047] The timing diagram correction model is used to perform error detection and error correction on the timing diagram code to obtain a corrected result; and generate a target timing diagram corresponding to the task information according to the corrected result.

[0048] In actual use, the timing diagram code generation model and the timing diagram correction model can be arranged on the same computer device or on different computer devices. The computer device can be a terminal or a server. The terminal can be a smart phone, a tablet computer, a laptop computer, an intelligent voice interaction device, a smart home appliance, a wearable smart device, an aircraft, an intelligent vehicle terminal and other devices. The terminal can also include a client, which can be a video client, a browser client or an instant messaging client. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0049] The timing diagram code generation model in the scheme of this application is based on the prompt word technology, which maximizes the LLM's ability to understand the principles of timing diagrams. According to the input user tasks, the various levels (Controller, Service, Entity) of the timing diagram, the level names, the calling relationships between the levels, and the specific interaction logic are identified. After extracting the key information of the timing diagram, the MVC timing diagram pseudocode expressed in the Mermaid language is generated.

[0050] Furthermore, the timing diagram correction model in the solution of the present application automatically verifies and optimizes the Mermaid timing diagram pseudocode based on the generated timing diagram code to ensure the correctness of its structure and the effective use of the participants. The generated code is verified from three aspects: message integrity, message connection rationality, and participant effectiveness. For situations that do not meet the code rules, the timing diagram correction model will provide specific feedback information and use LLM to make adaptive modifications to improve the code quality.

[0051] The timing diagram code generation model proposed in this application can enable LLM to accurately identify and generate the roles of each level required in the timing diagram and the interaction logic between the levels from the input user tasks according to the defined Prompt rules, and form the timing diagram code, thereby ensuring the accuracy of the generated timing diagram.

[0052] The timing diagram correction model proposed in this application can automatically verify and optimize the Mermaid timing diagram pseudocode, ensuring the structural correctness of the code and the effective use of the participants. When it is found that the code does not comply with the code rules, the timing diagram correction model can provide specific feedback information and use LLM to perform adaptive modifications to improve the code quality.

[0053] Optionally, a plurality of rules may be embedded in the aforementioned timing diagram code generation model, and data may be processed according to each rule. The plurality of rules include:

[0054] Rule 1: Determine the role and function information of each level in the multiple levels involved in the task information, wherein the multiple levels include each level in the MVC architecture and the user level.

[0055] Rule 2: Determine the participant definition code based on the preset display format of the roles at each level, wherein the participant definition code is a part of the sequence diagram code.

[0056] Rule 3: Controller is the entry point of the application and processes requests from the User. After receiving the result from the Service layer, it returns the result to the User.

[0057] Rule 4: After receiving user input, the Controller passes the necessary requests and data to the Service, which processes the requests and data and returns the processing results of the Entity.

[0058] Rule 5: The Service layer obtains user-specific information by calling methods of the Entity layer. The Entity class encapsulates data and operations on data, and can also include data validation logic, providing a data access interface for the Service layer.

[0059] Rule 6: For the interaction logic between several levels, use ->> to represent the message from participant A to participant B, and use -->> to represent the message from participant B back to participant A, and express it in a fixed format [***(starting level)->>***(ending level): interaction logic], or [***(starting level)-->>***(ending level): interaction logic]. Among them, "***" refers to the role of the level.

[0060] The above rules 1 to 6 refer to the processing rules for the sequence diagram code generation model to process data. Rule 3 describes the interaction logic between the User layer and the Controller layer, Rule 4 describes the interaction logic between the Controller layer and the Service layer, and Rule 5 describes the interaction logic between the Service layer and the Entity layer. That is, the Service layer acts as a bridge between business logic processing and data access, allowing the Controller layer to focus on processing the user interface and user interaction, while the Entity layer focuses on data storage and retrieval.

[0061] Through rules 1 and 2, LLM has identified each layer and expressed it in a fixed format. Through rules 3-5, LLM has identified the interaction logic between each layer, and rule 6 expresses the data flow with direction in a fixed format.

[0062] The solution of this application can automatically generate and optimize timing diagrams efficiently, accurately, and in a user-friendly manner, which can ensure the structural correctness of the code and the effective use of the participants. It allows users to generate and optimize timing diagrams through simple task input, making it easy for non-professionals to use.

[0063] The execution principles, interaction processes, and usage within each rule of each component unit in the embodiment of the system, such as the timing diagram code generation model and the timing diagram correction model, can be found in the description of the following method embodiments.

[0064] Figure 2a A flowchart of a timing diagram determination method provided by an exemplary embodiment of the present application is provided. The execution subject of the method can be any electronic device. The method at least includes the following steps S201-S204:

[0065] S201, obtaining task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed;

[0066] The software function in this application may refer to all functions of a software or part of functions of a software, and this application does not limit this. The aforementioned multiple tasks to be processed may be executed in sequence to realize the aforementioned software function.

[0067] The solution of the present application can be applied to a variety of scenarios, such as medical treatment, entertainment, corporate affairs, etc. When the solution of the present application is applied to a medical scenario, the aforementioned software function can be a patient appointment function.

[0068] In some optional embodiments of the present application, the aforementioned multiple tasks to be processed may be the following tasks:

[0069] User Task 1: The patient / patient agent logs into the system and makes a unified appointment.

[0070] User Task 2: The system performs appointment authentication and verifies the identity information of the patient / patient agent.

[0071] User Task 3: The system queries the available appointment time slots, available doctors, and fees in turn.

[0072] User Task 4: The patient / patient agent selects the available appointment time, available doctor, and fee.

[0073] User Task 5: Patient / patient agent makes an appointment for medical services.

[0074] User Task 6: The system generates an appointment record, notifying the patient / patient agent that the appointment is successful.

[0075] User Task 7: The patient / patient agent completes payment and the appointment becomes effective.

[0076] Optionally, the aforementioned step S201 may be implemented by a large language model, and the large language model may be a sequence diagram code generation model having a sequence diagram code generation function.

[0077] The medical software developed in this application is an MVC architecture. In order to realize the generation of timing diagrams, it is necessary to define the roles and responsibilities of each level in turn, describe how the Controller calls the Service to perform specific operations, and describe how the Service interacts with the Entity to access data. Therefore, through the prompt word technology, the LLM's understanding ability can be maximized. At this stage, the LLM can be used as a software architect. The task is to identify each level (Controller, Service, Entity) based on the multiple tasks to be processed, and explain in detail the names and responsibilities of these levels, as well as the calling relationships and specific interaction logic between them.

[0078] S202, analyzing the task information based on the model-view-controller (MVC) architecture to determine a sequence diagram code corresponding to the task information;

[0079] In some optional embodiments of the present application, the aforementioned step S202 may also be implemented by a large language model, and the large language model may be a timing diagram code generation model having a timing diagram code generation function.

[0080] In some optional embodiments of the present application, the timing diagram code includes a participant definition code and an interaction logic code. In the aforementioned S202, the task information is analyzed based on the MVC architecture to determine the timing diagram code corresponding to the task information, including the following S2021-S2023:

[0081] S2021, determining the role and function information of each level in the multiple levels involved in the task information, the multiple levels including each level in the MVC architecture and a user level;

[0082] Optionally, the aforementioned multiple levels may include: User, Controller, Service, and Entity.

[0083] Optionally, the corresponding relationship between each level and its role is:

[0084] User-Patient / Agent

[0085] Controller-System

[0086] Service-BusinessLogic

[0087] Entity-DataModeL

[0088] Optionally, the functional information of each level is:

[0089] User (user level): input information or trigger request;

[0090] Controller: accepts user requests, processes user input, and coordinates the operations of the Service layer;

[0091] Service: processes business logic, interacts with the Entity layer to perform data operations, and returns responses;

[0092] Entity: represents the data model and is responsible for interacting with the database.

[0093] S2022, determining the participant definition code based on the preset display format of the roles at each level;

[0094] Optionally, the preset display format may be that the level is in front and the role of the level is in the back. Specifically, it may be: participant level as role. For example, the participant definition code may be as follows:

[0095] participant User as Patient / Agent

[0096] participantController as System

[0097] participant Service as BusinessLogic

[0098] participant Entity as DataModeL

[0099] S2023. Determine the interaction logic code according to the functional information of each level and the task information.

[0100] Optionally, the functional information of each layer may also include the interaction logic information between different layers. Optionally, the functional information of the layers may be further described as follows: Controller, as the entry point of the application, processes requests from the User. After receiving the returned result from the Service layer, it returns the result to the User. After receiving the user input, the Controller passes the necessary request and data to the Service, which processes these requests and data and returns the processing result of the Entity. The Service layer obtains the user's specific information by calling the methods of the Entity layer. The Entity class encapsulates the data and operations on the data, and may also include data validation logic, providing a data access interface for the Service layer.

[0101] For the interaction logic between several levels, ->> is used to represent the message from participant A to participant B, and -->> is used to represent the message from participant B back to participant A, and it is expressed in a fixed format [***(starting level)->>***(ending level): interaction logic], or [***(starting level)-->>***(ending level): interaction logic]. Among them, "***" refers to the role of the level.

[0102] The interaction between different roles is directional, and the direction of the interactive data flow is indicated by the direction of the arrow. For example:

[0103] User->>Controller: user request;

[0104] Controller->>Service: handles requests;

[0105] Service->>Entity: data operation;

[0106] Entity-->>Service: return response;

[0107] Service-->>Controller: return result;

[0108] Controller-->>User: Returns the result.

[0109] In some optional embodiments of the present application, the sequence diagram code may be: 1sequenceDiagram

[0110] 2participant User as Patient / Agent

[0111] 3participant Controller as System

[0112] 4participant Service as BusinessLogic

[0113] 5participant Entity as DataModeL6

[0114] 7User->>Controller: User requests to log in to the system to make an appointment

[0115] 8Controller->>Service: Verify user identity information

[0116] 9Service->>Entity: Query user information

[0117] 10Entity-->>Service: Return user information

[0118] 11Service-->>Controller: Verify the result

[0119] 12Controller-->>User: Display verification results 13

[0120] 14User->>Controller: request to query available appointment time, doctor, and cost 15Controller->>Service: process the query request

[0121] 16Service->>Entity: Query available reservation information

[0122] 17Entity-->>Service: Return available reservation information

[0123] 18Service-->>Controller: Available appointment time, doctor, fee 19Controller-->>User: Display available appointment information 20

[0124] 21User->>Controller: Select appointment time, doctor, and fee

[0125] 22Controller->>Service: Process appointment selection

[0126] 23Service->>Entity: Save appointment information

[0127] 24Entity-->>Service: Appointment saved successfully

[0128] 25Service-->>Controller: Appointment Information

[0129] 26Controller-->>User: Appointment successful capture 27

[0130] 28User->>Controller: Request to complete payment

[0131] 29Controller->>Service: Process payment requests

[0132] 30Service->>Entity: Update the reservation status to paid

[0133] 31Entity-->>Service: Update successful

[0134] 32Service-->>Controller:Payment results

[0135] 33Controller-->>User: Reminder that the appointment is officially effective

[0136] Among them, sequence diagram is a markup language or instruction for creating sequence diagrams (Sequence Diagram), which is usually used in sequence diagram drawing tools or plug-ins that support UML (Unified Modeling Language), as well as text editors or note applications that support specific syntax rendering. The Arabic numerals before the aforementioned lines of code are the code line numbers.

[0137] S203, performing error detection and error correction on the timing diagram code to obtain a corrected result;

[0138] In some optional embodiments of the present application, the interactive logic code includes multiple lines of interactive code, each line of interactive code is an interactive message. Each interactive message is followed by an interactive logic, which is used to explain the meaning of the interactive message.

[0139] In S203, the error detection and error correction of the timing diagram code are performed to obtain a corrected result, including the following S2031-S2032:

[0140] S2031, performing error detection on the timing diagram code based on preset code rules to obtain error prompt information;

[0141] Optionally, the code in the timing diagram code that does not comply with a preset code rule is an error content.

[0142] S2032, performing error correction on the timing diagram code based on the error prompt information to obtain a corrected result;

[0143] The code rules include any one or more of the following rules:

[0144] Message integrity rule: every interactive message has a sender and a receiver;

[0145] Message connection rationality rules: there are no isolated sent messages and no isolated received messages;

[0146] Participant validity rules, there are no unused participants and no missing participants.

[0147] In some optional embodiments of the present application, each interactive message includes a sending participant, an arrow for indicating a direction of message transmission, and a receiving participant.

[0148] In some optional embodiments of the present application, the method also includes: traversing each interactive message in the timing diagram code, and if there is an incomplete message with content on only one side of the arrow, generating a first error prompt for indicating that the incomplete message has content on only one side of the arrow, and the first error prompt is included in the error prompt information.

[0149] Optionally, the first error prompt includes the existing content on one side of the arrow. For example, the first error prompt may be "received message x is incomplete" (where x is the existing content on one side of the arrow), or "sent message y is incomplete" (where y is the existing content on one side of the arrow).

[0150] In some optional embodiments of the present application, the method further includes:

[0151] Extracting defined participants from the participant definition code;

[0152] If there is a first participant among the defined participants that does not appear in the interaction logic code, a second error prompt is generated to prompt that there is a first participant among the defined participants that does not appear in the interaction logic code, and the second error prompt is included in the error prompt information.

[0153] If the interaction logic code includes a second participant that is not included in the defined participants, a third error prompt is generated to prompt that the interaction logic code includes a second participant that is not included in the defined participants, and the third error prompt is included in the error prompt information.

[0154] In some optional embodiments of the present application, an initial participant set and a message participant set may be set in the present application; wherein the initial participant set is used to store defined participants; and the message participant set is used to store participants appearing in the interaction logic code;

[0155] Specifically, each line of interaction code in the interaction logic code, that is, each interaction message, can be traversed, and the participants appearing in the interaction message can be stored in the message participant set, wherein when a participant in the message participant set is repeated, only one is retained. After the traversal is completed, the elements in the initial participant set and the message participant set are compared to see if they are the same. If they are the same, it is determined that the timing diagram code complies with the participant validity rule. If they are not the same, and the initial participant set has one more first participant than the message participant set, it is determined that the defined participants include a first participant that does not appear in the interaction logic code. If they are not the same, and the initial participant set has one less second participant than the message participant set, it is determined that the interaction logic code includes a second participant that is not included in the defined participants.

[0156] In some optional embodiments of the present application, the interaction message is a sending message or a receiving message, and the method further includes: traversing each first receiving message in the timing diagram code, and for each first receiving message, detecting whether the multiple first sending messages included in the timing diagram code include a second sending message corresponding to the first receiving message, and if not, it indicates that the first receiving message is an isolated receiving message.

[0157] In some optional embodiments of the present application, the present application may set a sending message list for storing each first sending message included in the timing diagram code.

[0158] In some optional embodiments of the present application, the present application may also be provided with a received message list, and the received message list is used to store each of the aforementioned first received messages.

[0159] In some optional embodiments of the present application, the present application may also be provided with an isolated received message list, and the isolated received message list is used to store the aforementioned received messages that have no corresponding sent messages.

[0160] Specifically, each first received message in the timing diagram code can be traversed, and for each first received message, it can be detected whether the multiple first sent messages included in the timing diagram code include a second sent message corresponding to the first received message; if so, the second sent message is removed from the sent message list; if not, the first received message is stored in the isolated received message list.

[0161] After the traversal is completed, if the sent message list is not empty, it means that there are isolated sent messages. If the isolated received message list is not empty, it means that there are isolated received messages.

[0162] When there is an isolated sending message, a fourth error prompt including the isolated sending message and used to indicate that the isolated sending message is an isolated message may be generated;

[0163] When there is an isolated received message, a fifth error prompt including the isolated received message and used to indicate that the isolated received message is an isolated message may be generated.

[0164] For example, if the message in the sent message list is (x, y), the fourth error prompt is: "Sent message x->>y has no corresponding received message"; assuming that the isolated received message list is not empty, it means that there is an isolated received message. If the message in the isolated received message list is (a, b), the fifth error prompt is: "Received message a-->>b has no corresponding sent message".

[0165] In some optional embodiments of the present application, the interaction message is sending a message or receiving a message, and the method further includes:

[0166] Traverse each first sending message in the timing diagram code, and for each first sending message, detect whether the multiple first receiving messages included in the timing diagram code include the second receiving message corresponding to the first sending message. If not, it means that the first sending message is an isolated sending message.

[0167] In some optional embodiments of the present application, the present application may also be provided with an isolated sent message list, and the isolated sent message list is used to store the aforementioned sent messages that have no corresponding received messages.

[0168] Specifically, each first sending message in the timing diagram code can be traversed, and for each first sending message, it can be detected whether the multiple first receiving messages included in the timing diagram code include the second receiving message corresponding to the first sending message; if so, the second receiving message is removed from the receiving message list; if not, the first sending message is stored in the isolated sending message list.

[0169] After the traversal is completed, if the received message list is not empty, it means that there are isolated received messages. If the isolated sent message list is not empty, it means that there are isolated sent messages.

[0170] When there is an isolated received message, a sixth error prompt including the isolated received message and used to indicate that the isolated received message is an isolated message may be generated;

[0171] When there is an isolated sending message, a seventh error prompt including the isolated sending message and used to indicate that the isolated sending message is an isolated message may be generated.

[0172] For example, if the message in the received message list is (x, y), the sixth error prompt is: "Received message X-->>Y has no corresponding sent message"; assuming that the isolated sent message list is not empty, it means that there are isolated sent messages, and the message in the isolated sent message list is (a, b), then the seventh error prompt is: "Sent message Z->>W has no corresponding received message".

[0173] The aforementioned first error prompt, second error prompt, third error prompt, fourth error prompt, fifth error prompt, sixth error prompt, and seventh error prompt are all included in the error prompt information.

[0174] Optionally, when the error prompt information includes a first error prompt, in the aforementioned S2032, error correction is performed on the timing diagram code based on the error prompt information, including: completing the incomplete message corresponding to the first error prompt according to the aforementioned task information. The incomplete message corresponding to the first error prompt may be the incomplete message included in the first error prompt.

[0175] Optionally, when the error prompt information includes a second error prompt, in the aforementioned S2032, performing error correction on the sequence diagram code based on the error prompt information further includes: deleting the first participant corresponding to the second error prompt. The first participant corresponding to the second error prompt may refer to the first participant included in the second error prompt.

[0176] Optionally, when the error prompt information includes a third error prompt, in the aforementioned S2032, error correction is performed on the timing diagram code based on the error prompt information, and further includes: using participant to define a second participant corresponding to the third error prompt. The second participant corresponding to the third error prompt may refer to the second participant included in the third error prompt.

[0177] Optionally, when the error prompt information includes the fourth error prompt (or the seventh error prompt), in the aforementioned S2032, the error correction of the timing diagram code based on the error prompt information further includes: defining a received message corresponding to the isolated sent message corresponding to the fourth error prompt (or the seventh error prompt), and supplementing corresponding processing content. The isolated sent message corresponding to the fourth error prompt (or the seventh error prompt) refers to the isolated sent message in the fourth error prompt (or the seventh error prompt).

[0178] Optionally, when the error prompt information includes the fifth error prompt (or the sixth error prompt), in the aforementioned S2032, error correction is performed on the timing diagram code based on the error prompt information, and also includes: defining the sending message corresponding to the isolated receiving message corresponding to the fifth error prompt (or the sixth error prompt), the isolated receiving message corresponding to the fifth error prompt (or the sixth error prompt) refers to the isolated receiving message in the fifth error prompt (or the sixth error prompt).

[0179] This application does not limit the detection order of the aforementioned message integrity rules, message connection rationality rules, and participant validity rules.

[0180] For example, the timing diagram code may be checked in the order of participant validity rules, message connection rationality rules, and message integrity rules.

[0181] S204: Generate a target timing diagram corresponding to the task information according to the corrected result.

[0182] The aforementioned participants are at the top of the target sequence diagram and are represented by a rectangular box. The role name of the participant is indicated in the box. The target sequence diagram shows the message content and the direction of message transmission.

[0183] Specifically, the generated target timing diagram can be found in Figure 2b shown.

[0184] Furthermore, the aforementioned corrected result refers to the revised timing diagram code.

[0185] In some optional embodiments of the present application, when performing error detection on the timing diagram code, if it is detected that the timing diagram code complies with the aforementioned code rules, there is no need to perform error correction on the timing diagram code. At this time, the method further includes: generating a target timing diagram corresponding to the task information based on the timing diagram code.

[0186] The solution of this application provides an efficient, accurate, and user-friendly solution for automatic generation and optimization of timing diagrams, which can ensure the structural correctness of the code and the effective use of the participants. It allows users to generate and optimize timing diagrams through simple task input, making it easy for non-professionals to use.

[0187] The present application provides a method for obtaining task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed; analyzing the task information based on a model-view-controller (MVC) architecture to determine a timing diagram code corresponding to the task information; performing error detection and error correction on the timing diagram code to obtain a corrected result; and generating a target timing diagram corresponding to the task information according to the corrected result. The timing diagram can be automatically generated and the timing diagram can be automatically revised, which can not only realize the automatic generation of the timing diagram, but also ensure the quality of the generated timing diagram, thereby improving the efficiency of determining the timing diagram.

[0188] Figure 3 A schematic diagram of a timing diagram determining device provided for an exemplary embodiment of the present application; wherein the device comprises:

[0189] An acquisition unit 31 is used to acquire task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed;

[0190] A determination unit 32, configured to analyze the task information based on a model-view-controller (MVC) architecture to determine a sequence diagram code corresponding to the task information;

[0191] A correction unit 33, used for performing error detection and error correction on the timing diagram code to obtain a corrected result;

[0192] The generating unit 34 is used to generate a target timing diagram corresponding to the task information according to the corrected result.

[0193] In some optional embodiments of the present application, the sequence diagram code includes a participant definition code and an interaction logic code. When the aforementioned device is used to analyze the task information based on the MVC architecture and determine the sequence diagram code corresponding to the task information, it is specifically used to:

[0194] Determine the role and function information of each level in the multiple levels involved in the task information, wherein the multiple levels include each level in the MVC architecture and a user level;

[0195] Determining the participant definition code based on the preset display format of the roles at each level;

[0196] The interaction logic code is determined according to the functional information of each level and the task information.

[0197] In some optional embodiments of the present application, the interactive logic code includes multiple lines of interactive code, each line of interactive code is an interactive message, and the aforementioned device is used to perform error detection and error correction on the timing diagram code to obtain a corrected result, specifically for:

[0198] Perform error detection on the timing diagram code based on preset code rules to obtain error prompt information;

[0199] Based on the error prompt information, the timing diagram code is corrected to obtain a corrected result;

[0200] The code rules include any one or more of the following rules:

[0201] Message integrity rule: every interactive message has a sender and a receiver;

[0202] Message connection rationality rules: there are no isolated sent messages and no isolated received messages;

[0203] Participant validity rules, there are no unused participants and no missing participants.

[0204] In some optional embodiments of the present application, each interactive message includes a sending participant, an arrow for indicating the direction of message transmission, and a receiving participant. The aforementioned device is also used to: traverse each interactive message in the timing diagram code, and if there is an incomplete message with content on only one side of the arrow, a first error prompt is generated to indicate that the incomplete message has content on only one side of the arrow, and the first error prompt is included in the error prompt information.

[0205] In some optional embodiments of the present application, the aforementioned device is also used for:

[0206] Extracting defined participants from the participant definition code;

[0207] If there is a first participant among the defined participants that does not appear in the interaction logic code, a second error prompt is generated for prompting that there is a first participant among the defined participants that does not appear in the interaction logic code, and the second error prompt is included in the error prompt information;

[0208] If the interaction logic code includes a second participant that is not included in the defined participants, a third error prompt is generated to prompt that the interaction logic code includes a second participant that is not included in the defined participants, and the third error prompt is included in the error prompt information.

[0209] In some optional embodiments of the present application, the interaction message is a sending message or a receiving message, and the aforementioned device is also used to: traverse each first receiving message in the timing diagram code, and for each first receiving message, detect whether the multiple first sending messages included in the timing diagram code include a second sending message corresponding to the first receiving message; if not, it indicates that the first receiving message is an isolated receiving message.

[0210] In some optional embodiments of the present application, the interaction message is a sending message or a receiving message, and the aforementioned device is also used to: traverse each first sending message in the timing diagram code, and for each first sending message, detect whether the multiple first receiving messages included in the timing diagram code include a second receiving message corresponding to the first sending message; if not, it indicates that the first sending message is an isolated sending message.

[0211] The present application provides a method for obtaining task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed; analyzing the task information based on a model-view-controller (MVC) architecture to determine a timing diagram code corresponding to the task information; performing error detection and error correction on the timing diagram code to obtain a corrected result; and generating a target timing diagram corresponding to the task information according to the corrected result. The timing diagram can be automatically generated and the timing diagram can be automatically revised, which can not only realize the automatic generation of the timing diagram, but also ensure the quality of the generated timing diagram, thereby improving the efficiency of determining the timing diagram.

[0212] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device may perform the above method embodiment, and the above and other operations and / or functions of each module in the device are the corresponding processes in each method in the above method embodiment, respectively, and no further description is given here for the sake of brevity.

[0213] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0214] Figure 4 is a schematic block diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include:

[0215] The memory 401 and the processor 402, the memory 401 is used to store the computer program and transmit the program code to the processor 402. In other words, the processor 402 can call and run the computer program from the memory 401 to implement the method in the embodiment of the present application.

[0216] For example, the processor 402 may be configured to execute the above method embodiments according to instructions in the computer program.

[0217] In some embodiments of the present application, the processor 402 may include but is not limited to:

[0218] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0219] In some embodiments of the present application, the memory 401 includes but is not limited to:

[0220] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0221] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 401 and executed by the processor 402 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0222] like Figure 4 As shown, the electronic device may also include:

[0223] The transceiver 403 may be connected to the processor 402 or the memory 401 .

[0224] The processor 402 may control the transceiver 403 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 403 may include a transmitter and a receiver. The transceiver 403 may further include an antenna, and the number of antennas may be one or more.

[0225] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0226] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0227] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0228] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0229] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0230] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0231] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for determining a timing diagram, characterized in that: include: Acquire task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed; Analyze the task information based on the model-view-controller (MVC) architecture to determine the timing diagram code corresponding to the task information; Performing error detection and error correction on the timing diagram code to obtain a corrected result; A target timing diagram corresponding to the task information is generated according to the corrected result.

2. The method according to claim 1, characterized in that: The timing diagram code includes a participant definition code and an interaction logic code. The task information is analyzed based on the MVC architecture to determine the timing diagram code corresponding to the task information, including: Determine the role and function information of each level in the multiple levels involved in the task information, wherein the multiple levels include each level in the MVC architecture and a user level; Determining the participant definition code based on the preset display format of the roles at each level; The interaction logic code is determined according to the functional information of each level and the task information.

3. The method according to claim 2, characterized in that The interactive logic code includes multiple lines of interactive code, each line of interactive code is an interactive message, and the error detection and error correction of the timing diagram code are performed to obtain a corrected result, including: Perform error detection on the timing diagram code based on preset code rules to obtain error prompt information; Based on the error prompt information, the timing diagram code is corrected to obtain a corrected result; The code rules include any one or more of the following rules: Message integrity rule: every interactive message has a sender and a receiver; Message connection rationality rules: there are no isolated sent messages and no isolated received messages; Participant validity rules, there are no unused participants and no missing participants.

4. The method according to claim 3, characterized in that Each interactive message includes a sending participant, an arrow for indicating the direction of message transmission, and a receiving participant. The method also includes: traversing each interactive message in the timing diagram code, and if there is an incomplete message with content on only one side of the arrow, generating a first error prompt for indicating that the incomplete message has content on only one side of the arrow, and the first error prompt is included in the error prompt information.

5. The method according to claim 3, characterized in that: The method further comprises: Extracting defined participants from the participant definition code; If there is a first participant among the defined participants that does not appear in the interaction logic code, a second error prompt is generated for prompting that there is a first participant among the defined participants that does not appear in the interaction logic code, and the second error prompt is included in the error prompt information; If the interaction logic code includes a second participant that is not included in the defined participants, a third error prompt is generated to prompt that the interaction logic code includes a second participant that is not included in the defined participants, and the third error prompt is included in the error prompt information.

6. The method according to claim 3, characterized in that The interactive message is a sent message or a received message, and the method further includes: Traverse each first received message in the timing diagram code, and for each first received message, detect whether the multiple first sent messages included in the timing diagram code contain a second sent message corresponding to the first received message; if not, it means that the first received message is an isolated received message.

7. The method according to claim 3, characterized in that The interactive message is a sent message or a received message, and the method further includes: Traverse each first sending message in the timing diagram code, and for each first sending message, detect whether the multiple first receiving messages included in the timing diagram code include the second receiving message corresponding to the first sending message. If not, it means that the first sending message is an isolated sending message.

8. A timing diagram determination system, characterized in that: include: Timing diagram code generation model and timing diagram correction model, where: The timing diagram code generation model is used to obtain task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed; the task information is analyzed based on the model-view-controller (MVC) architecture to determine the timing diagram code corresponding to the task information; The timing diagram correction model is used to perform error detection and error correction on the timing diagram code to obtain a corrected result; and generate a target timing diagram corresponding to the task information according to the corrected result.

9. A timing diagram determination device, characterized in that: include: An acquisition unit, used to acquire task information for realizing software functions, wherein the task information includes a plurality of tasks to be processed; A determination unit, configured to analyze the task information based on a model-view-controller (MVC) architecture to determine a sequence diagram code corresponding to the task information; A correction unit, used for performing error detection and error correction on the timing diagram code to obtain a corrected result; A generating unit is used to generate a target timing diagram corresponding to the task information according to the corrected result.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.