CN111475149B - SOMEIP communication intermediate layer code realization method and system thereof - Google Patents
SOMEIP communication intermediate layer code realization method and system thereof Download PDFInfo
- Publication number
- CN111475149B CN111475149B CN202010259265.9A CN202010259265A CN111475149B CN 111475149 B CN111475149 B CN 111475149B CN 202010259265 A CN202010259265 A CN 202010259265A CN 111475149 B CN111475149 B CN 111475149B
- Authority
- CN
- China
- Prior art keywords
- service
- someip
- information
- communication
- template
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computing Systems (AREA)
- Communication Control (AREA)
Abstract
A SOMEIP communication middle layer code implementation method comprises the following steps: receiving and storing service information of SOMEIP service input by a user, service method interface information corresponding to the service and communication configuration information; inputting the service information and the service method interface information into a prefabricated SOMEIP communication middle layer code template through a code generation script to generate a code file; and inputting the service ID, the event group ID to which the method belongs and the communication configuration information into a prefabricated configuration template through a configuration generation script to generate a configuration file for running the code file. The invention is simple and efficient, greatly improves the development efficiency, and has high reusability and good maintainability.
Description
Technical Field
The invention relates to the technical field of SOMEIP communication, in particular to a method and a system for realizing SOMEIP communication middle layer codes.
Background
The SOMEIP protocol is used in large numbers in the vehicle-mounted ECU device for data communication of the vehicle-mounted ethernet. In the SOMEIP protocol implementation process, the bottom layer of SOMEIP is used for service-oriented discovery and service routing, and the implementation of the bottom layer of SOMEIP is relatively fixed. However, the SOMEIP protocol communication middle layer is towards business application, which is complex and changeable, each SOMEIP protocol communication service contains a group of method/field/event type method interfaces, which are required to be developed for realizing the service, but development of the service method interfaces is carried out one by one for different use scenes and different business data, which not only results in long development period, high cost and low efficiency, but also requires a great deal of modification, even is improved and is poor in reusability along with the change of the use scenes and the business data. Once the code of the method interface is bug-free or optimized, the code needs to be modified one by one, and the maintainability is poor.
Disclosure of Invention
Based on the above, a method and a system for implementing SOMEIP communication intermediate layer code are provided for the technical problems.
In order to solve the technical problems, the invention adopts the following technical scheme:
a SOMEIP communication middle layer code implementation method comprises the following steps:
receiving and storing service information of SOMEIP service input by a user, service method interface information corresponding to the service and communication configuration information, wherein the service information comprises a service name and a service ID, the service method interface information comprises a method interface type, a method interface name, a method interface ID, a method interface parameter and an event group ID to which a method belongs, and the communication configuration information comprises a communication protocol IP and a communication port;
inputting the service information and the service method interface information into a prefabricated SOMEIP communication middle layer code template through a code generation script to generate a code file, wherein the SOMEIP communication middle layer code template is provided with all implementation flows of the method interfaces;
and inputting the service ID, the event group ID to which the method belongs and the communication configuration information into a prefabricated configuration template through a configuration generation script to generate a configuration file for running the code file, wherein SOMEIP protocol communication configuration information, SOMEIP protocol service configuration information and SOMEIP protocol service discovery configuration information are defined in the configuration template.
And the user inputs the service information of the SOMEIP service, the service method interface information corresponding to the service and the communication configuration information in the form of a table.
The table is an excel table.
Storing the service information and the service method interface information in an xml file, and inputting the service information and the service method interface information in the xml file into a SOMEIP communication middle layer code template by the code generation script to generate a code file.
The script is a python script and the template is a jinja2 template.
The scheme also relates to a SOMEIP communication middle layer code implementation system, which comprises a storage module, wherein the storage module comprises a plurality of instructions loaded and executed by a processor:
receiving and storing service information of SOMEIP service input by a user, service method interface information corresponding to the service and communication configuration information, wherein the service information comprises a service name and a service ID, the service method interface information comprises a method interface type, a method interface name, a method interface ID, a method interface parameter and an event group ID to which a method belongs, and the communication configuration information comprises a communication protocol IP and a communication port;
inputting the service information and the service method interface information into a prefabricated SOMEIP communication middle layer code template through a code generation script to generate a code file, wherein the SOMEIP communication middle layer code template is provided with all implementation flows of the method interfaces;
and inputting the service ID, the event group ID to which the method belongs and the communication configuration information into a prefabricated configuration template through a configuration generation script to generate a configuration file for running the code file, wherein SOMEIP protocol communication configuration information, SOMEIP protocol service configuration information and SOMEIP protocol service discovery configuration information are defined in the configuration template.
And the user inputs the service information of the SOMEIP service, the service method interface information corresponding to the service and the communication configuration information in the form of a table.
The table is an excel table.
Storing the service information and the service method interface information in an xml file, and inputting the service information and the service method interface information in the xml file into a SOMEIP communication middle layer code template by the code generation script to generate a code file.
The script is a python script and the template is a jinja2 template.
The invention is simple and efficient, greatly improves the development efficiency, and has high reusability and good maintainability.
Drawings
The invention is described in detail below with reference to the attached drawings and detailed description:
FIG. 1 is a flow chart of the present invention.
Detailed Description
As shown in fig. 1, a method for implementing a sometip communication intermediate layer code includes the following steps:
s101, receiving and storing service information of SOMEIP service input by a user, service method interface information corresponding to the service and communication configuration information, wherein the user can input the information as required, so as to define a desired method interface.
The service information comprises a service name and a service ID, the service method interface information comprises a method interface type, a method interface name, a method interface ID, a method interface parameter and an event group ID to which the method belongs, the method interface parameter is description information such as an input/output parameter and a parameter type of the method interface, and the communication configuration information comprises a protocol (UDP or TCP) IP address and a communication port required by SOMEIPD communication.
In this embodiment, the service information of the sometip service, the service method interface information corresponding to the service, and the communication configuration information are input by the user in the form of a table, and an excel table may be used.
S102, inputting the service information and the service method interface information into a prefabricated SOMEIP communication middle layer code template through a code generation script to generate a code file.
All implementation flows of method interfaces, filtered interfaces and event interfaces defined by SOMEIP are provided in the SOMEIP communication middle layer code template. The method specifically comprises a process started by a someip server and a client, a registration and call process of a message processing interface of the someip client and the server, a whole process of sending a request message of the client, a whole process of receiving a request response message and processing, a whole process of receiving an event notification message and processing; and the server receives the request message and processes the request message, responds to the request, and sends an event notification message.
Through the code generation script, the information is respectively input into preset positions of the SOMEIP communication middle layer code template, and the rest parts in the template do not need user input, so that the code generation script is fixed and universal.
Because the service information and the service method interface information are directly input into the SOMEIP communication middle layer code template through the code generation script, the implementation is complex, in the embodiment, the service information and the service method interface information are read from an excel form through the excel processing script and stored in an xml file, and then the service information and the service method interface information in the xml file are input into the SOMEIP communication middle layer code template through the code generation script to generate a code file.
S103, inputting the service ID, the event group ID to which the method belongs and the communication configuration information into a prefabricated configuration template through a configuration generation script to generate a configuration file for running the code file.
In this embodiment, the service ID, the event group ID to which the method belongs, and the communication configuration information are read from the excel table through the excel processing script, and output to the configuration generation script.
When the service is a notification service, the user is required to input an event group ID to which the method belongs, the event group ID is used for subscribing an event by a client of SOMEIP communication, and when the service is a service other than the notification service, the event group ID to which the method belongs is left blank.
It should be noted that steps S102 and S103 are not sequential.
By configuring the generation script, the information is respectively input into preset positions of the SOMEIP communication middle layer code template, and the rest part of the template does not need user input and is fixed and universal.
The configuration template defines SOMEIP protocol communication configuration information, SOMEIP protocol service configuration information and SOMEIP protocol service discovery configuration information. The protocol communication configuration information comprises communication IP and client port range information, the service configuration information comprises provided service type, service IP and port information, and the service discovery configuration information comprises multicast used for service discovery, heartbeat interval duration and other information.
Specifically, the service ID and the method-belonging event group ID are input at preset positions in the sometip protocol service configuration information, and the communication configuration information is input at preset positions in the sometip protocol communication configuration information.
The code template and the configuration template can be used for multiple times according to different use scenes and service data, has high reusability, can modify or optimize codes of all method interfaces only by modifying or optimizing the code template and the configuration template, and has excellent maintainability.
In this embodiment, the script is a python script and the template is a jinja2 template.
The invention also relates to a SOMEIP communication middle layer code implementation system, which comprises a storage module, wherein the storage module comprises a plurality of instructions loaded and executed by a processor, and referring to FIG. 1:
s101, receiving and storing service information of SOMEIP service input by a user, service method interface information corresponding to the service and communication configuration information, wherein the user can input the information as required, so as to define a desired method interface.
The service information comprises a service name and a service ID, the service method interface information comprises a method interface type, a method interface name, a method interface ID, a method interface parameter and an event group ID to which the method belongs, the method interface parameter is description information such as an input/output parameter and a parameter type of the method interface, and the communication configuration information comprises a protocol (UDP or TCP) IP address and a communication port required by SOMEIPD communication.
In this embodiment, the service information of the sometip service, the service method interface information corresponding to the service, and the communication configuration information are input by the user in the form of a table, and an excel table may be used.
S102, inputting the service information and the service method interface information into a prefabricated SOMEIP communication middle layer code template through a code generation script to generate a code file.
All implementation flows of method interfaces, filtered interfaces and event interfaces defined by SOMEIP are provided in the SOMEIP communication middle layer code template. The method specifically comprises a process started by a someip server and a client, a registration and call process of a message processing interface of the someip client and the server, a whole process of sending a request message of the client, a whole process of receiving a request response message and processing, a whole process of receiving an event notification message and processing; and the server receives the request message and processes the request message, responds to the request, and sends an event notification message.
Through the code generation script, the information is respectively input into preset positions of the SOMEIP communication middle layer code template, and the rest parts in the template do not need user input, so that the code generation script is fixed and universal.
Because the service information and the service method interface information are directly input into the SOMEIP communication middle layer code template through the code generation script, the implementation is complex, in the embodiment, the service information and the service method interface information are read from an excel form through the excel processing script and stored in an xml file, and then the service information and the service method interface information in the xml file are input into the SOMEIP communication middle layer code template through the code generation script to generate a code file.
S103, inputting the service ID, the event group ID to which the method belongs and the communication configuration information into a prefabricated configuration template through a configuration generation script to generate a configuration file for running the code file.
In this embodiment, the service ID, the event group ID to which the method belongs, and the communication configuration information are read from the excel table through the excel processing script, and output to the configuration generation script.
When the service is a notification service, the user is required to input an event group ID to which the method belongs, the event group ID is used for subscribing an event by a client of SOMEIP communication, and when the service is a service other than the notification service, the event group ID to which the method belongs is left blank.
It should be noted that steps S102 and S103 are not sequential.
By configuring the generation script, the information is respectively input into preset positions of the SOMEIP communication middle layer code template, and the rest part of the template does not need user input and is fixed and universal.
The configuration template defines SOMEIP protocol communication configuration information, SOMEIP protocol service configuration information and SOMEIP protocol service discovery configuration information. The protocol communication configuration information comprises communication IP and client port range information, the service configuration information comprises provided service type, service IP and port information, and the service discovery configuration information comprises multicast used for service discovery, heartbeat interval duration and other information.
Specifically, the service ID and the method-belonging event group ID are input at preset positions in the sometip protocol service configuration information, and the communication configuration information is input at preset positions in the sometip protocol communication configuration information.
The code template and the configuration template can be used for multiple times according to different use scenes and service data, has high reusability, can modify or optimize codes of all method interfaces only by modifying or optimizing the code template and the configuration template, and has excellent maintainability.
In this embodiment, the script is a python script and the template is a jinja2 template.
The invention is simple and efficient, greatly improves the development efficiency, and has high reusability and good maintainability.
However, it will be appreciated by persons skilled in the art that the above embodiments are provided for illustration of the invention and not for limitation thereof, and that changes and modifications to the above described embodiments are intended to fall within the scope of the appended claims as long as they fall within the true spirit of the invention.
Claims (10)
1. The SOMEIP communication middle layer code implementation method is characterized by comprising the following steps:
receiving and storing service information of SOMEIP service input by a user, service method interface information corresponding to the service and communication configuration information, wherein the service information comprises a service name and a service ID, the service method interface information comprises a method interface type, a method interface name, a method interface ID, a method interface parameter and an event group ID to which a method belongs, and the communication configuration information comprises a communication protocol IP and a communication port;
inputting the service information and the service method interface information into a prefabricated SOMEIP communication middle layer code template through a code generation script to generate a code file, wherein the SOMEIP communication middle layer code template is provided with all implementation flows of SOMEIP defined method, filtered and event three-type method interfaces, and the method specifically comprises the following steps: a process started by a someip server and a client, registration and calling of a message processing interface of the someip client and the client, a whole process of sending a request message of the client, a whole process of receiving a request response message and processing, a whole process of receiving an event notification message and processing; the server receives the request message and processes the request message, responds to the request, and sends an event notification message;
and inputting the service ID, the event group ID to which the method belongs and the communication configuration information into a prefabricated configuration template through a configuration generation script to generate a configuration file for running the code file, wherein SOMEIP protocol communication configuration information, SOMEIP protocol service configuration information and SOMEIP protocol service discovery configuration information are defined in the configuration template.
2. The method according to claim 1, wherein the service information of the somei service, the service method interface information corresponding to the service, and the communication configuration information are input in the form of a table for the user.
3. The method for implementing a sometip communication middle layer code according to claim 2, wherein the table is an excel table.
4. A method for implementing a sometip communication middle layer code according to claim 1 or 3, wherein the service information and service method interface information are stored in an xml file, and then the service information and service method interface information in the xml file are input into a sometip communication middle layer code template by the code generation script to generate a code file.
5. The method for implementing a SOMEIP communication middle layer code according to claim 4, wherein the script is a python script and the template is a jinja2 template.
6. A sometip communication middle layer code implementation system comprising a memory module comprising a plurality of instructions loaded and executed by a processor:
receiving and storing service information of SOMEIP service input by a user, service method interface information corresponding to the service and communication configuration information, wherein the service information comprises a service name and a service ID, the service method interface information comprises a method interface type, a method interface name, a method interface ID, a method interface parameter and an event group ID to which a method belongs, and the communication configuration information comprises a communication protocol IP and a communication port;
inputting the service information and the service method interface information into a prefabricated SOMEIP communication middle layer code template through a code generation script to generate a code file, wherein the SOMEIP communication middle layer code template is provided with all implementation flows of SOMEIP defined method, filtered and event three-type method interfaces, and the method specifically comprises the following steps: a process started by a someip server and a client, registration and calling of a message processing interface of the someip client and the client, a whole process of sending a request message of the client, a whole process of receiving a request response message and processing, a whole process of receiving an event notification message and processing; the server receives the request message and processes the request message, responds to the request, and sends an event notification message;
and inputting the service ID, the event group ID to which the method belongs and the communication configuration information into a prefabricated configuration template through a configuration generation script to generate a configuration file for running the code file, wherein SOMEIP protocol communication configuration information, SOMEIP protocol service configuration information and SOMEIP protocol service discovery configuration information are defined in the configuration template.
7. The system according to claim 6, wherein the service information of the somei service, the service method interface information corresponding to the service, and the communication configuration information are inputted in the form of a table for the user.
8. The sometip communication middle layer code implementation system of claim 7, wherein the form is an excel form.
9. The system according to claim 6 or 8, wherein the service information and service method interface information are stored in an xml file, and then the service information and service method interface information in the xml file are input into a somip communication middle layer code template by the code generation script to generate a code file.
10. The SOMEIP communication middle layer code implementation system of claim 9, wherein the script is a python script and the template is a jinja2 template.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010259265.9A CN111475149B (en) | 2020-04-03 | 2020-04-03 | SOMEIP communication intermediate layer code realization method and system thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010259265.9A CN111475149B (en) | 2020-04-03 | 2020-04-03 | SOMEIP communication intermediate layer code realization method and system thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111475149A CN111475149A (en) | 2020-07-31 |
CN111475149B true CN111475149B (en) | 2023-06-16 |
Family
ID=71749613
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010259265.9A Active CN111475149B (en) | 2020-04-03 | 2020-04-03 | SOMEIP communication intermediate layer code realization method and system thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111475149B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112769767B (en) * | 2020-12-23 | 2022-06-14 | 华人运通(上海)云计算科技有限公司 | Vehicle-mounted Ethernet SOME/IP protocol data analysis method, device, medium and system |
CN113407362A (en) * | 2021-06-16 | 2021-09-17 | 武汉光庭信息技术股份有限公司 | SOMEIP communication intermediate layer implementation method and system based on SOA architecture of vehicle-mounted Android system |
CN114327383A (en) * | 2021-11-30 | 2022-04-12 | 重庆长安汽车股份有限公司 | Service configuration system, method and readable storage medium based on SOA architecture middleware |
CN114816427B (en) * | 2022-05-11 | 2024-10-29 | 上海英恒电子有限公司 | Interface generation method and device based on automobile open system architecture |
CN118138626B (en) * | 2024-01-23 | 2024-11-01 | 镁佳(武汉)科技有限公司 | SOMEIP communication intermediate layer implementation system, method and vehicle |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110286897A (en) * | 2019-05-22 | 2019-09-27 | 深圳壹账通智能科技有限公司 | API visualization dynamic configuration method, device, equipment and storage medium |
CN110347522A (en) * | 2019-07-09 | 2019-10-18 | 沈阳欧瑞科技有限公司 | A kind of server-side and the integrated implementation method of client |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7467391B2 (en) * | 2002-10-30 | 2008-12-16 | International Business Machines Corporation | Allowing client applications to programmatically access web sites |
-
2020
- 2020-04-03 CN CN202010259265.9A patent/CN111475149B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110286897A (en) * | 2019-05-22 | 2019-09-27 | 深圳壹账通智能科技有限公司 | API visualization dynamic configuration method, device, equipment and storage medium |
CN110347522A (en) * | 2019-07-09 | 2019-10-18 | 沈阳欧瑞科技有限公司 | A kind of server-side and the integrated implementation method of client |
Non-Patent Citations (1)
Title |
---|
杨皓 ; 杨忠 ; 吴愚 ; .基于XML脚本的代码生成技术及其应用.电脑知识与技术.2009,(第07期),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN111475149A (en) | 2020-07-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111475149B (en) | SOMEIP communication intermediate layer code realization method and system thereof | |
CN112788074B (en) | Data sending method, processing method, receiving method and its device, storage medium | |
CN101931619B (en) | Pluggable contact resolution | |
CN109510744A (en) | Internet of Things device intelligence cut-in method and device | |
CN102467411A (en) | Workflow processing and workflow agent method, device and system | |
CN102045265A (en) | Device and method for information interaction | |
CN112527523A (en) | Distributed message transmission method and system for high-performance computing multiple clouds | |
CN112866421A (en) | Intelligent contract operation method and device based on distributed cache and NSQ | |
CN114615096A (en) | Telecommunication charging method, system and related equipment based on event-driven architecture | |
CN112698817B (en) | Message access method, device and system based on micro-service architecture and storage medium | |
CN115098528B (en) | Service processing method, device, electronic equipment and computer readable storage medium | |
CN112804099A (en) | Parameter batch configuration method and device, computer equipment and readable storage medium | |
CN115242629B (en) | Data aggregation method and device based on API gateway | |
CN110392114B (en) | Service call processing system and method across multiple registration centers | |
CN113625586B (en) | Method and system for controlling intelligent home based on gateway | |
CN116406028A (en) | Service management method, device, system, electronic equipment and storage medium thereof | |
CN112615773A (en) | Message processing method and system | |
CN110636073A (en) | Distributed asynchronous remote service arranging and calling technology | |
CN116436966A (en) | Method and system for realizing equipment activation based on EMQ | |
CN112799929B (en) | Root cause analysis method and system of alarm log | |
CN106651066A (en) | Data processing method and platform | |
CN116915779A (en) | Computing network resource orchestration method and device for intelligent video services | |
CN113868396A (en) | Task intelligent dialogue construction method and system based on knowledge graph | |
CN114564317B (en) | A method, system and vehicle for communicating services of modules in a vehicle terminal | |
CN111652580A (en) | Method and device for processing data of nodes |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |