Test method and device for someip protocol in vehicle
By using automated in-vehicle SOME/IP protocol testing methods and devices, information such as target service ID and method ID is extracted to determine whether vehicle message data conforms to the preset service definition. This solves the problem of low efficiency in in-vehicle SOME/IP protocol testing and achieves highly efficient automated testing.
Patent Information
- Application Number
- CN202310517763.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-10
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-05-10
AI Technical Summary
Existing technologies for testing in-vehicle SOME/IP protocols are inefficient, mainly relying on manual parsing of messages to determine if the protocol is functioning correctly, resulting in low efficiency.
A testing method and apparatus for the vehicle-mounted SOME/IP protocol are provided. By acquiring vehicle message data, extracting the target service ID, method ID, remote service call type, target client, and target server, the method automatically determines whether the vehicle message data conforms to the preset service definition, thereby achieving automated testing.
It improves the testing efficiency of the vehicle SOME/IP protocol by automatically determining whether the vehicle message data is correct, thus ensuring the accuracy and efficiency of the test results.
Smart Images

Figure CN116614420B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of SOMEIP protocol testing, and particularly relates to a test method and device for vehicle SOMEIP protocol. BACKGROUND
[0002] The vehicle SOME / IP protocol is an important protocol for realizing vehicle communication, and the SOME / IP protocol carried by a vehicle needs to be tested before the vehicle is shipped, so as to ensure that the SOME / IP protocol is correct. At present, the test of the vehicle SOME / IP protocol is to manually analyze the SOME / IP message and determine whether the SOME / IP message is correct, so as to determine whether the SOME / IP protocol is correct. The manual test method has the problem of low efficiency. Therefore, how to improve the test efficiency of the vehicle SOME / IP protocol has become a problem to be solved in the field. SUMMARY
[0003] The present application provides a test method and device for vehicle SOMEIP protocol, which solves the technical problem of how to improve the test efficiency of the vehicle SOME / IP protocol.
[0004] In one aspect, the present application provides the following technical solutions:
[0005] A test method for vehicle SOMEIP protocol, comprising:
[0006] Obtaining vehicle message data transmitted by the vehicle SOMEIP protocol based on a preset service definition;
[0007] Extracting a target service ID, a target method ID under the target service ID, a remote service call type corresponding to the target method ID, a target client and a target server from the preset service definition;
[0008] Finding a message from the vehicle message data based on the remote service call type, the target service ID, the target method ID, the target client and the target server, and determining whether the vehicle message data is correct according to the message finding result and the remote service call type.
[0009] Preferably, the finding of the message from the vehicle message data based on the remote service call type, the target service ID, the target method ID, the target client and the target server, and the determination of whether the vehicle message data is correct according to the message finding result and the remote service call type, comprises:
[0010] if the remote service call type is F&F, searching for a first request message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target client, and a message receiver being the target service end from the vehicle message data;
[0011] if the first request message is not found, judging that the vehicle message data lacks the first request message;
[0012] if the first request message is found, searching for a first response message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target service end, and a message receiver being the target client from the vehicle message data;
[0013] if the first response message is found, judging that the vehicle message data has the first response message.
[0014] Preferably, the searching for the message from the vehicle message data based on the remote service call type, the target service ID, the target method ID, the target client, and the target service end, and judging whether the vehicle message data is correct according to the message searching result and the remote service call type further comprises:
[0015] if the first request message is found, extracting a target value of a first target parameter corresponding to the target service ID and the target method ID from the preset service definition;
[0016] if the actual value of the first target parameter in the first request message is different from the target value of the first target parameter in the preset service definition, judging that the first request message is incorrect.
[0017] Preferably, the searching for the message from the vehicle message data based on the remote service call type, the target service ID, the target method ID, the target client, and the target service end, and judging whether the vehicle message data is correct according to the message searching result and the remote service call type comprises:
[0018] if the remote service call type is R / R, setter, or getter, searching for a second request message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target client, and a message receiver being the target service end from the vehicle message data;
[0019] if the second request message is not found, judging that the vehicle message data lacks the second request message;
[0020] If the second request message is found, a second response message with the target service ID, the target method ID, the target service end as the message sender and the target client as the message receiver is found from the vehicle message data;
[0021] If the second response message is not found, it is determined that the vehicle message data lacks the second response message.
[0022] Preferably, the message is found from the vehicle message data based on the remote service call type, the target service ID, the target method ID, the target client and the target service end, and it is determined whether the vehicle message data is correct according to the message finding result and the remote service call type, and the method further comprises:
[0023] If the first target message is found, a target value of a second target parameter corresponding to the target service ID and the target method ID is extracted from the preset service definition, and the first target message is the second request message or the second response message;
[0024] If the actual value of the second target parameter in the first target message is different from the target value of the second target parameter in the preset service definition, it is determined that the first target message is incorrect.
[0025] Preferably, the message is found from the vehicle message data based on the remote service call type, the target service ID, the target method ID, the target client and the target service end, and it is determined whether the vehicle message data is correct according to the message finding result and the remote service call type, and the method further comprises:
[0026] If the remote service call type is notifier or event, a subscription message with the target service ID, the target method ID, the target client as the message sender and the target service end as the message receiver is found from the vehicle message data;
[0027] If the subscription message is not found, it is determined that the vehicle message data lacks the subscription message;
[0028] If the subscription message is found, a subscription Ack message with the target service ID, the target method ID, the target service end as the message sender and the target client as the message receiver is found from the vehicle message data;
[0029] If the subscription Ack message is not found, it is determined that the vehicle message data lacks the subscription Ack message;
[0030] if the subscription Ack packet is found, finding a publish packet with the target service ID, the target method ID, the target service end as the packet sender and the target client as the packet receiver from the vehicle packet data;
[0031] if the publish packet is not found, judging that the vehicle packet data lacks the publish packet.
[0032] Preferably, the judgment module is further configured to:
[0033] if the second target packet is found, extracting a target value of a third target parameter corresponding to the target service ID and the target method ID from the preset service definition, the second target packet being the subscription packet, the subscription Ack packet or the publish packet;
[0034] if the actual value of the third target parameter in the second target packet is different from the target value of the third target parameter in the preset service definition, judging that the second target packet is incorrect.
[0035] In another aspect, the application also provides the following technical solutions:
[0036] A testing device for vehicle-mounted SOMEIP protocol, comprising:
[0037] an acquisition module configured to acquire vehicle packet data transmitted by vehicle-mounted SOMEIP protocol based on a preset service definition;
[0038] an extraction module configured to extract a target service ID, a target method ID under the target service ID, a remote service invocation type corresponding to the target method ID, a target client and a target service end from the preset service definition;
[0039] a judgment module configured to find a packet from the vehicle packet data based on the remote service invocation type, the target service ID, the target method ID, the target client and the target service end, and judge whether the vehicle packet data is correct according to the packet finding result and the remote service invocation type.
[0040] Preferably, the judgment module is further configured to:
[0041] if the remote service call type is F&F, searching, from the vehicle message data, a first request message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target client, and a message receiver being the target service end;
[0042] if the first request message is not found, judging that the vehicle message data lacks the first request message;
[0043] if the first request message is found, searching, from the vehicle message data, a first response message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target service end, and a message receiver being the target client;
[0044] if the first response message is found, judging that the vehicle message data has the first response message.
[0045] Preferably, the judging module is further configured to:
[0046] if the first request message is found, extracting, from the preset service definition, a target value of a first target parameter corresponding to the target service ID and the target method ID;
[0047] if an actual value of the first target parameter in the first request message is different from a target value of the first target parameter in the preset service definition, judging that the first request message is incorrect.
[0048] Preferably, the judging module is further configured to:
[0049] if the remote service call type is R / R, setter or getter, searching, from the vehicle message data, a second request message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target client, and a message receiver being the target service end;
[0050] if the second request message is not found, judging that the vehicle message data lacks the second request message;
[0051] if the second request message is found, searching, from the vehicle message data, a second response message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target service end, and a message receiver being the target client;
[0052] if the second response message is not found, judging that the vehicle message data lacks the second response message.
[0053] Preferably, the judging module is further configured to:
[0054] If the first target message is found, a target value of a second target parameter corresponding to the target service ID and the target method ID is extracted from the preset service definition, the first target message being the second request message or the second response message;
[0055] If the actual value of the second target parameter in the first target message is different from the target value of the second target parameter in the preset service definition, it is judged that the first target message is incorrect.
[0056] Preferably, the judging module is further configured to:
[0057] If the remote service calling type is notifier or event, a subscription message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target client and a message receiver being the target service end is found from the vehicle message data;
[0058] If the subscription message is not found, it is judged that the vehicle message data lacks the subscription message;
[0059] If the subscription message is found, a subscription Ack message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target service end and a message receiver being the target client is found from the vehicle message data;
[0060] If the subscription Ack message is not found, it is judged that the vehicle message data lacks the subscription Ack message;
[0061] If the subscription Ack message is found, a publishing message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target service end and a message receiver being the target client is found from the vehicle message data;
[0062] If the publishing message is not found, it is judged that the vehicle message data lacks the publishing message.
[0063] Preferably, the judging module is further configured to:
[0064] If the second target message is found, a target value of a third target parameter corresponding to the target service ID and the target method ID is extracted from the preset service definition, the second target message being the subscription message, the subscription Ack message or the publishing message;
[0065] If the actual value of the third target parameter in the second target message is different from the target value of the third target parameter in the preset service definition, it is judged that the second target message is incorrect.
[0066] In another aspect, the present application also provides the following technical solutions:
[0067] An electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the test method of the vehicle SOMEIP protocol when executing the program.
[0068] In another aspect, the present application also provides the following technical solutions:
[0069] A computer readable storage medium has a computer program stored thereon, and the computer program implements the test method of the vehicle SOMEIP protocol when executed by a processor.
[0070] The one or more technical solutions provided by the present application have at least the following technical effects or advantages:
[0071] The present application extracts the target service ID, the target method ID under the target service ID, the remote service call type corresponding to the target method ID, the target client and the target server from the preset service definition, finds the message from the vehicle message data based on the remote service call type, the target service ID, the target method ID, the target client and the target server, and judges whether the vehicle message data is correct according to the message finding result and the remote service call type, which is equivalent to judging whether the vehicle message data is correct by automatically judging whether the vehicle message data transmitted by the vehicle SOMEIP protocol meets the requirements of the preset service definition, so as to test whether the vehicle SOMEIP protocol is normal, thereby improving the test efficiency of the vehicle SOMEIP protocol. BRIEF DESCRIPTION OF DRAWINGS
[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0073] Figure 1 The flowchart of the test method of the vehicle SOMEIP protocol in the embodiments of the present application;
[0074] Figure 2 The schematic diagram of the test device of the vehicle SOMEIP protocol in the embodiments of the present application. DETAILED DESCRIPTION
[0075] The embodiment of the present application provides a test method and device of the vehicle-mounted SOMEIP protocol, and solves the technical problem of how to improve the test efficiency of the vehicle-mounted SOMEIP protocol.
[0076] In order to better understand the technical solutions of the present application, the technical solutions of the present application will be described in detail below in combination with the drawings of the specification and specific embodiments.
[0077] As shown in the figure, Figure 1 The test method of the vehicle-mounted SOMEIP protocol of the embodiment comprises the following steps:
[0078] Step S1: obtaining vehicle message data transmitted by the vehicle-mounted SOMEIP protocol based on a preset service definition;
[0079] Step S2: extracting a target service ID, a target method ID under the target service ID, a remote service calling type corresponding to the target method ID, a target client and a target server from the preset service definition;
[0080] Step S3: searching for a message from the vehicle message data based on the remote service calling type, the target service ID, the target method ID, the target client and the target server, and judging whether the vehicle message data is correct according to the message search result and the remote service calling type.
[0081] Part of the preset service definition of the embodiment is shown in Table 1.
[0082] Table 1
[0083]
[0084] The preset service definition defines a service ID of each service of the vehicle, and the service ID of each service is different. The service can include a horn control, a lock control service, a high beam service, a light mode service, and the like. The preset service definition also defines related requirements for communication between the controllers through the vehicle SOMEIP protocol, including a remote service call type (RPC Type), a method ID, a transmission protocol, a client, a server, a Payload length, and the like. Each method ID under the same service ID is different, and the method ID under different service IDs can be the same. The transmission protocol can be UDP or TCP. The controller is a client, which means that the controller is a client. The controller is a server, which means that the controller is a server. Generally, there is only one server. The remote service call type is F&F, which means that the communication mechanism between the controllers is that the client sends a request and the server does not respond. The sender of the request message is the client, and the receiver is the server. The remote service call type is R / R, setter, or getter, which means that the communication mechanism between the controllers is that the client sends a request and the server responds. The sender of the response message is the server, and the receiver is the client. The remote service call type is notifier or event, which means that the communication mechanism between the controllers is that the client subscribes to the server, the server returns a subscription Ack to the client, and the server publishes a message to the client.
[0085] In this embodiment, the vehicle SOMEIP protocol is written based on the preset service definition. Each message transmitted by the vehicle SOMEIP protocol based on the preset service definition can include the content shown in Table 2.
[0086] Table 2
[0087] Service ID Method ID Message Sender Message Receiver Transport Protocol Payload Length
[0088] If the vehicle SOMEIP protocol is normal, the vehicle message data when the vehicle controller communicates through the vehicle SOMEIP protocol based on the preset service definition must satisfy the requirement of the preset service definition. For example, based on the vehicle SOMEIP protocol transmission of Table 1, there must be a request message with a service ID of 0x5011, a method ID of 0x0001, a message sender of controller 1, and a message receiver of controller 2, and the transmission protocol of the request message is UDP, and the Payload length is 1 byte. There must be no response message with a service ID of 0x5011, a method ID of 0x0001, a message sender of controller 2, and a message receiver of controller 1. If the vehicle SOMEIP protocol is abnormal, the vehicle message data when the vehicle controller communicates through the vehicle SOMEIP protocol based on the preset service definition will not satisfy the requirement of the preset service definition. For example, based on the vehicle SOMEIP protocol transmission of Table 1, there is no request message with a service ID of 0x5011, a method ID of 0x0001, a message sender of controller 1, and a message receiver of controller 2 (lack of message); there is the request message, but the transmission protocol of the request message is TCP or the Payload length is not 1 byte (message error); there is the request message and there is a response message with a service ID of 0x5011, a method ID of 0x0001, a message sender of controller 2, and a message receiver of controller 1 (extra message). Therefore, the embodiment is equivalent to judging whether the vehicle message data transmitted by the vehicle SOMEIP protocol satisfies the requirement of the preset service definition, so as to judge whether the vehicle message data is correct, thereby testing whether the vehicle SOMEIP protocol is normal, and improving the test efficiency of the vehicle SOMEIP protocol.
[0089] The embodiment can extract the service ID in Table 1 and the method ID under each service ID one by one. The target service ID is the currently extracted service ID, and the target method ID is the method ID under the currently extracted target service ID. The target service ID and the target method ID are used to find the message from the vehicle message data. The target server of the embodiment is only controller 2, and the target client can be extracted one by one in turn. For example, in the row with a target service ID of 0x5011 and a target method ID of 0x0002, the target client is controller 1 or controller 4.
[0090] Based on the foregoing introduction, step S3 can include:
[0091] If the remote service invocation type is F&F, a first request message with a service ID of the target service ID, a method ID of the target method ID, a message sender of the target client, and a message receiver of the target server is found from the vehicle message data.
[0092] If the first request message is not found, it is determined that the vehicle message data lacks the first request message.
[0093] If the first request message is found, it is determined that the vehicle message data does not lack the first request message, and a first response message with a service ID being the target service ID, a method ID being the target method ID, a message sender being the target server, and a message receiver being the target client is found from the vehicle message data.
[0094] If the first response message is found, it is determined that the vehicle message data has the first response message.
[0095] If the first response message is not found, it is determined that the vehicle message data does not have the first response message.
[0096] The remote service invocation type is F&F, which means that the vehicle message data has a request message but no response message is correct. If the first request message is not found, it means that the target client does not send a request to the target server, and the vehicle SOMEIP protocol is problematic. If the first request message is found, it means that the target client sends a request to the target server, and under the F&F mechanism, there should be no response, but the first response message is found, which means that the target server responds to the request of the target client, and the vehicle SOMEIP protocol is also problematic. In this way, whether the vehicle message data lacks a request message or has an extra response message can be determined through the above steps.
[0097] Of course, if the first request message is found, it can be further determined whether the first request message is correct, and therefore, step S3 can further include: if the first request message is found, a target value of a first target parameter corresponding to the target service ID and the target method ID is extracted from the preset service definition; and if an actual value of the first target parameter in the first request message is different from a target value of the first target parameter in the preset service definition, it is determined that the first request message is incorrect. In this embodiment, the first target parameter can include a transmission protocol and / or a Payload length, for example, the target value of the transmission protocol corresponding to the target service ID-0x5011 and the target method ID-0x0001 is UDP, and the target value of the Payload length is 1 byte. If the transmission protocol in the first request message is TCP, it means that the transmission protocol of the first request message is incorrect. If the Payload length in the first request message is not 1 byte, it means that the Payload length of the first request message is incorrect. In this way, whether the first target parameter of the first request message is correct can be determined through the above steps.
[0098] Step S3 of this embodiment can further include:
[0099] If the remote service invocation type is R / R, setter or getter, a second request message is searched from the vehicle message data, with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target client and the message receiver being the target server;
[0100] If the second request message is not found, it is determined that the vehicle message data lacks the second request message;
[0101] If the second request message is found, it is determined that the vehicle message data does not lack the second request message, and a second response message is searched from the vehicle message data, with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target server and the message receiver being the target client;
[0102] If the second response message is not found, it is determined that the vehicle message data lacks the second response message;
[0103] If the second response message is found, it is determined that the vehicle message data does not lack the second response message.
[0104] The remote service invocation type R / R, setter or getter means that the vehicle message data has a request message and a response message. If the second request message is not found, it means that the target client does not send a request to the target server, and the vehicle SOMEIP protocol is problematic. If the second request message is found, it means that the target client sends a request to the target server, and there should be a response under the R / R, setter or getter mechanism. If the second response message is not found, it means that the target server does not respond to the request of the target client, and the vehicle SOMEIP protocol is also problematic. In this way, the above steps can be used to determine whether the vehicle message data lacks a request message or a response message.
[0105] Of course, if the second request message or the second response message is found, it can be further determined whether the second request message or the second response message is correct, and therefore, step S3 can further include: if the first target message is found, extracting a target value of a second target parameter corresponding to the target service ID and the target method ID from the preset service definition, the first target message being the second request message or the second response message; and if the actual value of the second target parameter in the first target message is different from the target value of the second target parameter in the preset service definition, determining that the first target message is incorrect. In the embodiment, the second target parameter can also include a transmission protocol and / or a Payload length, for example, the transmission protocol target value corresponding to the target service ID-0x5011 and the target method ID-0x0002 is UDP, and the Payload length target value is 1, if the transmission protocol in the first target message is TCP, it means that the transmission protocol of the first target message is incorrect; if the Payload length in the first target message is not 1 byte, it means that the Payload length of the first target message is incorrect. In this way, whether the second target parameter of the second request message and the second response message is correct can be determined through the above steps.
[0106] Step S3 of the embodiment can further include:
[0107] If the remote service invocation type is notifier or event, a subscription message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target client, and the message receiver being the target service end is found from the vehicle message data;
[0108] If the subscription message is not found, it is determined that the vehicle message data lacks the subscription message;
[0109] If the subscription message is found, it is determined that the vehicle message data does not lack the subscription message, a subscription Ack message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target service end, and the message receiver being the target client is found from the vehicle message data;
[0110] If the subscription Ack message is not found, it is determined that the vehicle message data lacks the subscription Ack message;
[0111] If the subscription Ack message is found, it is determined that the vehicle message data does not lack the subscription Ack message, a publication message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target service end, and the message receiver being the target client is found from the vehicle message data;
[0112] If the publication message is not found, it is determined that the vehicle message data lacks the publication message;
[0113] If the publication message is found, it is determined that the vehicle message data does not lack the publication message.
[0114] The remote service call type is notifier or event, which means that there are subscription messages, subscription Ack messages and publishing messages in the vehicle message data. If the subscription message is not found, it means that the target client does not subscribe to the target server, and the vehicle SOMEIP protocol is problematic; if the subscription message is found, it means that the target client subscribes to the target server, and there should be a subscription Ack under the notifier or event mechanism, and if the subscription Ack message is not found, it means that the target server does not feed back the subscription Ack to the target client, and the vehicle SOMEIP protocol is also problematic; if the subscription Ack message is found, it means that the target server feeds back the subscription Ack to the target client, and there should be a publishing message under the notifier or event mechanism, and if the publishing message is not found, it means that the target server does not publish the message to the target client, and the vehicle SOMEIP protocol is also problematic. Thus, whether the subscription message, the subscription Ack message or the publishing message is missing in the vehicle message data can be determined through the above steps.
[0115] Of course, if the subscription message, the subscription Ack message or the publishing message is found, it can be further determined whether the subscription message, the subscription Ack message and the publishing message are correct, and therefore, step S3 can further include: if the second target message is found, extracting a target value of a third target parameter corresponding to the target service ID and the target method ID from the preset service definition, the second target message being the subscription message, the subscription Ack message or the publishing message; if the actual value of the third target parameter in the second target message is different from the target value of the third target parameter in the preset service definition, determining that the second target message is incorrect. In this embodiment, the third target parameter can also include a transmission protocol and / or a Payload length, for example, the transmission protocol target value corresponding to the target service ID-0x5011 and the target method ID-0x0006 is TCP, and the Payload length target value is 8, if the transmission protocol in the second target message is UDP, it means that the transmission protocol of the second target message is incorrect; if the Payload length in the second target message is not 8 bytes, it means that the Payload length of the second target message is incorrect. Thus, whether the third target parameter of the subscription message, the subscription Ack message or the publishing message is correct can be determined through the above steps.
[0116] As shown in Figure 2 , the embodiment also provides a testing device for a vehicle SOMEIP protocol, which comprises:
[0117] an acquisition module, configured to acquire vehicle message data transmitted by a vehicle SOMEIP protocol based on a preset service definition;
[0118] extracting a target service ID, a target method ID under the target service ID, a remote service invocation type corresponding to the target method ID, a target client and a target server from the preset service definition;
[0119] judging whether the vehicle message data is correct based on the remote service invocation type, the target service ID, the target method ID, the target client and the target server.
[0120] Further, the judging module can be further configured to:
[0121] if the remote service invocation type is F&F, searching for a first request message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target client and the message receiver being the target server from the vehicle message data;
[0122] if the first request message is not found, judging that the vehicle message data lacks the first request message;
[0123] if the first request message is found, searching for a first response message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target server and the message receiver being the target client from the vehicle message data;
[0124] if the first response message is found, judging that the vehicle message data has the first response message.
[0125] Further, the judging module can be further configured to:
[0126] if the first request message is found, extracting a target value of a first target parameter corresponding to the target service ID and the target method ID from the preset service definition;
[0127] if the actual value of the first target parameter in the first request message is different from the target value of the first target parameter in the preset service definition, judging that the first request message is incorrect.
[0128] Further, the judging module can be further configured to:
[0129] if the remote service invocation type is R / R, setter or getter, searching for a second request message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target client and the message receiver being the target server from the vehicle message data;
[0130] if the second request message is not found, judging that the vehicle message data lacks the second request message;
[0131] If the second request message is found, a second response message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target server, and the message receiver being the target client is searched from the vehicle message data;
[0132] If the second response message is not found, it is determined that the vehicle message data lacks the second response message.
[0133] Further, the judging module can be further used for:
[0134] If the first target message is found, a target value of a second target parameter corresponding to the target service ID and the target method ID is extracted from the preset service definition, the first target message being the second request message or the second response message;
[0135] If the actual value of the second target parameter in the first target message is different from the target value of the second target parameter in the preset service definition, it is determined that the first target message is incorrect.
[0136] Further, the judging module can be further used for:
[0137] If the remote service invocation type is notifier or event, a subscription message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target client, and the message receiver being the target server is searched from the vehicle message data;
[0138] If the subscription message is not found, it is determined that the vehicle message data lacks the subscription message;
[0139] If the subscription message is found, a subscription Ack message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target server, and the message receiver being the target client is searched from the vehicle message data;
[0140] If the subscription Ack message is not found, it is determined that the vehicle message data lacks the subscription Ack message;
[0141] If the subscription Ack message is found, a publication message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target server, and the message receiver being the target client is searched from the vehicle message data;
[0142] If the publication message is not found, it is determined that the vehicle message data lacks the publication message.
[0143] Further, the judging module can be further used for:
[0144] If the second target message is found, a third target parameter corresponding to the target service ID and the target method ID in the preset service definition is extracted, and the second target message is a subscription message, a subscription Ack message or a publish message;
[0145] If the actual value of the third target parameter in the second target message is different from the target value of the third target parameter in the preset service definition, it is determined that the second target message is incorrect.
[0146] Based on the same inventive concept as the test method of the vehicle SOMEIP protocol described above, the embodiment also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of any method of the test method of the vehicle SOMEIP protocol described above when executing the program.
[0147] The bus architecture (represented by a bus) can include any number of interconnected buses and bridges, which link various circuits including one or more processors represented by a processor and a memory represented by a memory. The bus can also link various other circuits such as peripheral devices, voltage stabilizers and power management circuits, which are well known in the art, and therefore, will not be further described herein. The bus interface provides an interface between the bus and the receiver and the transmitter. The receiver and the transmitter can be the same element, i.e. a transceiver, which provides a unit for communicating with various other devices on a transmission medium. The processor is responsible for managing the bus and general processing, while the memory can be used to store data used by the processor in performing operations.
[0148] Since the electronic device introduced in the embodiment is the electronic device used to implement the test method of the vehicle SOMEIP protocol in the embodiment, based on the test method of the vehicle SOMEIP protocol introduced in the embodiment, those skilled in the art can understand the specific implementation of the electronic device of the embodiment and its various forms, so the implementation of the method in the embodiment by the electronic device will not be described in detail. As long as those skilled in the art implement the electronic device used to implement the test method of the vehicle SOMEIP protocol in the embodiment, it belongs to the scope of the present application.
[0149] Based on the same inventive concept as the test method of the vehicle SOMEIP protocol described above, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program implements any test method of the vehicle SOMEIP protocol when executed by a processor.
[0150] Those skilled in the art will appreciate that embodiments of the present application can be readily used as software, hardware, or a combination of software and hardware. In one
[0151] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks.
[0152] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks.
[0153] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks.
[0154] While preferred embodiments of the application have been described, additional variations and modifications can be made to these embodiments by those skilled in the art once they have the benefit of the foregoing description. Therefore, the appended claims are intended to cover all such variations and modifications as falling within the scope of the application.
[0155] Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A method for testing a vehicle-mounted SOMEIP protocol, characterized in that, The method comprises the following steps: acquiring vehicle message data based on preset service definition of vehicle SOMEIP protocol transmission; extracting target service ID, target method ID under the target service ID, remote service call type corresponding to the target method ID, target client and target server from the preset service definition; based on the remote service call type, the target service ID, the target method ID, the target client and the target server, finding the message from the vehicle message data, and judging whether the vehicle message data is correct according to the message finding result and the remote service call type; wherein, based on the remote service call type, the target service ID, the target method ID, the target client and the target server, finding the message from the vehicle message data, and judging whether the vehicle message data is correct according to the message finding result and the remote service call type, comprising: if the remote service call type is F&F, find the first request message with service ID as the target service ID, method ID as the target method ID, message sender as the target client and message receiver as the target server from the vehicle message data; if the first request message is not found, it is judged that the vehicle message data lacks the first request message; if the first request message is found, find the first response message with service ID as the target service ID, method ID as the target method ID, message sender as the target server and message receiver as the target client from the vehicle message data; if the first response message is found, it is judged that the vehicle message data has the first response message.
2. The method of claim 1, wherein, Based on the remote service call type, the target service ID, the target method ID, the target client and the target server, finding the message from the vehicle message data, and judging whether the vehicle message data is correct according to the message finding result and the remote service call type, further comprising: if the first request message is found, extract the target value of the first target parameter corresponding to the target service ID and the target method ID from the preset service definition; if the actual value of the first target parameter in the first request message is different from the target value of the first target parameter in the preset service definition, it is judged that the first request message is incorrect.
3. The method of claim 1, wherein the SOMEIP protocol is a test method for a vehicle. Based on the remote service call type, the target service ID, the target method ID, the target client and the target server, finding the message from the vehicle message data, and judging whether the vehicle message data is correct according to the message finding result and the remote service call type, further comprising: if the remote service call type is R / R, setter or getter, find the second request message with service ID as the target service ID, method ID as the target method ID, message sender as the target client and message receiver as the target server from the vehicle message data; If the second request message is not found, it is determined that the vehicle message data lacks the second request message; If the second request message is found, a second response message with a service ID of the target service ID, a method ID of the target method ID, a message sender of the target service end, and a message receiver of the target client is searched from the vehicle message data; If the second response message is not found, it is determined that the vehicle message data lacks the second response message.
4. The method of claim 3, wherein the SOMEIP protocol is tested by, The method further includes: If the first target message is found, a target value of a second target parameter corresponding to the target service ID and the target method ID is extracted from the preset service definition, the first target message being the second request message or the second response message; If the actual value of the second target parameter in the first target message is different from the target value of the second target parameter in the preset service definition, it is determined that the first target message is incorrect.
5. The method of claim 1, wherein the SOMEIP protocol is a test method for a vehicle. The method further includes: If the remote service call type is notifier or event, a subscription message with a service ID of the target service ID, a method ID of the target method ID, a message sender of the target client, and a message receiver of the target service end is searched from the vehicle message data; If the subscription message is not found, it is determined that the vehicle message data lacks the subscription message; If the subscription message is found, a subscription Ack message with a service ID of the target service ID, a method ID of the target method ID, a message sender of the target service end, and a message receiver of the target client is searched from the vehicle message data; If the subscription Ack message is not found, it is determined that the vehicle message data lacks the subscription Ack message; If the subscription Ack message is found, a publish message with a service ID of the target service ID, a method ID of the target method ID, a message sender of the target service end, and a message receiver of the target client is searched from the vehicle message data; If the publish message is not found, it is determined that the vehicle message data lacks the publish message.
6. The method of claim 5, wherein the SOMEIP protocol is tested for a vehicle. The method further includes: If the second target message is found, a third target value of a third target parameter corresponding to the target service ID and the target method ID is extracted from the preset service definition, the second target message being the subscription message, the subscription Ack message or the publishing message; If the actual value of the third target parameter in the second target message is different from the target value of the third target parameter in the preset service definition, it is determined that the second target message is incorrect.
7. A testing device for a SOMEIP protocol on board a vehicle, characterized in that The method comprises: The acquisition module is configured to acquire vehicle message data transmitted based on a preset service definition of a vehicle-mounted SOMEIP protocol; The extraction module is configured to extract a target service ID, a target method ID under the target service ID, a remote service invocation type corresponding to the target method ID, a target client and a target server from the preset service definition; The judgment module is configured to find a message from the vehicle message data based on the remote service invocation type, the target service ID, the target method ID, the target client and the target server, and determine whether the vehicle message data is correct according to a message finding result and the remote service invocation type; wherein the finding of the message from the vehicle message data based on the remote service invocation type, the target service ID, the target method ID, the target client and the target server, and the determination of whether the vehicle message data is correct according to the message finding result and the remote service invocation type comprises: if the remote service invocation type is F&F, finding a first request message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target client and the message receiver being the target server from the vehicle message data; if the first request message is not found, determining that the vehicle message data lacks the first request message; if the first request message is found, finding a first response message with the service ID being the target service ID, the method ID being the target method ID, the message sender being the target server and the message receiver being the target client from the vehicle message data; and if the first response message is found, determining that the vehicle message data has the first response message.
8. An electronic device, comprising: The computer readable storage medium stores a computer program, and the computer program, when executed by the processor, implements the test method of the vehicle-mounted SOMEIP protocol according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program, when executed by the processor, implements the test method of the vehicle-mounted SOMEIP protocol according to any one of claims 1-6.
Citation Information
Patent Citations
SOME / IP protocol-based communication data anomaly detection method and system
CN113992344A