Method and device for generating communication protocol

文档序号:703427 发布日期:2021-04-13 浏览:2次 中文

阅读说明:本技术 一种生成通信协议的方法和装置 (Method and device for generating communication protocol ) 是由 李国萌 宗文栋 黄旭 于 2019-10-09 设计创作,主要内容包括:本发明提供了一种生成通信协议的方法和装置,涉及整车开发技术领域。该方法包括:获取需要生成的通信协议格式的第一调查问卷,并获取所述第一调查问卷与预期处理方案的功能的差异性;根据与预期处理方案的功能的差异性对通信协议平台库自动升级;根据升级后的通信协议平台库自动化生成通信矩阵。本发明实施例提供的生成通信协议的方法可以大大提高编制通信协议的效率、有效缩短研发周期;避免了通信协议版本管理混乱的现象,大大降低了整车研发的风险;该方法适用范围广,同时有利于完善优化通信协议平台库。(The invention provides a method and a device for generating a communication protocol, and relates to the technical field of vehicle development. The method comprises the following steps: acquiring a first questionnaire in a communication protocol format required to be generated, and acquiring the difference between the first questionnaire and the function of an expected processing scheme; automatically upgrading the communication protocol platform library according to the difference of the functions of the expected processing scheme; and automatically generating a communication matrix according to the upgraded communication protocol platform library. The method for generating the communication protocol provided by the embodiment of the invention can greatly improve the efficiency of compiling the communication protocol and effectively shorten the research and development period; the phenomenon of disordered management of communication protocol versions is avoided, and the research and development risk of the whole vehicle is greatly reduced; the method has wide application range and is beneficial to perfecting and optimizing the communication protocol platform library.)

1. A method of generating a communication protocol, comprising:

acquiring a first questionnaire in a communication protocol format required to be generated, and acquiring the difference between the first questionnaire and the function of an expected processing scheme;

automatically upgrading the communication protocol platform library according to the difference of the functions of the expected processing scheme;

and automatically generating a communication matrix according to the upgraded communication protocol platform library.

2. The method of claim 1, wherein obtaining a first questionnaire in a communication protocol format to be generated and obtaining a difference between the first questionnaire and a function of a desired treatment plan comprises:

according to the configuration and the framework of the control function of the whole vehicle, a first signal questionnaire is automatically derived from a communication protocol platform library, and the communication protocol format of the first signal questionnaire comprises the following steps: mapping signals and mapping rules of all functions of the whole vehicle;

comparing the first signal questionnaire to a difference in function of an expected treatment regimen;

upgrading the differences into a second questionnaire, wherein a communication protocol format of the second questionnaire comprises: and mapping signals and mapping rules of all functions of the whole vehicle are required.

3. The method of generating a communication protocol of claim 2 wherein automatically deriving a first signal questionnaire from a communication protocol platform library according to vehicle control function configuration and architecture comprises:

checking the conformity of the first signal questionnaire and the vehicle control function, and if the conformity is completely matched, automatically exporting the first signal questionnaire from the communication protocol platform library;

and if the matching is not complete, the whole vehicle control function needs to be combed again, a new signal questionnaire is generated until the first signal questionnaire is generated by complete matching, and the first signal questionnaire is automatically derived from the communication protocol platform library.

4. The method of generating a communication protocol of claim 1 wherein automatically upgrading a communication protocol platform library based on differences in functionality from an expected processing scenario comprises:

establishing an item label, and adding the item label to the newly added signals with the differences;

partitioning the newly added signals with differences;

adding the divided signals into the message;

defining message attributes;

and writing the distributed message into the communication protocol platform library.

5. The method of generating a communication protocol of claim 4 wherein the dividing the newly added signal comprises:

retrieving the signals with consistent transmitting frequency; and/or

The signals with the same real-time are divided again according to the function.

6. The method of claim 4, wherein adding the partitioned signals to the message comprises:

searching whether messages with the same function exist or not, and if not, redefining a frame of new messages; if yes, detecting whether a frame message of the same functional signal can be placed, if not, automatically adding a frame message, and if yes, placing the signal in an empty position with the same frequency function as the existing message.

7. The method of generating a communication protocol of claim 1 wherein automatically generating a communication matrix from the upgraded communication protocol platform library comprises:

generating a single-node communication matrix according to the requirement of a controller, wherein the single-node communication matrix comprises: signals of the controller interacting with other nodes;

generating each network segment communication matrix according to the architecture of the controller, wherein each network segment communication matrix comprises: interactive signals of all controllers in the network segment;

and generating a gateway routing table according to the single-node communication matrix and the communication matrixes of the network segments.

8. The method of generating a communication protocol of claim 1 further comprising:

and updating the communication protocol platform library according to the change signal in the whole vehicle development process.

9. The method for generating a communication protocol according to claim 8, wherein the updating the communication protocol platform library according to the change signal in the development process of the whole vehicle comprises:

analyzing the change signal and dividing change types;

judging whether the change signal exists in the communication protocol platform library according to the change type;

if the change signal exists in the communication protocol platform library, judging whether the attribute of the change signal changes;

if the attribute of the change signal is not changed, adding a change label to the change signal, and writing the change label into the communication protocol platform library;

and if the attribute of the change signal changes, adjusting the change signal, and writing the adjusted change signal into the communication protocol platform library.

10. An apparatus for generating a communication protocol, comprising:

the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first questionnaire in a communication protocol format required to be generated and acquiring the difference between the first questionnaire and the function of an expected processing scheme;

the processing module is used for automatically upgrading the communication protocol platform library according to the difference of the functions of the expected processing scheme;

and the generating module is used for automatically generating a communication matrix according to the upgraded communication protocol platform library.

Technical Field

The invention relates to the technical field of vehicle development, in particular to a method and a device for generating a communication protocol.

Background

The communication protocol (controller language) is one of important files in the whole vehicle development process and is the most important basis for guiding the development of each controller software. On one hand, the whole vehicle function architecture is more and more complex, and the number of controllers is more and more, so that the signal requirement input and the whole vehicle communication protocol are increased. On the other hand, with the increase of the personalized demands of users, the vehicle types researched and developed by each host factory are more and more, and the host factory invests a large amount of manpower to carry out bus protocol compilation and maintenance work, so that the purpose of ensuring the smooth progress of the whole vehicle research and development is achieved. Currently, how to improve the communication protocol editing efficiency has become a problem that the host factory must solve.

Disclosure of Invention

The embodiment of the invention provides a method and a device for generating a communication protocol, which aim to solve the problem of low efficiency of communication protocol editing.

In order to solve the above technical problem, an embodiment of the present invention provides a method for generating a communication protocol, including:

acquiring a first questionnaire in a communication protocol format required to be generated, and acquiring the difference between the first questionnaire and the function of an expected processing scheme;

automatically upgrading the communication protocol platform library according to the difference of the functions of the expected processing scheme;

and automatically generating a communication matrix according to the upgraded communication protocol platform library.

Further, acquiring a first questionnaire in a communication protocol format to be generated, and acquiring the difference between the first questionnaire and the function of an expected processing scheme, comprises:

according to the configuration and the framework of the control function of the whole vehicle, a first signal questionnaire is automatically derived from a communication protocol platform library, and the communication protocol format of the first signal questionnaire comprises the following steps: mapping signals and mapping rules of all functions of the whole vehicle;

comparing the first signal questionnaire to a difference in function of an expected treatment regimen;

upgrading the differences into a second questionnaire, wherein a communication protocol format of the second questionnaire comprises: and mapping signals and mapping rules of all functions of the whole vehicle are required.

Further, automatically deriving a first signal questionnaire from a communication protocol platform library according to the vehicle control function configuration and architecture comprises:

checking the conformity of the first signal questionnaire and the vehicle control function, and if the conformity is completely matched, automatically exporting the first signal questionnaire from the communication protocol platform library;

and if the matching is not complete, the whole vehicle control function needs to be combed again, a new signal questionnaire is generated until the first signal questionnaire is generated by complete matching, and the first signal questionnaire is automatically derived from the communication protocol platform library.

Further, automatically upgrading the communication protocol platform library according to the difference of functions of the expected processing scheme, comprising:

establishing an item label, and adding the item label to the newly added signals with the differences;

partitioning the newly added signals with differences;

adding the divided signals into the message;

defining message attributes;

and writing the distributed message into the communication protocol platform library.

Further, the dividing the newly added signal includes:

retrieving the signals with consistent transmitting frequency; and/or

The signals with the same real-time are divided again according to the function.

Further, the adding the divided signals to the message includes:

searching whether messages with the same function exist or not, and if not, redefining a frame of new messages; if yes, detecting whether a frame message of the same functional signal can be placed, if not, automatically adding a frame message, and if yes, placing the signal in an empty position with the same frequency function as the existing message.

Further, automatically generating a communication matrix according to the upgraded communication protocol platform library, comprising:

generating a single-node communication matrix according to the requirement of a controller, wherein the single-node communication matrix comprises: signals of the controller interacting with other nodes;

generating each network segment communication matrix according to the architecture of the controller, wherein each network segment communication matrix comprises: interactive signals of all controllers in the network segment;

and generating a gateway routing table according to the single-node communication matrix and the communication matrixes of the network segments.

Further, the method for generating a communication protocol provided in the embodiment of the present invention further includes:

and updating the communication protocol platform library according to the change signal in the whole vehicle development process.

Further, the updating the communication protocol platform library according to the change signal in the whole vehicle development process includes:

analyzing the change signal and dividing change types;

judging whether the change signal exists in the communication protocol platform library according to the change type;

if the change signal exists in the communication protocol platform library, judging whether the attribute of the change signal changes;

if the attribute of the change signal is not changed, adding a change label to the change signal, and writing the change label into the communication protocol platform library;

and if the attribute of the change signal changes, adjusting the change signal, and writing the adjusted change signal into the communication protocol platform library.

An embodiment of the present invention further provides a device for generating a communication protocol, including:

the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first questionnaire in a communication protocol format required to be generated and acquiring the difference between the first questionnaire and the function of an expected processing scheme;

the processing module is used for automatically upgrading the communication protocol platform library according to the difference of the functions of the expected processing scheme;

and the generating module is used for automatically generating a communication matrix according to the upgraded communication protocol platform library.

The above embodiments of the present invention have at least the following technical effects:

the method for generating the communication protocol provided by the embodiment of the invention can greatly improve the efficiency of compiling the communication protocol and effectively shorten the research and development period; errors caused by operation of related technicians can be avoided, the phenomenon of disordered management of communication protocol versions is avoided, and the risk of research and development of the whole vehicle is greatly reduced; the method has wide application range, is beneficial to perfecting and optimizing the communication protocol platform library, is beneficial to developing the communication matrix of the derivative vehicle model, and has important significance for a host factory.

Drawings

FIG. 1 is a flow chart of a method provided by an embodiment of the present invention;

fig. 2 is a flowchart illustrating a method for obtaining a format of a communication protocol to be generated according to an embodiment of the present invention;

FIG. 3 is a flow chart of a method for upgrading a platform library of a communication protocol according to an embodiment of the present invention;

fig. 4 is a block diagram of an apparatus for generating a communication protocol according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help the full understanding of the embodiments of the present invention. Thus, it will be apparent to those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the invention. In addition, descriptions of well-known functions and constructions are omitted for clarity and conciseness.

It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

In various embodiments of the present invention, it should be understood that the sequence numbers of the following processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

The invention provides a method and a device for generating a communication protocol, aiming at the problem of low efficiency of communication protocol editing.

As shown in fig. 1, an embodiment of the present invention provides a method for generating a communication protocol, including:

step 100, acquiring a first questionnaire in a communication protocol format to be generated, and acquiring the difference between the first questionnaire and the function of an expected processing scheme;

step 200, automatically upgrading the communication protocol platform library according to the difference of the functions of the expected processing scheme;

and 300, automatically generating a communication matrix according to the upgraded communication protocol platform library.

According to the embodiment of the invention, the format of the communication protocol to be generated is obtained, the communication protocol platform library is upgraded according to the format, and the communication matrix is generated according to the upgraded communication protocol platform library, so that the research and development period can be shortened, the phenomena of errors and disordered communication protocol version management caused by operation of related technicians can be avoided, and the research and development risk of the whole vehicle is greatly reduced.

In an alternative embodiment of the present invention, as shown in fig. 2, the step 100 may include:

step 101, automatically deriving a first signal questionnaire from a communication protocol platform library according to vehicle control function configuration and architecture, wherein a communication protocol format of the first signal questionnaire comprises: mapping signals and mapping rules of all functions of the whole vehicle.

It should be noted that, when the first signal questionnaire is automatically derived from the communication protocol platform library, the conformity between the first signal questionnaire and the vehicle control function needs to be checked, and if the first signal questionnaire is completely matched with the vehicle control function, the first signal questionnaire is automatically derived from the communication protocol platform library; and if the matching is not complete, the whole vehicle control function needs to be combed again, a new signal questionnaire is generated until the first signal questionnaire is generated by complete matching, and the first signal questionnaire is automatically derived from the communication protocol platform library.

Step 102, comparing the first signal questionnaire to the differences in function of the expected treatment regimen.

It should be noted that, by comparing and analyzing the differences, the differences between the current communication protocol platform library and the expected processing scheme are discussed. The difference here refers to the place where the signals required by the function in the expected processing scheme are inconsistent with the requirements of the communication protocol platform, and there are two kinds of processing for the difference, one is that the processing scheme of the function expected processing scheme and the communication protocol platform both have processing schemes, which is the case that which scheme is better executed according to which scheme; the other is that the communication protocol platform has no processing scheme and executes according to the processing scheme provided by the expected processing scheme. For example, the processing schemes of the communication protocol platforms of the anti-slope-sliding function are mature, and the processing schemes are executed according to the schemes of the communication protocol platforms; while Advanced Driving Assistance System (ADAS) solution communication protocol platform solutions are currently immature, this situation would take the expected approach.

Step 103, upgrading the differences to a second questionnaire, wherein a communication protocol format of the second questionnaire comprises: and mapping signals and mapping rules of all functions of the whole vehicle are required.

Specifically, to examine the differences, the embodiment of the present invention automatically upgrades the differences to the second questionnaire, and all signals in this process must be mapped according to the mapping rules mentioned in the first questionnaire. Since there are numerous controllers, each of the desired solutions is not consistent, and the quality of the first questionnaire is not the same, the assistance of the bus development related technicians is required in the process until the mapping rules specified by the communication protocol platform are completely satisfied by the questionnaire.

In the embodiment of the invention, the function difference between the second questionnaire and the communication protocol platform library is upgraded to the host factory platform library. In other words, the attributes of the signals in the questionnaire are only basic attributes, including the transmission period, the signal length, the transmission type and the like of the signals, and the interaction between the vehicle controllers is not directly through the functional signals, but through the application messages, the signals are reasonably distributed into the application messages, and then the process of writing the application messages into the platform library of the host plant is the upgrading of the platform library.

In an alternative embodiment of the present invention, as shown in fig. 3, the step 200 may include:

step 201, establishing an item label, and adding the item label to the newly added signals with difference.

It should be noted that, because there are differences in the second questionnaire, that is, the current platform library cannot satisfy the project requirements, and there are many projects in the platform library, not all of the projects will apply these new added signals, and if these signals do not have project tags, the platform library will be confused.

Step 202, dividing the newly added signals with differences.

It should be noted that the dividing the newly added signal includes: retrieving the signals with consistent transmitting frequency; and/or, the signals with the same real-time performance are divided again according to the functions.

Specifically, the embodiment of the present invention presents the detection result to the relevant technical staff, and the relevant technical staff performs an audit on the retrieved signal, adjusts the division of the signal, and then feeds back the final division result to the apparatus implementing the embodiment of the present invention.

Step 203, adding the divided signals to the message.

Specifically, the adding the divided signals to the packet includes:

searching whether messages with the same function exist or not, and if not, redefining a frame of new messages; if yes, detecting whether a frame message of the same functional signal can be placed, if not, automatically adding a frame message, and if yes, placing the signal in an empty position with the same frequency function as the existing message.

Step 204, defining the message attribute. Specifically, if the message attribute is not defined, the controllers cannot interact with each other; here, the name (ID), transmission cycle, transmission method, and the like of the message are mainly defined.

And step 205, writing the distributed message into the communication protocol platform library.

In an alternative embodiment of the present invention, the step 300 may include:

step 301, generating a single-node communication matrix according to the requirement of the controller, wherein the single-node communication matrix comprises: signals of the controller interacting with other nodes; in particular, the single-node communication matrix is used for controller development.

Step 302, generating each network segment communication matrix according to the architecture of the controller, wherein each network segment communication matrix comprises: interactive signals of all controllers in the network segment; specifically, the communication matrix of each network segment is used for network testing and function testing.

And 303, generating a gateway routing table according to the single-node communication matrix and the communication matrixes of the network segments. Specifically, the gateway routing table mainly includes signals interacting across network segments for directing development of a gateway controller, and the routing table mainly includes two modes of signal routing and message routing.

Since the development of the whole vehicle is not constant, the input of the whole vehicle is divided into several stages, a software test (FP) stage, an engineering sample vehicle (EP) stage, and the like, so that the change of the signal is very normal, after the communication matrix is automatically generated by the communication protocol platform library, optionally, the method for generating the communication protocol may further include:

and step 400, updating the communication protocol platform library according to the change signal in the whole vehicle development process.

In an alternative embodiment of the present invention, the step 400 may include:

step 401, analyzing the change signal and dividing change types;

step 402, judging whether the change signal exists in the communication protocol platform library according to the change type;

step 403, if the change signal already exists in the communication protocol platform library, determining whether the attribute of the change signal changes;

specifically, if the change signal is already present in the communication protocol platform library, the change signal is only applied to other items, and the item tag may be directly written into the communication protocol platform library.

Step 404, if the attribute of the change signal is not changed, adding a change tag to the change signal, and writing the change tag into the communication protocol platform library;

step 405, if the attribute of the change signal changes, adjusting the change signal, and writing the adjusted change signal into the communication protocol platform library.

Specifically, if the attribute of the change signal changes, it is further required to determine whether the change signal with the changed attribute can be adjusted in the message; if the message can be adjusted, writing the adjusted change signal into the communication protocol platform library, for example, the original signal length is 2 bits, the new requirement is 4 bits, and the current message has a position, and directly adjusting; if the adjustment cannot be carried out in the message, the attribution of the signals needs to be divided again in the case, and the step 200 is repeated; in the embodiment of the present invention, the message attribute of the modified signal changes, that is, the carrier attribute of the signal changes, and in this case, the message needs to be subdivided, the step 200 is repeated, and the message is written into the communication protocol platform library after adjustment.

As shown in fig. 4, an embodiment of the present invention further provides an apparatus for generating a communication protocol, where the apparatus includes:

an obtaining module 10, configured to obtain a first questionnaire in a communication protocol format that needs to be generated, and obtain a difference between the first questionnaire and a function of an expected processing scheme;

a processing module 20, configured to automatically upgrade the communication protocol platform library according to a difference from a function of an expected processing scheme;

and the generating module 30 is configured to automatically generate a communication matrix according to the upgraded communication protocol platform library.

Optionally, the obtaining module 10 includes:

a first obtaining unit, configured to automatically derive a first signal questionnaire from a communication protocol platform library according to a vehicle control function configuration and architecture, where a communication protocol format of the first signal questionnaire includes: mapping signals and mapping rules of all functions of the whole vehicle;

a second acquisition unit for comparing the first signal questionnaire with a difference in function of an expected treatment protocol;

a third obtaining unit, configured to upgrade the difference to a second questionnaire, where a communication protocol format of the second questionnaire includes: and mapping signals and mapping rules of all functions of the whole vehicle are required.

Further, automatically deriving a first signal questionnaire from a communication protocol platform library according to the vehicle control function configuration and architecture comprises:

checking the conformity of the first signal questionnaire and the vehicle control function, and if the conformity is completely matched, automatically exporting the first signal questionnaire from the communication protocol platform library;

and if the matching is not complete, the whole vehicle control function needs to be combed again, a new signal questionnaire is generated until the first signal questionnaire is generated by complete matching, and the first signal questionnaire is automatically derived from the communication protocol platform library.

Optionally, the processing module 20 includes:

the first processing unit is used for establishing an item label and adding the item label to all newly added signals with the difference;

a second processing unit, configured to divide the newly added signals with differences;

the third processing unit is used for adding the divided signals into the message;

the fourth processing unit is used for defining the message attribute;

and the fifth processing unit is used for writing the distributed messages into the communication protocol platform library.

Further, the dividing the newly added signal includes:

retrieving the signals with consistent transmitting frequency; and/or

The signals with the same real-time are divided again according to the function.

Further, the adding the divided signals to the message includes:

searching whether messages with the same function exist or not, and if not, redefining a frame of new messages; if yes, detecting whether a frame message of the same functional signal can be placed, if not, automatically adding a frame message, and if yes, placing the signal in an empty position with the same frequency function as the existing message.

Optionally, the generating module 30 includes:

a first generating unit, configured to generate a single-node communication matrix according to a requirement of a controller, where the single-node communication matrix includes: signals of the controller interacting with other nodes;

a second generating unit, configured to generate each network segment communication matrix according to an architecture of the controller, where each network segment communication matrix includes: interactive signals of all controllers in the network segment;

and the third generating unit is used for generating a gateway routing table according to the single-node communication matrix and each network segment communication matrix.

Further, the apparatus for generating a communication protocol provided in the embodiment of the present invention further includes:

and the change module is used for updating the communication protocol platform library according to a change signal in the whole vehicle development process.

Optionally, the changing module includes:

a first changing unit for analyzing the change signal and dividing the change type;

a second change unit configured to determine whether the change signal is already present in the communication protocol platform library according to the change type;

a third changing unit, configured to determine whether an attribute of the change signal changes if the change signal already exists in the communication protocol platform library;

a fourth changing unit, configured to add a change tag to the change signal if the attribute of the change signal is not changed, and write the change tag into the communication protocol platform library;

and a fifth changing unit, configured to adjust the change signal if the attribute of the change signal changes, and write the adjusted change signal into the communication protocol platform library.

The method and the device for generating the communication protocol provided by the embodiment of the invention can greatly improve the efficiency of compiling the communication protocol and effectively shorten the research and development period; errors caused by operation of related technicians can be avoided, the phenomenon of disordered management of communication protocol versions is avoided, and the risk of research and development of the whole vehicle is greatly reduced; the method has wide application range and is beneficial to perfecting and optimizing the communication protocol platform library.

While the preferred embodiments of the present invention have been described, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the following claims.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种机床监视器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类