Method, system and electronic device for generating a communication model based on an architectural modeling tool
By using architecture modeling tools to generate client-server communication models for in-vehicle communication protocols, the problem of complex and ever-changing middleware layers in in-vehicle communication is solved, and efficient communication model establishment and development efficiency are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING JINGWEI HIRAIN TECH CO INC
- Filing Date
- 2023-09-18
- Publication Date
- 2026-07-31
AI Technical Summary
In vehicle communication, existing technologies suffer from long development cycles and high costs because the underlying implementations of service discovery and service routing are fixed, while the communication middleware implementations for business applications are complex and varied.
By using architecture modeling tools, the communication timing and element mapping relationships between the client and server of the vehicle communication protocol are determined. A model template is constructed using a modeling language and replaced based on the service requirements information to generate a communication model between the client and server of the vehicle communication protocol.
It enables automated communication model generation, reduces development costs, improves the development efficiency of the communication middleware layer, and avoids extended development cycles due to different scenarios or business data.
Smart Images

Figure CN117278421B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communications, and in particular to a method, system, and electronic device for generating communication models based on an architecture modeling tool. Background Technology
[0002] With the development of automotive intelligence and networking, technologies such as autonomous driving, in-vehicle entertainment, and remote diagnostics and upgrades have placed higher demands on in-vehicle communication. The SomeIP (Scalable Service-Oriented Middlewareover IP) in-vehicle Ethernet communication protocol utilizes Ethernet communication as a communication middleware layer in the field of in-vehicle communication.
[0003] In the implementation of the SomeIP protocol, the underlying implementation of service discovery and service routing is relatively fixed, while the communication middleware layer for business applications is complex and varied, requiring the implementation and development of a set of different types of interfaces contained in the service. If service interfaces are developed one by one for different use cases and business data, the complexity and variability of the communication middleware layer will lead to problems such as long development cycles and high costs in the entire business application development process. Summary of the Invention
[0004] In view of this, this application provides a communication model generation method, system, and electronic device based on an architecture modeling tool, the specific solution of which is as follows:
[0005] A method for generating communication models based on architecture modeling tools, comprising:
[0006] Determine the communication timing between the client and server of the vehicle communication protocol;
[0007] Determine the mapping relationship between the selected elements and modeling elements of the vehicle communication protocol;
[0008] Using an architecture modeling tool and a modeling language, a client and server model template for the vehicle communication protocol is constructed based on the communication timing and the mapping relationship between the selected elements and the modeling elements.
[0009] The client and server model templates of the vehicle communication protocol are replaced with the service requirements information of the vehicle communication protocol to obtain the client and server communication model of the vehicle communication protocol.
[0010] Furthermore, determining the mapping relationship between the selected elements and modeling elements of the vehicle communication protocol includes:
[0011] The key elements of the vehicle communication protocol are used to determine the selected elements of the vehicle communication protocol;
[0012] Based on the selected elements, modeling elements of the vehicle communication protocol that match the selected elements are determined;
[0013] Establish a mapping relationship between the selected elements and modeling elements of the vehicle communication protocol.
[0014] Furthermore, the replacement of the client and server model templates of the vehicle communication protocol with the demand service information based on the vehicle communication protocol includes:
[0015] Obtain the required service information of the vehicle communication protocol from the communication matrix definition file and configuration file;
[0016] The client and server model templates of the vehicle communication protocol are replaced based on the required service information.
[0017] Furthermore, the replacement of the client and server model templates of the vehicle communication protocol based on the demand service information includes:
[0018] Determine the variable parts of the client and server model templates for the vehicle communication protocol;
[0019] Based on the required service information, the variable parts of the client and server model templates of the vehicle communication protocol are replaced.
[0020] Furthermore, it also includes:
[0021] Obtain the code information corresponding to the client-server communication model;
[0022] Determine the compilation and testing environment;
[0023] In the compilation test environment, the code information corresponding to the client-server communication model is compiled and tested to determine whether the compilation test passes.
[0024] Furthermore, it also includes:
[0025] If the compilation test is determined to pass, then the compilation test is considered complete.
[0026] If the compilation test fails, the client-server communication model is adjusted based on the compilation error message when the compilation test fails.
[0027] Furthermore, it also includes:
[0028] Determine the test environment;
[0029] Based on the client-server communication model, deploy the protocol stack and protocol stack configuration file, as well as the application and application configuration file in the running test environment, wherein the application is an application compiled from the client or server communication model;
[0030] In the aforementioned test environment, the application is run based on the aforementioned protocol stack to determine whether the application can communicate with the client and server through the aforementioned client-server communication model. A judgment result is obtained, and based on the judgment result, it is determined whether the test has passed.
[0031] Furthermore, determining whether the application can communicate through the client-server communication model includes:
[0032] Determine whether the application can run successfully;
[0033] If it is determined that the application can run successfully, determine whether the client application and the server application in the client-server communication model can communicate successfully.
[0034] If it is determined that the application on the client side and the application on the server side fail to run, check whether the service instance name in the application and the application configuration file is consistent. If it is determined that the service instance name in the application and the application configuration file is inconsistent, adjust the service instance name to be consistent and then restart the application.
[0035] A communication model generation system based on an architecture modeling tool, comprising:
[0036] The first determining unit is used to determine the communication timing between the client and the server of the vehicle communication protocol;
[0037] The second determining unit is used to determine the mapping relationship between the selected elements and the modeling elements of the vehicle communication protocol;
[0038] The template construction unit is used to construct model templates for the client and server of the vehicle communication protocol based on the communication timing and the mapping relationship between the selected elements and the modeling elements using an architecture modeling tool and a modeling language.
[0039] The model acquisition unit is used to replace the model templates of the client and server of the vehicle communication protocol based on the demand service information of the vehicle communication protocol, so as to obtain the client and server communication model of the vehicle communication protocol.
[0040] An electronic device, comprising:
[0041] The processor is used to determine the communication timing between the client and server of the vehicle communication protocol; determine the mapping relationship between selected elements and modeling elements of the vehicle communication protocol; construct model templates for the client and server of the vehicle communication protocol based on the communication timing and the mapping relationship between the selected elements and modeling elements using an architecture modeling tool and a modeling language; and replace the model templates for the client and server of the vehicle communication protocol based on the demand service information of the vehicle communication protocol to obtain the communication model between the client and server of the vehicle communication protocol.
[0042] The memory is used to store the program used by the processor to execute the above-described processing procedure.
[0043] As can be seen from the above technical solutions, the communication model generation method, system, and electronic device disclosed in this application, based on an architecture modeling tool, determines the communication sequence between the client and server of the vehicle communication protocol; determines the mapping relationship between selected elements and modeling elements of the vehicle communication protocol; constructs model templates for the client and server of the vehicle communication protocol based on the communication sequence and the mapping relationship between selected elements and modeling elements using a modeling language through an architecture modeling tool; and replaces the model templates for the client and server of the vehicle communication protocol based on the demand service information of the vehicle communication protocol to obtain the communication model between the client and server of the vehicle communication protocol. This solution achieves the establishment of the communication model between the client and server by using an architecture modeling tool, realizing automatic establishment of the communication model, reducing development costs, and using the established communication model as a communication middleware layer to improve the development efficiency of the communication middleware layer, avoiding the problem of extended development cycles caused by developers building different communication middleware layers based on different scenarios or business data. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a flowchart illustrating a communication model generation method based on an architecture modeling tool disclosed in an embodiment of this application;
[0046] Figure 2 A schematic diagram of a module developed for a business application;
[0047] Figure 3 This is a schematic diagram illustrating the communication timing between a client and a server as disclosed in an embodiment of this application;
[0048] Figure 4This is a schematic diagram illustrating the implementation of a C / S communication model disclosed in an embodiment of this application in an architecture modeling tool;
[0049] Figure 5 This is a flowchart illustrating a communication model generation method based on an architecture modeling tool disclosed in an embodiment of this application;
[0050] Figure 6 This is a schematic diagram of a client and server model template disclosed in an embodiment of this application;
[0051] Figure 7 This is a flowchart illustrating a communication model generation method based on an architecture modeling tool disclosed in an embodiment of this application;
[0052] Figure 8 This is a schematic diagram illustrating a server-side and client-side operation test disclosed in an embodiment of this application;
[0053] Figure 9 This is a flowchart illustrating a communication model generation and testing method based on an architecture modeling tool, as disclosed in an embodiment of this application.
[0054] Figure 10 This is a schematic diagram of the structure of a communication model generation system based on an architecture modeling tool disclosed in an embodiment of this application;
[0055] Figure 11 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application. Detailed Implementation
[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] This application discloses a communication model generation method based on an architecture modeling tool, the flowchart of which is shown below. Figure 1 As shown, it includes:
[0058] Step S11: Determine the communication timing between the client and server of the vehicle communication protocol;
[0059] Step S12: Determine the mapping relationship between the selected elements and modeling elements of the vehicle communication protocol;
[0060] Step S13: Using an architecture modeling tool and a modeling language, construct model templates for the client and server of the vehicle communication protocol based on the communication sequence and the mapping relationship between selected elements and modeling elements;
[0061] Step S14: Replace the client and server model templates of the vehicle communication protocol with the service requirements information of the vehicle communication protocol to obtain the client and server communication model of the vehicle communication protocol.
[0062] SOMEIP is a communication protocol for automotive Ethernet. During the development of business applications, changes in the implementation of the communication protocol can lead to changes in the business applications, greatly increasing the burden on business application developers.
[0063] Taking the field of autonomous driving as an example, when developing business applications, the main functional modules involved and the relationships between them are as follows: Figure 2 As shown, it includes: a scheduling module 21, a data acquisition and communication module 22, an algorithm module 23, and a data transmission and communication module 24. The business application consists of multiple subsystems, each including a data acquisition and communication module 22, an algorithm module 23, and a data transmission and communication module 24. The scheduling module generates periodic signals to control the execution of different subsystems. Within each subsystem, the data acquisition and communication module acquires real-time data from the external controller and transmits it to the algorithm module. The algorithm module processes the data and then transmits it to the data transmission and communication module. The data transmission and communication module is responsible for sending the processed data out.
[0064] The development of each of the above modules is implemented by application development tools. That is, when any of the above modules changes, the business application developers need to redevelop the business application. Since the communication middleware layer in business applications is usually quite complex and variable, the redevelopment of business applications is mostly due to changes in the communication middleware layer, such as changes in the interface or signals of the communication protocol. This leads to the problem of low development efficiency of business applications due to the variable implementation of the communication middleware layer.
[0065] Based on this, the communication model generation method disclosed in this solution directly generates the communication model based on the architecture modeling tool. For the algorithm part other than the communication middleware layer in the business development process, it is implemented by the algorithm development tool. This enables the solution disclosed in this embodiment to automatically generate the communication model based on actual needs. Business developers only need to focus on the development of the algorithm module and do not need to consider the communication middleware layer and communication protocol adaptation issues, which greatly improves the development efficiency of business applications. Furthermore, the automatic generation of the communication model can also reduce development costs.
[0066] Determine the communication sequence between the client and server (C / S) of the SOMEIP in-vehicle communication protocol, specifically the timing of data transmission and reception between the server driver, the server itself, the in-vehicle Ethernet, the client, and the client driver. Data interaction between the server and client utilizes both events and methods. Specifically, it can be done as follows: Figure 3 As shown, this illustrates the communication timing between the client and server (C / S) when using different data transmission methods.
[0067] Specifically, during the service discovery process, the client searches for available service instances in the vehicular Ethernet network, the server provides services to the client through the vehicular Ethernet network, and the client subscribes to events through the vehicular Ethernet network.
[0068] When using events for data interaction, the server-side driver connects to the server via a port, and the client-side driver connects to the client via a port. The server-side driver sends a Rhapsody event carrying data through the port. After receiving the Rhapsody event, the server triggers the call to the send method of the event class and sends the data outward via the vehicle Ethernet. The client obtains data from the vehicle Ethernet and sends a Rhapsody event carrying data to the client-side driver through the port. After receiving the Rhapsody event, the client-side driver triggers and executes the relevant operations.
[0069] Rhapsody can be an architecture modeling tool.
[0070] When using the FF method (Fire & Forget, "send and forget") for data interaction, the server driver connects to the server via a port, and the client driver connects to the client via a port. The client driver sends a Rhapsody event carrying data through the port. Upon receiving the Rhapsody event, the client triggers and executes an operation, sending data outward via the vehicle Ethernet and calling the server's FF method. The server executes the FF method, retrieves data via the vehicle Ethernet, and sends a Rhapsody event carrying data through the port. Upon receiving the Rhapsody event, the server driver triggers and executes an operation.
[0071] When using the RR (Request & Response) method for data interaction, the server driver connects to the server via a port, and the client driver connects to the client via a port. The server driver sends a Rhapsody event carrying data 1 via the port. Upon receiving the Rhapsody event, the server triggers an operation to receive and save data 1. The client driver sends a Rhapsody event carrying data 2 via the port. Upon receiving the Rhapsody event, the client triggers a call operation, sending data 2 outward via the vehicle Ethernet and calling the server's RR method. The server executes the RR method, retrieves data 2 via the vehicle Ethernet, and returns data 1 to the client.
[0072] After obtaining the communication timing, it is also necessary to obtain the mapping relationship between the selected elements of the vehicle communication protocol SOMEIP and the modeling UML elements. Then, the SOMEIP C / S model template can be directly constructed based on the communication timing and the mapping relationship.
[0073] Since the solution disclosed in this embodiment directly builds the communication model on the architecture modeling tool, the SOMEIP C / S model template is directly built on the architecture modeling tool Rhapsody using the modeling language. The construction of the model template requires the use of the obtained communication sequence between the client and the server and the mapping relationship between the selected elements and the modeling elements. Therefore, on the architecture modeling tool, the SOMEIP C / S model template is built using the modeling language through the determined communication sequence and mapping relationship.
[0074] After the SOMEIP client / server model template is built, to transform the model template into a communication model, some content in the model template needs to be replaced. The content to be replaced is the service requirement information of the SOMEIP vehicle communication protocol. The SOMEIP service information in the model template is replaced with the actual service requirement information, thus obtaining the completed SOMEIP client and server C / S communication model.
[0075] The generated C / S communication model serves as a communication intermediary layer. This C / S communication model is implemented in an architecture modeling tool, such as... Figure 4 As shown, the scheduling module and communication module are implemented in the architecture modeling tool, while only the algorithm module is implemented in the algorithm development tool. Business developers only need to focus on developing the algorithm within the algorithm module. The scheduling module, data acquisition communication module, and data transmission communication module in the architecture modeling tool are automatically generated by the tool. In this embodiment, the client-server (C / S) communication model is... Figure 4 It consists of a scheduling module, a data acquisition and communication module, and a data transmission and communication module.
[0076] In this embodiment, the C / S communication model is automatically generated by filling the model template with demand service information, which improves development efficiency and has high reusability and maintainability.
[0077] This embodiment discloses a communication model generation method based on an architecture modeling tool. The method determines the communication sequence between the client and server of an in-vehicle communication protocol; determines the mapping relationship between selected elements and modeling elements of the in-vehicle communication protocol; uses an architecture modeling tool and a modeling language to construct model templates for the client and server of the in-vehicle communication protocol based on the communication sequence and the mapping relationship between selected elements and modeling elements; and replaces the model templates for the client and server of the in-vehicle communication protocol with the required service information of the in-vehicle communication protocol to obtain the communication model between the client and server. This solution achieves automatic communication model building by using an architecture modeling tool, reducing development costs. Using the established communication model as the implementation of the communication middleware improves the development efficiency of the middleware and avoids the problem of extended development cycles caused by developers building different communication models based on different scenarios or business data.
[0078] This embodiment discloses a communication model generation method based on an architecture modeling tool, the flowchart of which is as follows: Figure 5 As shown, it includes:
[0079] Step S51: Determine the communication timing between the client and server of the vehicle communication protocol;
[0080] Step S52: Determine the mapping relationship between the selected elements and modeling elements of the vehicle communication protocol;
[0081] Step S53: Using an architecture modeling tool and a modeling language, construct model templates for the client and server of the vehicle communication protocol based on the communication sequence and the mapping relationship between selected elements and modeling elements;
[0082] Step S54: Obtain the required service information of the vehicle communication protocol from the communication matrix definition file and configuration file;
[0083] Step S55: Replace the client and server model templates of the vehicle communication protocol based on the demand service information to obtain the client and server communication model of the vehicle communication protocol.
[0084] The communication matrix is usually defined by the vehicle manufacturer. Each node in the vehicle network needs to follow the communication matrix to complete the interaction and sharing of information.
[0085] The communication matrix definition file contains service information and corresponding service method interface information. The service information is the service name, and the service method interface information includes the method interface type, method interface name, method interface parameters, etc. The configuration file contains information such as service name, service category, and service instance name.
[0086] To obtain the service requirements information, you can directly parse the communication matrix definition file and configuration file. Then, populate the C / S model template with the service requirements information to generate the class model of the corresponding service interface.
[0087] Determining the required service information is to supplement the information in the client / server (C / S) model template of the SOMEIP vehicular communication protocol, so that the final C / S communication model better meets actual needs. Therefore, determining the required service information actually involves selecting service information that meets the actual needs from the communication matrix definition file and configuration file as the required service information to populate the C / S model template.
[0088] Furthermore, determining the mapping relationship between the selected elements and modeling elements of the vehicular communication protocol can be done as follows:
[0089] Based on the key elements of the vehicle communication protocol, the selected elements of the vehicle communication protocol are determined; based on the selected elements, the modeling elements of the vehicle communication protocol that match the selected elements are determined; and the mapping relationship between the selected elements and the modeling elements of the vehicle communication protocol is established.
[0090] The SOMEIP (Self-Service Module for In-Vehicle Communication) protocol contains multiple key elements, and the UML (United States Language) elements for modeling the SOMEIP protocol are also numerous. Based on the actual needs of the communication model, select the required elements from the multiple key elements in SOMEIP, and define these selected elements as the chosen elements. After determining the chosen elements, select a subset of elements from the UML elements based on the chosen elements in SOMEIP as modeling elements for constructing the model template of the current required communication model.
[0091] After determining the selected elements in the key elements of SOMEIP and the modeling elements in the UML elements according to the actual needs of the communication model, the mapping relationship between the selected elements and the modeling elements is established, as shown in Table 1.
[0092] Table 1
[0093] 1 ServiceInterface Class 2 Event EventReception 3 Method RR Operation with Return Value 4 Method FF Operation without Return Value
[0094] As shown in Table 1, when the key element in SOMEIP is selected as ServiceInterface, the corresponding modeling element can be determined from the UML elements as Class; when the key element in SOMEIP is selected as Event, the corresponding modeling element can be determined from the UML elements as EventReception, and so on.
[0095] After establishing the mapping relationship between the selected elements of SOMEIP and the modeling elements in UML, the architecture modeling tool uses the UML modeling language to build model templates corresponding to the selected elements of SOMEIP, the modeling elements in UML, and the communication sequence. Figure 6 As shown.
[0096] Alternatively, plugin development can be performed directly based on the Java API interface provided by the architecture modeling tool Rhapsody. These plugins predefine C / S model templates. When constructing the communication model, the required C / S model template can be selected directly from multiple predefined templates. The selected template is then populated with the actual service requirements to obtain the desired C / S communication model. This approach improves the speed of C / S communication model creation and increases development efficiency.
[0097] The C / S model template includes variable and immutable parts. The immutable parts are common to every C / S communication model and do not need to be adjusted or filled in. The variable parts are determined according to the service information required by the actual needs. That is, the service information required by the communication matrix definition file and configuration file is filled into the variable parts of the C / S model template to generate the C / S communication model. Alternatively, the service information required by the needs can be directly used to replace the variable parts of the C / S model template to generate the C / S communication model.
[0098] This embodiment discloses a communication model generation method based on an architecture modeling tool. The method determines the communication sequence between the client and server of an in-vehicle communication protocol; determines the mapping relationship between selected elements and modeling elements of the in-vehicle communication protocol; and uses an architecture modeling tool and a modeling language to construct model templates for the client and server of the in-vehicle communication protocol based on the communication sequence and the mapping relationship between selected elements and modeling elements. The method obtains the required service information of the in-vehicle communication protocol from the communication matrix definition file and configuration file, and replaces the model templates for the client and server of the in-vehicle communication protocol based on this required service information to obtain the communication model between the client and server. This solution achieves automatic communication model building by using an architecture modeling tool, reducing development costs. Using the established communication model as the implementation of the communication middleware improves the development efficiency of the middleware and avoids the problem of extended development cycles caused by developers building different communication models based on different scenarios or business data.
[0099] This embodiment discloses a communication model generation method based on an architecture modeling tool, the flowchart of which is as follows: Figure 7 As shown, it includes:
[0100] Step S71: Determine the communication timing between the client and server of the vehicle communication protocol;
[0101] Step S72: Determine the mapping relationship between the selected elements and modeling elements of the vehicle communication protocol;
[0102] Step S73: Using an architecture modeling tool and a modeling language, construct model templates for the client and server of the vehicle communication protocol based on the communication timing and the mapping relationship between selected elements and modeling elements;
[0103] Step S74: Replace the client and server model templates of the vehicle communication protocol with the service requirements information of the vehicle communication protocol to obtain the client and server communication model of the vehicle communication protocol.
[0104] Step S75: Obtain the code information corresponding to the client-server communication model;
[0105] Step S76: Determine the compilation and testing environment;
[0106] Step S77: Compile and test the code information corresponding to the client-server communication model in the compilation test environment to determine whether the compilation test passes.
[0107] After the client and server C / S communication model of the SOMEIP vehicle communication protocol is constructed, it needs to be compiled. Before compilation, a compilation test can be performed first. Only after the compilation test passes can the actual compilation be carried out.
[0108] Specifically, during the compilation and testing process, a compilation and testing environment is first built, which can be achieved using the open-source application container engine Docker. Then, code is generated based on the generated client-server (C / S) communication model to obtain the corresponding code information. The code information is then compiled and tested within the constructed compilation and testing environment to determine whether the compilation tests pass and whether adjustments to the C / S communication model are needed.
[0109] You can execute the CMake and Make commands in the compilation test environment to compile the code. If a binary file is generated, it means that the compilation test has passed and the compilation test is over; if a binary file is not generated, it means that the compilation test has failed.
[0110] When the compilation test fails, a compilation error message is output. This message indicates the problem that occurred during compilation, such as the reason why the compilation test failed or the type of compilation error.
[0111] If the compilation test fails, the relevant implementation of the client-server (C / S) communication model can be adjusted based on the compilation error message. Then, the code of the adjusted C / S communication model can be regenerated and recompiled to determine whether the adjusted C / S communication model passes the compilation test.
[0112] Furthermore, after the compilation and testing are complete, runtime testing can also be performed. Specifically:
[0113] Determine the test environment; deploy the protocol stack and protocol stack configuration file, as well as the application and application configuration file, in the test environment based on the client-server communication model. The application is an application compiled from the client or server communication model; run the application based on the protocol stack in the test environment to determine whether the application can communicate through the client-server communication model, obtain the judgment result, and determine whether the test passes based on the judgment result.
[0114] During the runtime testing process, the runtime testing environment is first built, which can be achieved using the open-source application container engine Docker. Then, the protocol stack and its configuration file are deployed to the runtime testing environment to complete the deployment of the protocol stack and its configuration file within the runtime testing environment. In addition, the application and its configuration file also need to be deployed to the runtime testing environment to complete the deployment of the application and its configuration file within the runtime testing environment.
[0115] After deploying the protocol stack and its configuration file, as well as the application and its configuration file, in the runtime test environment, you can execute runtime tests in the runtime test environment. At this point, you can start the application and determine whether it runs successfully. If the application runs successfully, you need to test whether the C / S communication model can communicate. If the application runs unsuccessfully, you need to check whether the service instance names in the application and its configuration file are consistent. If they are inconsistent, you need to adjust the service instance names in the application and its configuration file to be consistent. Then, reconfigure the adjusted application and its configuration file in the runtime test environment. After completing the deployment of the application and its configuration file, restart the application and determine whether the application runs successfully.
[0116] If the application runs successfully, check if the C / S communication model can communicate, i.e., the client application and the server application can communicate successfully. If the client application and the server application can send and receive data correctly, the communication is considered successful, i.e., the test passes. If communication fails, such as the client application and the server application cannot send and receive data, or the data sent and received is inaccurate, the communication is considered to have failed. In this case, check if the network connections of the client's and server's test environments are normal, i.e., whether they can ping each other. If the network connections of the client's and server's test environments are normal, check if the service instance names in the application and application configuration files are consistent. If they are consistent, repeatedly deploy the application and application configuration files to the test environment and start the application to test application operation and C / S communication. This allows for timely adjustments if the test fails, ensuring the test is completed.
[0117] Specifically, it can be like... Figure 8 As shown, test environments are set up for both the server and client sides. The server-side test environment is Docker1, and the client-side test environment is Docker2. The server-side application is deployed on Docker1, and the client-side application is deployed on Docker2. The server-side application includes: server-side driver test TestDrive_S and the server itself. The client-side application includes: client-side driver test TestDrive_C and the client itself. Communication between Docker containers is implemented through network configuration. The ara::com communication stack is configured on Docker1 and Docker2 respectively. After startup, communication paths can be established between applications in different containers. Figure 8 The dashed line in the middle indicates a bidirectional data link.
[0118] When transmitting data via events, the server application TestDrive_S sends an event carrying data. After receiving the event sent by TestDrive_S, the server triggers the operation of sending data outward, transmitting the data through the communication path between Docker1 and Docker2. The client application Client obtains the data via Ethernet and sends it to TestDrive_C.
[0119] When data is transmitted via a method, the client application's TestDrive_C sends an event carrying the data. After receiving the event sent by TestDrive_C, the client triggers and calls the method provided by the server, and the server sends the received data to TestDrive_S.
[0120] TestDrive_S and TestDrive_C record the sent and received data to a log file. If the sent data recorded in the log file generated by TestDrive_S is completely consistent with the received data recorded in the log file generated by TestDrive_C, then the communication can be considered successful.
[0121] Furthermore, the communication model generation method based on architecture modeling tools disclosed in this embodiment has a complete development and testing process as follows: Figure 9 As shown, it includes: 1. Customizing the SOMEIP profile; 2. Adding the SOMEIP profile to complete C / S modeling; 3. Generating code from model; 4. Compiling and running tests; 5. Optimizing the profile.
[0122] The steps 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ...
[0123] The SOMEIP profile can be used to complete C / S modeling, i.e., generate a C / S communication model.
[0124] The C / S communication model is generated by using the data used to generate the C / S communication model as input to the SOMEIP profile file. The data used to generate the C / S communication model can include: demand service information, communication sequence, mapping relationship, etc. In addition, the profile file can be optimized, that is, the profile file of the C / S communication model can be optimized based on the compilation test results and / or running test results, so as to adjust the C / S communication model.
[0125] This solution verifies the functionality of the C / S communication model and code by performing compilation and runtime tests after the C / S communication model is generated.
[0126] This embodiment discloses a communication model generation method based on an architecture modeling tool, which determines the communication sequence between the client and server of an in-vehicle communication protocol; determines the mapping relationship between selected elements and modeling elements of the in-vehicle communication protocol; uses an architecture modeling tool and a modeling language to construct model templates for the client and server of the in-vehicle communication protocol based on the communication sequence and the mapping relationship between selected elements and modeling elements; replaces the model templates for the client and server of the in-vehicle communication protocol with the required service information of the in-vehicle communication protocol to obtain the client and server communication model of the in-vehicle communication protocol; determines the compilation and testing environment; obtains the code information corresponding to the client and server communication model; and performs compilation and testing on the code information corresponding to the client and server communication model in the compilation and testing environment to determine whether the compilation test passes. This solution establishes a communication model between the client and server using an architecture modeling tool, enabling automatic model creation and reducing development costs. Using this established communication model as the implementation of the communication middleware improves development efficiency and avoids the problem of extended development cycles caused by developers building different communication middleware based on different scenarios or business data. Furthermore, the solution disclosed in this embodiment not only generates the communication model but also tests it. If the communication model fails compilation or runtime tests, adjustments are made to ensure it can be compiled and run normally, further improving development efficiency.
[0127] This embodiment discloses a communication model generation system based on an architecture modeling tool, the structural diagram of which is shown below. Figure 10 As shown, it includes:
[0128] The unit consists of a first determining unit 101, a second determining unit 102, a template construction unit 103, and a model acquisition unit 104.
[0129] The first determining unit 101 is used to determine the communication timing between the client and the server of the vehicle communication protocol;
[0130] The second determining unit 102 is used to determine the mapping relationship between the selected elements and the modeling elements of the vehicle communication protocol;
[0131] The template building unit 103 is used to build model templates for the client and server of the vehicle communication protocol using a modeling language through an architecture modeling tool, based on the communication timing and the mapping relationship between selected elements and modeling elements.
[0132] The model acquisition unit 104 is used to replace the model templates of the client and server of the vehicle communication protocol with the demand service information of the vehicle communication protocol to obtain the communication model of the client and server of the vehicle communication protocol.
[0133] Furthermore, the second determining unit is used for:
[0134] Based on the key elements of the vehicle communication protocol, the selected elements of the vehicle communication protocol are determined; based on the selected elements, the modeling elements of the vehicle communication protocol that match the selected elements are determined; and the mapping relationship between the selected elements and the modeling elements of the vehicle communication protocol is established.
[0135] Furthermore, the model obtains units for:
[0136] Obtain the required service information of the vehicle communication protocol from the communication matrix definition file and configuration file; replace the client and server model templates of the vehicle communication protocol based on the required service information.
[0137] Furthermore, the model obtains units for:
[0138] Determine the variable parts of the client and server model templates for the vehicle communication protocol; replace the variable parts of the client and server model templates for the vehicle communication protocol based on the service requirements information.
[0139] Furthermore, the system disclosed in this embodiment may also include:
[0140] The compilation test unit is used to obtain code information corresponding to the client-server communication model; determine the compilation test environment; and perform compilation tests on the code information corresponding to the client-server communication model in the compilation test environment to determine whether the compilation test passes.
[0141] Furthermore, the compiler test unit is also used for:
[0142] If the compilation test is confirmed to have passed, then the compilation test is considered complete; if the compilation test is confirmed to have failed, then the client-server communication model is adjusted based on the compilation error message when the compilation test failed.
[0143] Furthermore, the system disclosed in this embodiment may also include:
[0144] The test unit is used to determine the test environment. Based on the client-server communication model, a protocol stack and protocol stack configuration file, as well as an application and application configuration file, are deployed in the test environment. The application is an application compiled from the client or server communication model. In the test environment, the application is run based on the protocol stack to determine whether the application can communicate through the client-server communication model. The judgment result is obtained, and the compilation test is run based on the judgment result to determine whether it passes.
[0145] Furthermore, running the test unit is also used for:
[0146] Determine if the application can run; if the application can run, determine if the client application and the server application can communicate successfully in the client-server communication model.
[0147] Furthermore, running the test unit is also used for:
[0148] If it is determined that communication between the client application and the server application fails, determine whether there is network connectivity between the client's runtime test environment and the server's runtime test environment.
[0149] The communication model generation system based on architecture modeling tools disclosed in this embodiment is implemented based on the communication model generation method based on architecture modeling tools disclosed in the above embodiment, and will not be described again here.
[0150] This embodiment discloses a communication model generation system based on an architecture modeling tool. The system determines the communication sequence between the client and server of an in-vehicle communication protocol; determines the mapping relationship between selected elements and modeling elements of the in-vehicle communication protocol; and uses an architecture modeling tool and a modeling language to construct model templates for the client and server of the in-vehicle communication protocol based on the communication sequence and the mapping relationship between selected elements and modeling elements. The system then replaces these model templates with the required service information of the in-vehicle communication protocol to obtain the client-server communication model. This solution achieves automatic communication model creation by using an architecture modeling tool, reducing development costs. Using the established communication model as a communication middleware layer improves the development efficiency of the middleware layer and avoids the problem of extended development cycles caused by developers building different middleware layers based on different scenarios or business data.
[0151] This embodiment discloses an electronic device, the structural schematic diagram of which is shown below. Figure 11 As shown, it includes:
[0152] Processor 111 and memory 112.
[0153] The processor 111 is used to determine the communication timing between the client and server of the vehicle communication protocol; determine the mapping relationship between the selected elements and modeling elements of the vehicle communication protocol; construct the model templates of the client and server of the vehicle communication protocol based on the communication timing and the mapping relationship between the selected elements and modeling elements using a modeling language through an architecture modeling tool; and replace the model templates of the client and server of the vehicle communication protocol based on the demand service information of the vehicle communication protocol to obtain the communication model of the client and server of the vehicle communication protocol.
[0154] The memory 112 is used to store the program for the processor to execute the above-mentioned processing.
[0155] The electronic device disclosed in this embodiment is implemented based on the communication model generation method based on the architecture modeling tool disclosed in the above embodiment, and will not be described again here.
[0156] The electronic device disclosed in this embodiment determines the communication sequence between the client and server of the vehicle communication protocol; determines the mapping relationship between selected elements and modeling elements of the vehicle communication protocol; and constructs model templates for the client and server of the vehicle communication protocol based on the communication sequence and the mapping relationship between selected elements and modeling elements using an architecture modeling tool and a modeling language. The model templates for the client and server of the vehicle communication protocol are then replaced based on the demand service information of the vehicle communication protocol to obtain the communication model between the client and server of the vehicle communication protocol. This solution achieves automatic communication model establishment by using an architecture modeling tool, reducing development costs. Using the established communication model as a communication middleware layer improves the development efficiency of the middleware layer and avoids the problem of extended development cycles caused by developers building different communication models based on different scenarios or business data.
[0157] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0158] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0159] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0160] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating communication models based on architecture modeling tools, characterized in that, include: Determine the communication timing between the client and server of the vehicle communication protocol; Determine the mapping relationship between the selected elements and modeling elements of the vehicle communication protocol; Using an architecture modeling tool and a modeling language, a client and server model template for the vehicle communication protocol is constructed based on the communication timing and the mapping relationship between the selected elements and the modeling elements. The client and server model templates of the vehicle communication protocol are replaced with the service requirements information of the vehicle communication protocol to obtain the client and server communication model of the vehicle communication protocol.
2. The method according to claim 1, characterized in that, Determining the mapping relationship between selected elements and modeling elements of the vehicle communication protocol includes: The key elements of the vehicle communication protocol are used to determine the selected elements of the vehicle communication protocol; Based on the selected elements, modeling elements of the vehicle communication protocol that match the selected elements are determined; Establish a mapping relationship between the selected elements and modeling elements of the vehicle communication protocol.
3. The method according to claim 1, characterized in that, The requirement service information based on the vehicle communication protocol replaces the client and server model templates of the vehicle communication protocol, including: Obtain the required service information of the vehicle communication protocol from the communication matrix definition file and configuration file; The client and server model templates of the vehicle communication protocol are replaced based on the required service information.
4. The method according to claim 1, characterized in that, The replacement of the client and server model templates of the vehicle communication protocol based on the demand service information includes: Determine the variable parts of the client and server model templates for the vehicle communication protocol; Based on the required service information, the variable parts of the client and server model templates of the vehicle communication protocol are replaced.
5. The method according to claim 1, characterized in that, Also includes: Obtain the code information corresponding to the client-server communication model; Determine the compilation and testing environment; In the compilation test environment, the code information corresponding to the client-server communication model is compiled and tested to determine whether the compilation test passes.
6. The method according to claim 5, characterized in that, Also includes: If the compilation test is determined to pass, then the compilation test is considered complete. If the compilation test fails, the client-server communication model is adjusted based on the compilation error message when the compilation test fails.
7. The method according to claim 1, characterized in that, Also includes: Determine the test environment; Based on the client-server communication model, deploy the protocol stack and protocol stack configuration file, as well as the application and application configuration file in the running test environment, wherein the application is an application compiled from the client or server communication model; In the aforementioned test environment, the application is run based on the aforementioned protocol stack to determine whether the application can communicate with the client and server through the aforementioned client-server communication model. A judgment result is obtained, and based on the judgment result, it is determined whether the test has passed.
8. The method according to claim 7, characterized in that, Determining whether the application can communicate through the client-server communication model includes: Determine whether the application can run successfully; If it is determined that the application can run successfully, determine whether the client application and the server application in the client-server communication model can communicate successfully. If it is determined that the application on the client side and the application on the server side fail to run, check whether the service instance name in the application and the application configuration file is consistent. If it is determined that the service instance name in the application and the application configuration file is inconsistent, adjust the service instance name to be consistent and then restart the application.
9. A communication model generation system based on an architecture modeling tool, characterized in that, include: The first determining unit is used to determine the communication timing between the client and the server of the vehicle communication protocol; The second determining unit is used to determine the mapping relationship between the selected elements and the modeling elements of the vehicle communication protocol; The template construction unit is used to construct model templates for the client and server of the vehicle communication protocol based on the communication timing and the mapping relationship between the selected elements and the modeling elements using an architecture modeling tool and a modeling language. The model acquisition unit is used to replace the model templates of the client and server of the vehicle communication protocol based on the demand service information of the vehicle communication protocol, so as to obtain the client and server communication model of the vehicle communication protocol.
10. An electronic device, characterized in that, include: The processor is used to determine the communication timing between the client and server of the vehicle communication protocol; Determine the mapping relationship between the selected elements and modeling elements of the vehicle communication protocol; Using an architecture modeling tool and a modeling language, a client and server model template for the vehicle communication protocol is constructed based on the communication timing and the mapping relationship between the selected elements and the modeling elements. The client and server model templates of the vehicle communication protocol are then replaced with the required service information of the vehicle communication protocol to obtain the client and server communication model of the vehicle communication protocol. The memory is used to store the program used by the processor to execute the above-described processing procedure.