Interface test method, device and medium for vehicle-mounted ethernet
Patent Information
- Application Number
- CN202510684315.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-05-26
AI Technical Summary
在当前的测试框架下,存在着测试用例开发周期长,测试用例执行时间长;并且以太网接口需求的配置文件,在每一次发生变更时,其中的以太网信号定义的名称、属性等内容会发生变化,目前主要靠人为识别,并手动修改相关的测试序列,存在测试序列遗漏、测试序列不全以及耗时长等问题
[0033]本申请实施例至少包括以下有益效果:本申请提供一种车载以太网的接口测试方法、装置及介质,该方案通过解析以太网的第一配置文件,提取出报文属性和以太网信号信息,并将其写入对应的第一写入区域中的第一写入单元中,将以太网信号信息作为检索条件,在第二配置文件中提取对应的接口信号信息,以将以太网信号信息与接口信号信息相匹配,避免测试用例中导致存在测试序列遗漏或不全的问题;根据匹配的以太网信号信息与接口信号信息,确定用于写入接口信号信息的第二写入单元,第一写入区域与第二写入区域相对应,遍历所有匹对的第一写入区域和第二写入区域,生成以太网信号与接口信号对应的的接口测试用例,根据接口测试用例进行测试,得到测试结果,以有效降低了测试周期,并且提高了有效问题检测的检测率和测试效率,提升了域控制器的测试门槛和接口测试的广泛性。
Smart Images

Figure CN120658641B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and in particular to a method, apparatus and medium for testing the interface of in-vehicle Ethernet. Background Technology
[0002] In existing technologies, Ethernet interface testing is mostly conducted through hardware-in-the-loop simulation systems, using test sequences. This current testing framework suffers from long test case development cycles and execution times. Furthermore, the Ethernet interface requirement configuration files change with each modification, altering the names and attributes of Ethernet signals. Currently, this relies primarily on manual identification and modification of test sequences, leading to issues such as missing or incomplete test sequences and excessive time consumption. Summary of the Invention
[0003] The main objective of this application is to provide a method, apparatus, and medium for testing the interface of in-vehicle Ethernet, so as to improve testing efficiency.
[0004] To achieve the above objectives, one aspect of this application provides an interface testing method for in-vehicle Ethernet, the method comprising: parsing a first configuration file of the in-vehicle Ethernet, and extracting the message attributes of the in-vehicle Ethernet and the Ethernet signal information corresponding to the message attributes;
[0005] Based on the message attributes and the Ethernet signal information, a first writing unit is determined in the first writing area, and the Ethernet signal information is written to the first writing unit accordingly.
[0006] The second configuration file of the vehicle Ethernet is parsed, and the interface signal information corresponding to the Ethernet signal information is extracted based on the Ethernet signal information.
[0007] Based on the message attributes and the interface signal information, a second write unit is determined in the second write area, and the interface signal information is written to the second write unit accordingly; wherein, the first write area corresponds to the second write area.
[0008] Iterate through all matched first and second write regions to generate interface test cases.
[0009] In some embodiments, extracting the packet attributes of the vehicular Ethernet and the Ethernet signal information corresponding to the packet attributes includes:
[0010] Based on the universally unique identifier of the Ethernet packet in the first configuration file, the packet attributes of the Ethernet packet are parsed to obtain the packet attributes.
[0011] Based on the universally unique identifier, determine the Ethernet-defined signal node corresponding to the message attribute and the first signal name under the signal node;
[0012] Based on the universally unique identifier, the Ethernet packet is parsed to obtain the transmission information of the Ethernet signal corresponding to the packet attributes, and a transmission test value is generated.
[0013] The Ethernet signal information is formed based on the first signal name, the transmission information, and the transmission test value.
[0014] In some embodiments, determining the first write unit in the first write area based on the message attributes and the Ethernet signal information includes:
[0015] The first writing area is determined based on the message attributes and the extraction order of the message attributes;
[0016] Obtain the first write identifier of the first write unit in the first write area, match the first write identifier with the Ethernet signal information, and determine the first write unit corresponding to the Ethernet signal information being written.
[0017] In some embodiments, the Ethernet signal information includes a first signal name, transmission information, and transmission test values; extracting the interface signal information corresponding to the Ethernet signal information includes:
[0018] Using the first signal name as the search condition, extract the second signal name corresponding to the first signal name from the second configuration file;
[0019] Based on the transmission information, determine the interaction attributes of the second signal name;
[0020] Using the first signal name as the search condition, and based on the transmission test value, the retrieved interface test value is written.
[0021] The interface signal information is formed based on the second signal name, the interaction attribute, and the interface test value.
[0022] In some embodiments, determining the second write unit in the second write region based on the message attributes and the interface signal information includes:
[0023] Based on the message attributes and the interface signal information, determine the second write area corresponding to the first write area;
[0024] Based on the second write identifier of the second write unit in the second write area, the second write identifier is matched with the interface signal information to determine the second write unit corresponding to the interface signal information.
[0025] In some embodiments, the message attributes include receive attributes and send attributes; determining the first write area based on the message attributes and the extraction order of the message attributes includes:
[0026] When the message attribute is the receiving attribute and the extraction order is the Nth extraction, then the first writing area is the Nth input area.
[0027] In some embodiments, determining the first write area based on the message attributes and the extraction order of the message attributes includes:
[0028] When the message attribute is the sending attribute and the extraction order is the Nth extraction, then the first writing area is the Nth output area.
[0029] In some embodiments, the interface signal information includes interaction attributes. Determining the second write region corresponding to the first write region based on the message attributes and the interface signal information includes:
[0030] Based on the message attributes and the interaction attributes, the attribute position of the second write area is determined, and the sequential position of the second write area is consistent with the sequential position of the first write area.
[0031] To achieve the above objectives, another aspect of this application provides a vehicle control device, including a memory, a processor, and a program stored in the memory and executable on the processor. When the program is executed by the processor, it implements the above-described in-vehicle Ethernet interface testing method.
[0032] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described interface testing method for in-vehicle Ethernet.
[0033] The embodiments of this application include at least the following beneficial effects: This application provides a method, apparatus, and medium for testing the interface of automotive Ethernet. This scheme parses the first configuration file of Ethernet, extracts message attributes and Ethernet signal information, and writes them into the first writing unit of the corresponding first writing area. Using the Ethernet signal information as a retrieval condition, the corresponding interface signal information is extracted from the second configuration file to match the Ethernet signal information with the interface signal information, avoiding the problem of test sequence omissions or incompleteness in test cases. Based on the matched Ethernet signal information and interface signal information, a second writing unit for writing interface signal information is determined. The first writing area corresponds to the second writing area. All matched first and second writing areas are traversed to generate interface test cases corresponding to Ethernet signals and interface signals. Tests are performed according to the interface test cases to obtain test results, which effectively reduces the test cycle and improves the detection rate and test efficiency of effective problem detection, thereby raising the test threshold of domain controllers and the breadth of interface testing. Attached Figure Description
[0034] Figure 1 This is a flowchart of the interface testing method for in-vehicle Ethernet provided in the embodiments of this application;
[0035] Figure 2 This is a schematic diagram of the storage area framework when writing Ethernet signal information in the interface testing method for vehicle Ethernet provided in this application embodiment;
[0036] Figure 3 This is a schematic diagram of the hardware structure framework of the vehicle control device provided in the embodiments of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0038] It is understood that the terms "first," "second," etc., used in this application may be used to describe various concepts herein, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of embodiments of this application, Ethernet signaling information may also be referred to as interface signaling information, and similarly, interface signaling information may also be referred to as Ethernet signaling information. Depending on the context, the words "if" or "when" as used herein may be interpreted as "when," "in response to a determination," or "in the event of a determination."
[0039] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0041] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0042] UUID stands for Universally Unique Identifier, and its purpose is to provide unique identification information for all elements in a distributed system.
[0043] ARXML files are XML file formats in the AUTOSAR standard, used to describe the software architecture and configuration information of automotive electronic software systems. They are a type of universal configuration / database file.
[0044] A MAP (Mapping File) is a file used to describe address mappings, storage allocations, or configuration information.
[0045] In some embodiments of one aspect of the present invention Figure 1 This is an optional flowchart of the interface testing method for in-vehicle Ethernet provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S100 to S500.
[0046] Step S100: Parse the first configuration file of the vehicle Ethernet and extract the message attributes of the vehicle Ethernet and the Ethernet signal information corresponding to the message attributes.
[0047] Step S200: Based on the message attributes and Ethernet signal information, determine the first write unit in the first write area, and write the Ethernet signal information to the first write unit accordingly.
[0048] Step S300: Parse the second configuration file of the vehicle Ethernet and extract the interface signal information corresponding to the Ethernet signal information based on the Ethernet signal information.
[0049] Step S400: Based on the message attributes and interface signal information, determine the second write unit in the second write area, and write the interface signal information to the second write unit accordingly; wherein, the first write area corresponds to the second write area.
[0050] Step S500: Traverse all matched first and second write regions to generate interface test cases.
[0051] Steps S100 to S500, as illustrated in this embodiment, involve parsing the first Ethernet configuration file to extract message attributes and Ethernet signal information, and writing them into the first write unit of the corresponding first write area. Using the Ethernet signal information as a retrieval condition, corresponding interface signal information is extracted from the second configuration file to match the Ethernet signal information with the interface signal information, thus avoiding omissions or incompleteness in test sequences during test cases. Based on the matched Ethernet signal information and interface signal information, a second write unit for writing interface signal information is determined. The first write area corresponds to the second write area. All matched first and second write areas are traversed to generate interface test cases corresponding to the Ethernet signal and the interface signal. Tests are performed based on the interface test cases to obtain test results. This effectively reduces the test cycle, improves the detection rate and efficiency of effective problem detection, and raises the testing threshold for domain controllers and the breadth of interface testing.
[0052] In some embodiments of S100, a first configuration file of the vehicle-mounted Ethernet is obtained, the first configuration file is parsed, and the message attributes of the Ethernet packets are extracted. Based on the message attributes, the corresponding Ethernet signal information is retrieved from the first configuration file.
[0053] In other words, the first configuration file of the vehicle Ethernet is parsed, the Ethernet packets in the first configuration file are used to determine the transmission and reception attributes of the Ethernet packets, and the corresponding input and output Ethernet signal information is determined based on the transmission and reception attributes of the packets.
[0054] The first configuration file is an ARXML file. Message attributes include: sending attributes and receiving attributes. Ethernet signal information includes: first signal name, transmission information, and transmission test values. Transmission information includes: signal value, signal type, signal length, message ID, transmit / receive type, and transmit / receive period.
[0055] In some embodiments of S200, a first write area is determined based on the transmit and receive attributes of the Ethernet packet, and a first write unit for writing Ethernet signal information is determined based on the Ethernet signal information in the first write area, and the Ethernet signal information is written into the first write unit accordingly.
[0056] The first write area can be a write area of a memory, a write area of a spreadsheet, or a buffer for temporary data storage. In this application, no specific restrictions are placed on the specific application of the write area.
[0057] Correspondingly, the first writing unit can be a writing unit of the writing area of the memory, corresponding to one or more addresses of the memory, or a writing cell of the writing area of a spreadsheet, or a storage unit of a buffer for temporary data storage. In this application, no specific application is restricted to the writing unit used to store or update Ethernet signal information.
[0058] In some embodiments of S300, a second configuration file of the vehicle Ethernet is obtained, the second configuration file is parsed, and the Ethernet signal information is used as a retrieval condition to extract interface signal information that matches the input and output of the Ethernet signal information.
[0059] The second configuration file is a map file. The interface signal information includes: the second signal name, interaction attributes, and interface test values.
[0060] In some embodiments of S400, based on the first write area determined in S200 and the interface signal information that matches the Ethernet signal information in S300, the second write area is determined by the first write area determined by the message attributes. For the Ethernet signal information and interface signal information that match each other, the first write area and the second write area correspond to each other in the write area, which is an input-output correspondence.
[0061] Based on the interface signal information, a second writing unit for writing interface signal information is determined in the second writing area, and the interface signal information is written to the second writing unit accordingly.
[0062] The second write area can be a write area of a memory, a write area of a spreadsheet, or a buffer for temporary data storage. In this application, no specific restrictions are placed on the specific application of the write area.
[0063] Correspondingly, the second writing unit can be a writing unit of the writing area of the memory, corresponding to one or more addresses of the memory, or a writing cell of the writing area of a spreadsheet, or a storage unit of a buffer for temporary data storage. In this application, no specific application is restricted to the writing unit used to store or update Ethernet signal information.
[0064] In some embodiments of S500, S400 has already completed the matching and correspondence of all Ethernet signal information and all interface signal information. Based on each matched pair of Ethernet signal information and interface signal information, interface test cases are generated.
[0065] Configure an automated testing environment, execute interface test cases, and obtain test results.
[0066] The automated testing environment includes: power supply, host computer and software, CAN communication equipment, and the controller under test.
[0067] In one embodiment, each pair of matched Ethernet signal information and interface signal information is used as input to generate a test case script. Based on the set test requirements, input signal values are selected from the Ethernet signal information or interface signal information. Each signal value is used as input to generate a test case. Test cases can be generated by selecting specific signals based on user responses or by enumerating input signal values. Based on the selected input signal value, the corresponding expected output value is selected from the Ethernet signal information or interface signal information and written into the expected result verification section of the generated test case. The output format of the test results is defined, including a comparison between the expected output value and the actual value, as well as the overall test results.
[0068] In some embodiments of the present invention, S100, the process of extracting message attributes and Ethernet signal information corresponding to the message attributes includes:
[0069] S110: Based on the universally unique identifier of the Ethernet packet in the first configuration file, the packet attributes of the Ethernet packet are parsed.
[0070] S120, based on the universally unique identifier, determines the signal node corresponding to the Ethernet definition of the message attributes and the first signal name under the signal node.
[0071] S130 parses Ethernet packets based on the universally unique identifier to obtain the transmission information of Ethernet signals corresponding to the packet attributes and generates transmission test values.
[0072] S140: Based on the first signal name, transmission information, and transmission test values, Ethernet signal information is generated.
[0073] In some embodiments of S110, the Ethernet packets in the first configuration file are parsed, and the packet attributes of the Ethernet packets are identified and extracted based on the unique attribute UUID of the Ethernet packets, i.e., the universally unique identifier.
[0074] The message attributes include the receiver attribute and the sender attribute, which are the receiving attribute and the sending attribute, respectively.
[0075] For example, the Ethernet packets in the ARXML file are parsed, and the receiver and sender attributes of the Ethernet packets are identified and extracted based on the unique UUID attribute of the Ethernet packets.
[0076] In some embodiments of S120, the Ethernet signal node definition is determined based on a universally unique identifier, and the signal name under the signal node, i.e., the first signal name, is determined, as well as the basic attributes related to the signal.
[0077] Based on the characteristics of the universally unique identifier, the message attributes and the first signal name under the same universally unique identifier can correspond to each other.
[0078] For example, the Ethernet packet in the ARXML file is parsed, and the definition of the Ethernet type node and the signal name and related attributes of the signal node, such as the transmission type, are found based on the unique attribute UUID of the Ethernet packet.
[0079] In some embodiments of S130, the Ethernet message is parsed using a universally unique identifier to obtain the signal value, signal type, and signal length of the Ethernet signal. The signal value, signal type, and signal length are all transmission information of the Ethernet signal.
[0080] The transmitted information may also include other attributes or data, which are not limited in this application.
[0081] Based on the Ethernet packets parsed from the ARXML file, test input and output values are generated to obtain the transmission test values.
[0082] In one embodiment, the transmission and reception period, transmission and reception method, and message ID of the parsed Ethernet message are also used as transmission information so that they can be recorded and written to the first writing unit.
[0083] Based on the characteristics of the universally unique identifier, the message attributes and transmission information under the same universally unique identifier can correspond to each other.
[0084] For example, based on the Ethernet packet's unique UUID attribute, the Ethernet packet is parsed to obtain the Ethernet signal value, signal type, and signal length. Based on the parsed ARXML file of the Ethernet packet, test input and output values are generated to obtain the transmission test values.
[0085] In some embodiments of S140, Ethernet signal information is formed by combining the transmission test value, transmission information and first signal name determined in S110 to S130.
[0086] Through the above embodiments, by automatically identifying and parsing ARXML files and automatically identifying change points, the amount of manual operation is reduced, effectively shortening the testing cycle.
[0087] In some embodiments of the present invention, S200, the writing process of the first writing unit includes:
[0088] S210, determine the first write area based on the message attributes and the order in which the message attributes are extracted.
[0089] S220: Obtain the first write identifier of the first write unit in the first write area, match the first write identifier with the Ethernet signal information, and determine the first write unit corresponding to the Ethernet signal information being written.
[0090] In some embodiments of S210, as can be seen from S110, the message attributes include: receiver attribute and sender attribute. That is, receive attribute and send attribute.
[0091] Based on the message attributes and the extraction order of the message attributes, it is determined which number the current Ethernet signal is extracted from, and whether it belongs to the receiver attribute or the sender attribute, thereby confirming the first write area where the Ethernet signal information is written.
[0092] The first write region has multiple first write units.
[0093] In one embodiment, if the current Ethernet signal belongs to the receiving attribute and is the first one extracted, then the first write area is the first input area; if the current Ethernet signal belongs to the receiving attribute and is the Nth one extracted, then the first write area is the Nth input area.
[0094] In one embodiment, if the current Ethernet signal belongs to the transmission attribute and is the first one extracted, then the first write area is the first output area; if the current Ethernet signal belongs to the transmission attribute and is the Nth one extracted, then the first write area is the Nth output area.
[0095] For example, refer to Figure 2When the write area is the write area of the memory, the write area of the memory is divided into N output areas and N input areas. Each output area and each input area has multiple write units, and the output areas correspond to the input areas. If the current Ethernet signal belongs to the receive attribute and is the first one extracted, then the address of the first input area in the write area of the memory is obtained. This first input area is the first write area for the current Ethernet signal. If the current Ethernet signal belongs to the transmit attribute and is the second one extracted, then the address of the second output area in the write area of the memory is obtained. The second output area is used as the first write area. However, this is not the address of the first output area. The address of the first output area is used for subsequent corresponding interface signal information writing, and so on, until all Ethernet information is written. By using the area address, it is convenient to quickly locate and write signal information later.
[0096] For example, refer to Figure 2 When the write area is the write area of a spreadsheet, the spreadsheet has N output rows and N input rows. Each output row and each input row has multiple write cells, and the output areas correspond to the input areas. If the current Ethernet signal belongs to the receive attribute and is the first one extracted, then the first input row is the first write area for writing the current Ethernet signal; if the current Ethernet signal belongs to the transmit attribute and is the second one extracted, then the second output row is the first write area for writing the current Ethernet signal. Note that the address of the first output row is not the address of the first output row; the address of the first output row is used for writing the corresponding interface signal information subsequently, and so on, until all Ethernet information is written.
[0097] In some embodiments of S220, the first write area has multiple first write units, and the Ethernet signal information is written to the first write unit according to the correspondence between the first write identifier of the first write unit and the Ethernet signal information.
[0098] The first write identifier can be a storage address identifier in memory, a row or column field in a spreadsheet, or a cache address identifier in a buffer that temporarily stores data. In this application, no specific restrictions are placed on the specific application of the write identifier.
[0099] For example, refer to Figure 2When the write area is the write area of the memory, if the current Ethernet signal belongs to the receiving attribute and is the first one extracted, then the address of the first input area in the write area of the memory is obtained. This first input area is the first write area where the current Ethernet signal is written. According to the storage address identifier of the write unit in the first input area, the first write unit corresponding to the first signal name in the current Ethernet signal information is determined through the correspondence with the Ethernet signal information, the first write unit corresponding to the signal value in the current Ethernet signal information is determined, and so on, the current Ethernet signal information is written to the first write area.
[0100] For example, refer to Figure 2 When the write area is the write area of a spreadsheet, if the current Ethernet signal belongs to the receiving attribute and is the first one extracted, then the first row input area is the first write area for writing the current Ethernet signal; based on the corresponding row and column fields in the first row input area, through the correspondence with the Ethernet signal information, the first write unit corresponding to the first signal name in the current Ethernet signal information is determined, the first write unit corresponding to the signal value in the current Ethernet signal information is determined, and so on, the current Ethernet signal information is written to the first write area.
[0101] In some embodiments of the present invention, S300, the process of extracting interface signal information includes:
[0102] S310, using the first signal name as the search condition, extract the second signal name corresponding to the first signal name from the second configuration file.
[0103] S320, based on the transmitted information, determine the interaction attributes of the second signal name.
[0104] S330 uses the first signal name as the search condition and writes the retrieved interface test value according to the transmission test value.
[0105] S340 generates interface signal information based on the second signal name, interaction attributes, and interface test values.
[0106] In some embodiments of S310, based on Ethernet signal information and a second configuration file, the first signal name of the parsed Ethernet signal is used as a retrieval condition to extract and retrieve the second signal name containing the first signal name field from the second configuration file.
[0107] The second signal name is the internal interface name.
[0108] For example, based on Ethernet signal information and a MAP file, the first signal name of the parsed Ethernet signal is used as the search condition to extract and search for the second signal name containing the first signal name field in the MAP file.
[0109] In some embodiments of S320, the interaction attribute corresponding to the second signal name is determined based on the input / output attributes of the Ethernet signal in the search criteria.
[0110] The interaction attributes include output attributes and input attributes. Since they are based on the same UUID, the input and output attributes of Ethernet signals correspond to the message attributes of Ethernet packets.
[0111] In one embodiment, the interaction attribute corresponding to the second signal name is determined based on the transmit / receive type, i.e., input / output attribute, in the transmission information of the Ethernet signal in the search criteria.
[0112] For example, when the Ethernet signal in the search criteria is an input attribute, the interaction attribute of the retrieved interface signal is an output attribute, and the interface signal is the output; when the Ethernet signal in the search criteria is an output attribute, the interaction attribute of the retrieved interface signal is an input attribute, and the interface signal is the input.
[0113] In some embodiments of S330, the first signal name is used as the retrieval condition. The transmission test value generated by parsing the first configuration file in S100, i.e., the test input value or the test output value, is written into the second configuration file to retrieve the interface signal input and output values, i.e., the interface test values.
[0114] For example, the test input or test output values generated by parsing the ARXML file in S100 are written into the interface signal input or output values retrieved in the MAP file.
[0115] In some embodiments of S340, interface signal information is formed by combining the second signal name, interaction attribute, and interface test value determined in S310 to S330.
[0116] The interface signal information may also include information about other interface signals. This application does not limit the specific type of interface signal information.
[0117] Through the above embodiments, by using Ethernet signal information as the retrieval condition, the information of the corresponding interface signal is retrieved to achieve one-to-one matching, thereby avoiding problems such as test sequence omission, incomplete test sequences, and long processing time.
[0118] In some embodiments of one aspect of the present invention, S400, the writing process of the second writing unit includes:
[0119] S410 determines the second write area corresponding to the first write area based on the message attributes and interface signal information.
[0120] S420: Based on the second write identifier of the second write unit in the second write area, match the second write identifier with the interface signal information to determine the second write unit corresponding to the interface signal information.
[0121] In some embodiments of S410, as can be seen from S320, since they are based on the same UUID, the message attributes of the Ethernet packet and the input / output attributes of the Ethernet signal are consistent, and the input / output attributes of the Ethernet signal correspond to the interaction attributes of the interface signal. That is, if the Ethernet signal is the input, then the interface signal is the output; if the Ethernet signal is the output, then the interface signal is the input.
[0122] In one embodiment, the attribute position of the second write area is determined by the transmit / receive attributes of the Ethernet signal and the interaction attributes in the interface signal information, as determined by the message attributes. The write order position of the second write area is determined by the correspondence between the first and second write areas, thus defining the second write area. The positions of the first and second write areas correspond to each other, representing an input-output correspondence.
[0123] In other words, the attribute position of the second write area is determined by the send / receive attribute of the message attribute and the input / output attribute of the interaction attribute. Then, the writing order position of the second write area is determined by the order position of the first write area, thereby determining the writing position of the second write area.
[0124] For example, based on the matching Ethernet signals and interface signals of S300, when the message attribute is a receive attribute, that is, the first write area is an input area, and the interaction attribute of the interface signal is an output attribute, the interface signal is written as an output to the output area, that is, the second write area is an output area. According to the first write area, if the first write area is the first input area, then the second write area is the first output area.
[0125] For example, based on the matching Ethernet signals and interface signals of S300, when the message attribute is a transmission attribute, that is, the first write area is an output area, and the interaction attribute of the interface signal is an input attribute, the interface signal is written as input to the input area, that is, the second write area is an input area. According to the first write area, if the first write area is the Nth output area, then the second write area is the Nth input area.
[0126] In some embodiments of S420, the second write area has multiple second write units, and the interface signal information is written to the second write unit according to the correspondence between the second write identifier of the second write unit and the interface signal information.
[0127] The second write identifier can be a storage address identifier in memory, a row or column field in a spreadsheet, or a cache address identifier in a buffer for temporary data storage. In this application, no specific restrictions are placed on the specific application of the write identifier.
[0128] For example, when the write area is the write area of the memory, if the second write area of the current interface signal information is determined to be the first output area by S410; according to the storage address identifier of the write unit in the first output area, the second write unit corresponding to the second signal name in the current interface signal information is determined by the correspondence with the interface signal information, the second write unit corresponding to the interface test value in the current interface signal information is determined, and so on, and the current interface signal information is written to the second write area.
[0129] For example, when the writing area is the writing area of a spreadsheet, if it is determined by S410 that the second writing area of the current interface signal information is the Nth input area, then the Nth row input area is the second writing area for writing the current interface signal; based on the corresponding row and column fields in the Nth row input area, through the correspondence with the Ethernet signal information, the second writing unit corresponding to the second signal name in the current Ethernet signal information, the second writing unit corresponding to the interface test value in the current interface signal information, and so on, the current interface signal information is written to the second writing area.
[0130] The above embodiments aim to improve testing efficiency and prevent test cases from being missed due to changes in Ethernet signals.
[0131] Another embodiment of this application provides a vehicle control device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned in-vehicle Ethernet interface testing method. This vehicle control device can be any smart terminal, including a tablet computer, an in-vehicle computer, or similar device.
[0132] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0133] Please see Figure 3 , Figure 3 The hardware structure of a vehicle control device according to another embodiment is illustrated. The vehicle control device includes:
[0134] The processor can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solutions provided in the embodiments of this application.
[0135] The memory can be implemented in the form of read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory and called by the processor to execute the in-vehicle Ethernet interface testing method of the embodiments of this application.
[0136] Input / output interfaces are used to implement information input and output;
[0137] The communication interface is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0138] A bus is used to transfer information between various components of a device, such as processors, memory, input / output interfaces, and communication interfaces.
[0139] The processor, memory, input / output interfaces, and communication interfaces communicate with each other within the device via a bus.
[0140] This invention also provides a vehicle, including the in-vehicle Ethernet interface testing method described in the above embodiments.
[0141] The vehicle can be a private car, such as a sedan, SUV, MPV, or pickup truck. It can also be a commercial vehicle, such as a van, bus, small truck, or large semi-trailer. The vehicle must have an electric motor capable of outputting power or acting as a generator to store mechanical energy. When the vehicle is a new energy vehicle, it can be a hybrid or a pure electric vehicle.
[0142] Since the vehicle applies all the technical solutions of the above-described vehicle control device, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.
[0143] Another embodiment of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described interface testing method for in-vehicle Ethernet.
[0144] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0145] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0146] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0147] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0148] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0149] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0150] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0151] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0152] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0153] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0154] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for testing the interface of an in-vehicle Ethernet system, characterized in that, The method includes: The first configuration file of the vehicle Ethernet is parsed to extract the packet attributes of the vehicle Ethernet and the Ethernet signal information corresponding to the packet attributes; Based on the message attributes and the Ethernet signal information, a first writing unit is determined in the first writing area, and the Ethernet signal information is written to the first writing unit accordingly. The second configuration file of the vehicle Ethernet is parsed, and the interface signal information corresponding to the Ethernet signal information is extracted based on the Ethernet signal information. Based on the message attributes and the interface signal information, a second write unit is determined in the second write area, and the interface signal information is written to the second write unit accordingly; wherein, the first write area corresponds to the second write area. Traverse all matched first and second write regions to generate interface test cases; The step of determining the first write unit in the first write area based on the message attributes and the Ethernet signal information includes: The first writing area is determined based on the message attributes and the extraction order of the message attributes; Obtain the first write identifier of the first write unit in the first write area, match the first write identifier with the Ethernet signal information, and determine the first write unit corresponding to the Ethernet signal information being written. The step of determining the second write unit in the second write area based on the message attributes and the interface signal information includes: Based on the message attributes and the interface signal information, determine the second write area corresponding to the first write area; Based on the second write identifier of the second write unit in the second write area, the second write identifier is matched with the interface signal information to determine the second write unit corresponding to the interface signal information. The step of traversing all matched first and second write regions to generate interface test cases includes: The input for generating test case scripts is based on each pair of matched Ethernet signal information and interface signal information; Based on the testing requirements, select input signal values from Ethernet signal information or interface signal information, and use each signal value as an input to generate a test case. Based on the selected input signal value, select the corresponding expected output value from the Ethernet signal information or interface signal information, and write it into the expected result verification section of the production test case. Define the output format for the test results, which includes a comparison between the expected output value and the actual value, as well as the overall test results.
2. The interface testing method according to claim 1, characterized in that, The extraction of the message attributes of the vehicle Ethernet and the corresponding Ethernet signal information includes: Based on the universally unique identifier of the Ethernet packet in the first configuration file, the packet attributes of the Ethernet packet are parsed to obtain the packet attributes. Based on the universally unique identifier, determine the Ethernet-defined signal node corresponding to the message attribute and the first signal name under the signal node; Based on the universally unique identifier, the Ethernet packet is parsed to obtain the transmission information of the Ethernet signal corresponding to the packet attributes, and a transmission test value is generated. The Ethernet signal information is formed based on the first signal name, the transmission information, and the transmission test value.
3. The interface testing method according to claim 1, characterized in that, The Ethernet signal information includes a first signal name, transmission information, and transmission test values; the extraction of interface signal information corresponding to the Ethernet signal information includes: Using the first signal name as the search condition, extract the second signal name corresponding to the first signal name from the second configuration file; Based on the transmission information, determine the interaction attributes of the second signal name; Using the first signal name as the search condition, and based on the transmission test value, the retrieved interface test value is written. The interface signal information is formed based on the second signal name, the interaction attribute, and the interface test value.
4. The interface testing method according to claim 1, characterized in that, The message attributes include receiving attributes and sending attributes; determining the first write area based on the message attributes and the extraction order of the message attributes includes: When the message attribute is the receiving attribute and the extraction order is the Nth extraction, then the first writing area is the Nth input area.
5. The interface testing method according to claim 4, characterized in that, Determining the first write area based on the message attributes and the extraction order of the message attributes includes: When the message attribute is the sending attribute and the extraction order is the Nth extraction, then the first writing area is the Nth output area.
6. The interface testing method according to claim 1, characterized in that, The interface signal information includes interaction attributes. Based on the message attributes and the interface signal information, determining the second write area corresponding to the first write area includes: Based on the message attributes and the interaction attributes, the attribute position of the second write area is determined, and the sequential position of the second write area is consistent with the sequential position of the first write area.
7. A vehicle control device, characterized in that, It includes a memory, a processor, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the interface testing method for in-vehicle Ethernet as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the interface testing method for vehicle Ethernet as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Vehicle-mounted Ethernet protocol conformance test method and device, and related equipment
CN115102888A
On vehicle network central control unit and its managing and controlling method for on-vehicle network
CN1719782A