CN109327354B - Method, device and test system for generating signal forwarding test case - Google Patents

Method, device and test system for generating signal forwarding test case Download PDF

Info

Publication number
CN109327354B
CN109327354B CN201811157784.3A CN201811157784A CN109327354B CN 109327354 B CN109327354 B CN 109327354B CN 201811157784 A CN201811157784 A CN 201811157784A CN 109327354 B CN109327354 B CN 109327354B
Authority
CN
China
Prior art keywords
signal
target
list
received
transmitted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811157784.3A
Other languages
Chinese (zh)
Other versions
CN109327354A (en
Inventor
温磊
黄颍华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Electric Vehicle Co Ltd
Original Assignee
Beijing Electric Vehicle Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Electric Vehicle Co Ltd filed Critical Beijing Electric Vehicle Co Ltd
Priority to CN201811157784.3A priority Critical patent/CN109327354B/en
Publication of CN109327354A publication Critical patent/CN109327354A/en
Application granted granted Critical
Publication of CN109327354B publication Critical patent/CN109327354B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Abstract

The embodiment of the invention provides a method, a device and a test system for generating a signal forwarding test case, wherein the method comprises the following steps: acquiring a forwarding signal list used for recording a first group of signals to be forwarded, which need to be forwarded by a target controller, and a DBC file of each CAN domain connected with the target controller; determining a target forwarding signal group and generating a signal address list according to each DBC file and the forwarding signal list; analyzing an environment model according to the signal address list, determining a path of each target forwarding signal group in the environment model, and generating a use case signal list; and generating a test case according to the case signal list. According to the technical scheme provided by the embodiment of the invention, the compiling of the test case applied to the target controller can be realized only by manually determining the target signal group without obvious rules and capability of following, so that the complex labor of handwriting the test case is avoided, the compiling speed and accuracy of the test case are improved, and the test period is further shortened.

Description

Method, device and test system for generating signal forwarding test case
Technical Field
The present invention relates to the field of test technologies, and in particular, to a method, an apparatus, and a test system for generating a signal forwarding test case.
Background
Controllers (e.g., vehicle control units) in a vehicle that connect multiple CAN (Controller Area Network) Network domains often need to forward specific CAN signals from one Network domain to another. Before and after the signal is forwarded, the attributes of the signal are consistent, and complex logic does not exist. However, if the number of the forwarding signals is large, the workload of the traditional manual writing test case is large, errors are prone to occur, the consistency of the forwarded signals in each DBC (Data Base Controller Area Network) file, namely the CAN Network information description file cannot be checked when the test case is written, and problems CAN be found only when the test is completed, so that the workload of the test is large, the consumed time is long, and the test period is prolonged.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a method, an apparatus and a test system for generating a signal forwarding test case, so as to solve the problem of a long test period caused by the insufficient speed and accuracy of the current conventional handwriting test case when performing a signal forwarding test.
In order to solve the above technical problem, an embodiment of the present invention provides a method for generating a signal forwarding test case, including:
acquiring a forwarding signal list used for recording a first group of signals to be forwarded, which need to be forwarded by a target controller, and a DBC file of each CAN domain connected with the target controller;
determining a target forwarding signal group and generating a signal address list according to each DBC file and the forwarding signal list, wherein the target forwarding signal group comprises a target receiving signal and a target sending signal;
analyzing an environment model according to the signal address list, determining a path of each target forwarding signal group in the environment model, and generating a use case signal list;
and generating a test case according to the case signal list.
Specifically, in the method as described above, in the step of obtaining a forwarding signal list for recording a first group of signals to be forwarded, which needs to be forwarded by the target controller, the first group of signals to be forwarded includes: a first signal to be received and a first signal to be transmitted;
each row of the forwarding signal list records signal information of a first group of signals to be forwarded, and the signal information at least comprises: the CAN communication system comprises a signal name of a first signal to be received, CAN domain information of the first signal to be received, a signal name of a first signal to be sent and the CAN domain information of the first signal to be sent.
Preferably, the method as described above, the step of determining a target forwarding signal group and generating a signal address list according to each DBC file and the forwarding signal list comprises:
storing attribute information of a second signal to be received and a second signal to be received, which are related to a target controller, in each DBC file into a received signal list corresponding to the DBC file, and storing attribute information of a second signal to be transmitted and a second signal to be transmitted, which are related to the target controller, in each DBC file into a transmitted signal list corresponding to the DBC file, wherein the attribute information comprises: the method comprises the following steps of (1) signal name, signal sending period, signal length, signal precision, signal offset, signal maximum value and signal minimum value;
sequentially selecting a received signal list corresponding to each DBC file as a first target received signal list, taking a transmitted signal list corresponding to other DBC files except the selected DBC file as a first target transmitted signal list, and sequentially comparing a second signal to be received serving as a first target received signal in the first target received signal list with a second signal to be transmitted serving as a first target transmitted signal in the first target transmitted signal list to obtain a first comparison result;
if the first comparison result is that the main body of the signal name of the first target receiving signal is the same as the main body of the signal name of the first target sending signal, comparing the target attribute information of the first target receiving signal with the target attribute information of the first target sending signal to obtain a second comparison result, wherein the target attribute information comprises: signal length, signal accuracy, signal offset, signal maximum and signal minimum;
if the second comparison result is that the target attribute information of the first target receiving signal is the same as the target attribute information of the first target sending signal, determining that the first target receiving signal and the first target sending signal are a target forwarding signal group;
and generating a signal address list according to the CAN domain information of the first target receiving signal, the position of the first target receiving signal in the first target receiving signal list, the CAN domain information of the first target receiving signal and the position of the first target sending signal in the first target sending signal list.
Preferably, as described above, when the comparison of the first target received signal in each target received signal list is completed, the method further includes:
selecting a received signal list positioned in the same CAN domain as a second target received signal list according to the CAN domain information of the first signal to be received in each row of the forwarded signal list;
comparing the signal name of the first signal to be received with the signal name of each second signal to be received serving as a second target received signal in a second target received signal list in sequence to obtain a third comparison result;
when the third comparison result is that the main body of the signal name of the first signal to be received is the same as the main body of the signal name of a second target receiving signal in the second target receiving signal list, selecting a sending signal list positioned in the same CAN domain as a second target sending signal list according to the CAN domain information of the first target sending signal;
sequentially comparing the signal name of the first signal to be transmitted with the signal name of each second signal to be transmitted serving as a second target transmission signal in a second target transmission signal list to obtain a fourth comparison result;
when the fourth comparison result is that the main body of the signal name of the first signal to be transmitted is the same as the main body of the signal name of a second target transmission signal in the second target transmission signal list, acquiring target attribute information of a second target receiving signal and target attribute information of the second target transmission signal;
if the target attribute information of the second target receiving signal is the same as the target attribute information of the second target sending signal, determining the second target receiving signal and the second target sending signal as a target forwarding signal group;
and storing the CAN domain information of the second target receiving signal, the position of the second target receiving signal in a second target receiving signal list, the CAN domain information of the second signal to be sent and the position of the second signal to be sent in a second target sending signal list into a signal address list.
Specifically, after the step of sequentially comparing a second signal to be received, which is a first target received signal in the first target received signal list, with a second signal to be transmitted, which is a first target transmitted signal in the first target transmitted signal list, to obtain a first comparison result, the method further includes:
and if the first comparison result shows that the signal name of any first target sending signal is different from the signal name of the first target receiving signal, selecting a next first target receiving signal to be sequentially compared with the first target sending signal for the signal name.
Further, after the step of comparing the target attribute information of the first target received signal with the target attribute information of the first target transmitted signal to obtain a second comparison result, the method further includes:
and if the second comparison result is that the target attribute information of the first target receiving signal is different from the target attribute information of the first target sending signal, stopping comparison and generating first prompt information for reminding a test engineer to check whether the DBC file and the network protocol of the CAN domain where the DBC file and the CAN domain are located are correct.
Specifically, after the step of sequentially comparing the signal name of the first signal to be received with the signal name of each second signal to be received in the second target received signal list to obtain a third comparison result, the method further includes:
and if the third comparison result shows that the signal name of the first signal to be received is not the same as the signal name of the second target received signal in any second target received signal list, stopping comparison and generating second prompt information for reminding a test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located and the forwarding signal list are correct or not.
Further, after the step of sequentially comparing the signal name of the first signal to be transmitted with the signal name of the second signal to be transmitted in the second target transmission signal list to obtain a fourth comparison result, the method further includes:
and if the fourth comparison result shows that the signal name of the first signal to be transmitted is not the same as the signal name of any second target transmission signal in the second target transmission signal list, stopping comparison and generating third prompt information for reminding a test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located and the forwarding signal list are correct or not.
Specifically, the method further includes, after the step of acquiring the target attribute information of the second target received signal and the target attribute information of the second target transmitted signal:
and if the target attribute information of the second target receiving signal is different from the target attribute information of the second target sending signal, generating fourth prompt information for reminding a test engineer to check whether the DBC file and the network protocol of the CAN domain where the DBC file is located are correct.
Preferably, in the method as described above, the step of performing environment model analysis on the signal address list, determining a path of each target forwarding signal group in the environment model, and generating the use case signal list includes:
sequentially carrying out environmental model analysis according to the target forwarding signal groups stored in each row in the signal address list to obtain a first signal name corresponding to a target receiving signal and a second signal name corresponding to a target sending signal, wherein the first signal name carries path information of the target receiving signal, and the second signal name carries path information of the target sending signal;
and generating a use case signal list according to each first signal name and each second signal name.
Preferably, in the method, the target number of rows of the test case is determined according to the theoretical number of rows and the preset number of test values, wherein the theoretical number of rows is determined according to the maximum value of the signal, the minimum value of the signal, and the accuracy of the signal by using a first preset algorithm;
when the number of theoretical lines is less than or equal to the number of preset test values, the number of target lines is the number of theoretical lines, and the values of the target receiving signal and the target sending signal are all values from the minimum value of the signal to the maximum value of the signal;
when the theoretical line number is greater than the preset test value number, the target line number is the preset test value number, and the values of the target receiving signal and the target sending signal at the moment all include: the signal processing method comprises the steps of obtaining a maximum value of a signal, a minimum value of the signal, a first numerical value and a second numerical value, wherein the first numerical value is obtained through a second preset algorithm according to the maximum value of the signal and the signal precision, and the second numerical value is obtained through a third preset algorithm according to the minimum value of the signal and the signal precision.
Specifically, in the method described above, the first preset algorithm is:
P=(N1-N2)/W+1
wherein P is the number of theoretical rows;
N1is the maximum value of the signal;
N2is the minimum value of the signal;
w is the value of the signal accuracy.
Specifically, in the method described above, the second preset algorithm is:
Na1=N1-i1W
the third preset algorithm is as follows:
Na2=N2+i2W
wherein N isa1Is a first value;
Na2is a second value;
N1is the maximum value of the signal;
N2is the minimum value of the signal;
w is the value of signal precision;
i1sequentially taking natural numbers between 1 and (n-1)/2;
i2sequentially taking natural numbers between 1 and (n-2)/2;
and N is the number of preset test values.
Preferably, in the method described above, each row of the test case includes: the system comprises a timestamp, upper and lower electric signal addresses, a target receiving signal and a target sending signal;
wherein the time stamp is the sum of the transmission periods of the target reception signal and the target transmission signal from the second row.
Another preferred embodiment of the present invention also provides a test apparatus, including:
the system comprises an acquisition module, a forwarding module and a database Controller Area Network (CAN) file DBC, wherein the acquisition module is used for acquiring a forwarding signal list used for recording a first signal group to be forwarded, which needs to be forwarded by a target controller, and a CAN domain of each controller connected with the target controller;
the first processing module is used for determining a target forwarding signal group and generating a signal address list according to each DBC file and the forwarding signal list, wherein the target forwarding signal group comprises a target receiving signal and a target sending signal;
the second processing module is used for analyzing the environment model according to the signal address list, determining the path of each target forwarding signal group in the environment model and generating a use case signal list;
and the third processing module is used for generating a test case according to the case signal list.
Preferably, the test apparatus as described above, the first processing module includes:
the first processing submodule is configured to store attribute information of a second signal to be received and a second signal to be received, which are related to a target controller, in each DBC file into a received signal list corresponding to the DBC file, and store attribute information of a second signal to be transmitted and a second signal to be transmitted, which are related to the target controller, in each DBC file into a transmitted signal list corresponding to the DBC file, where the attribute information includes: the method comprises the following steps of (1) signal name, signal sending period, signal length, signal precision, signal offset, signal maximum value and signal minimum value;
the second processing submodule is used for sequentially selecting a received signal list corresponding to each DBC file as a first target received signal list, taking a transmitted signal list corresponding to other DBC files except the selected DBC file as a first target transmitted signal list, and sequentially comparing a second signal to be received serving as a first target received signal in the first target received signal list with a second signal to be transmitted serving as a first target transmitted signal in the first target transmitted signal list to obtain a first comparison result;
a third processing sub-module, configured to compare, if the first comparison result is that a main body of the signal name of the first target received signal is the same as a main body of the signal name of the first target transmitted signal, target attribute information of the first target received signal and target attribute information of the first target transmitted signal, to obtain a second comparison result, where the target attribute information includes: signal length, signal accuracy, signal offset, signal maximum and signal minimum;
the fourth processing submodule is used for determining the first target receiving signal and the first target sending signal as a target forwarding signal group if the second comparison result is that the target attribute information of the first target receiving signal is the same as the target attribute information of the first target sending signal;
and the fifth processing submodule is used for generating a signal address list according to the CAN domain information of the first target receiving signal, the position of the first target receiving signal in the first target receiving signal list, the CAN domain information of the first target receiving signal and the position of the first target sending signal in the first target sending signal list.
Preferably, the test apparatus as described above, the first processing module further comprises:
the sixth processing submodule is used for selecting a received signal list positioned in the same CAN domain as a second target received signal list according to the CAN domain information of the first signal to be received in each row of the forwarded signal list;
the seventh processing submodule compares the signal name of the first signal to be received with the signal name of each second signal to be received serving as a second target received signal in the second target received signal list in sequence to obtain a third comparison result;
the eighth processing submodule is used for selecting a sending signal list positioned in the same CAN domain as a second target sending signal list according to the CAN domain information of the first target sending signal when the third comparison result shows that the main body of the signal name of the first signal to be received is the same as the main body of the signal name of a second target receiving signal in the second target receiving signal list;
the ninth processing submodule is used for sequentially comparing the signal name of the first signal to be transmitted with the signal name of each second signal to be transmitted serving as the second target transmission signal in the second target transmission signal list to obtain a fourth comparison result;
a tenth processing submodule, configured to obtain target attribute information of the second target received signal and target attribute information of the second target transmitted signal when the fourth comparison result is that a main body of the signal name of the first signal to be transmitted is the same as a main body of a signal name of a second target transmitted signal in the second target transmitted signal list;
the eleventh processing submodule is used for determining the second target receiving signal and the second target transmitting signal as a target forwarding signal group if the target attribute information of the second target receiving signal is the same as the target attribute information of the second target transmitting signal;
and the twelfth processing submodule is used for storing the CAN domain information of the second target receiving signal, the position of the second target receiving signal in the second target receiving signal list, the CAN domain information of the second signal to be sent and the position of the second signal to be sent in the second target sending signal list into the signal address list.
Preferably, the test apparatus as described above, the second processing module includes:
a thirteenth processing sub-module, configured to perform environment model analysis sequentially according to the target forwarding signal group stored in each row in the signal address list, to obtain a first signal name corresponding to the target receiving signal and a second signal name corresponding to the target sending signal, where the first signal name carries path information of the target receiving signal and the second signal name carries path information of the target sending signal;
and the fourteenth processing submodule is used for generating a use case signal list according to each first signal name and each second signal name.
Specifically, as described above, the first processing module further includes:
and the fifteenth processing submodule is used for selecting a next first target receiving signal to be sequentially compared with the first target sending signal for the signal name comparison if the first comparison result shows that the signal name of any first target sending signal is different from the signal name of the first target receiving signal.
Further, as for the testing device, the first processing module further includes:
and the sixteenth processing submodule is used for stopping comparison and generating first prompt information for reminding a test engineer to check whether the DBC file and the network protocol of the CAN domain where the DBC file is located are correct or not if the second comparison result shows that the target attribute information of the first target receiving signal is different from the target attribute information of the first target sending signal.
Specifically, as described above, the first processing module further includes:
and the seventeenth processing submodule is used for stopping comparison and generating second prompt information for reminding a test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located and the forwarding signal list are correct or not if the third comparison result shows that the signal name of the first signal to be received is not the same as the signal name of the second target receiving signal in any second target receiving signal list.
Further, as for the testing device, the first processing module further includes:
and the eighteenth processing submodule is used for stopping comparison and generating third prompt information for reminding a test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located and the forwarding signal list are correct or not if the fourth comparison result shows that the signal name of the first signal to be sent is not the same as the signal name of any second target sending signal in the second target sending signal list.
Specifically, as described above, the first processing module further includes:
and the nineteenth processing sub-module is used for generating fourth prompt information for reminding a test engineer to check whether the DBC file and the network protocol of the CAN domain where the DBC file is located are correct or not if the target attribute information of the second target receiving signal is different from the target attribute information of the second target sending signal.
Yet another preferred embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for generating signal forwarding test cases as described above.
Still another preferred embodiment of the present invention also provides a test system, including: a test apparatus as described above.
Compared with the prior art, the method, the device and the test system for generating the signal forwarding test case provided by the embodiment of the invention at least have the following beneficial effects:
in the embodiment of the invention, a test device CAN obtain a forwarding signal list applied to a target controller and a DBC file of each CAN domain connected with the target controller before testing, wherein a first signal group to be forwarded in the forwarding list is a group of signals which are forwarded by the target controller but have no obvious regularity between a signal name before forwarding and a signal name after forwarding; the test device judges signals received and sent by the target controller according to the forwarding signal list and each DBC file, determines a target forwarding signal group to be forwarded through the target controller, analyzes an environmental model according to the target forwarding signal group to generate a case signal list, and further obtains a test case of each target forwarding signal group, so that a technician only needs to manually determine the target signal group without obvious rules and capable of following, the compiling of the test case corresponding to the target forwarding signal group to be forwarded by the target controller can be realized, the complex labor of determining and compiling the target forwarding signal groups one by one when the test case is handwritten is avoided, the compiling speed and the accuracy of the test case are improved, and the test period is further shortened.
Drawings
FIG. 1 is a flowchart illustrating a method for generating a signal forwarding test case according to an embodiment of the present invention;
FIG. 2 is a second flowchart illustrating a method for generating signal forwarding test cases according to the present invention;
FIG. 3 is a third schematic flow chart of a method for generating signal forwarding test cases according to the present invention;
FIG. 4 is a fourth flowchart illustrating a method for generating a signal forwarding test case according to the present invention;
FIG. 5 is a schematic structural diagram of a testing apparatus according to the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help the full understanding of the embodiments of the present invention. Thus, it will be apparent to those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the invention. In addition, descriptions of well-known functions and constructions are omitted for clarity and conciseness.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
In various embodiments of the present invention, it should be understood that the sequence numbers of the following processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
It should be understood that the term "and/or" herein is merely one type of association relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
In the embodiments provided herein, it should be understood that "B corresponding to a" means that B is associated with a from which B can be determined. It should also be understood that determining B from a does not mean determining B from a alone, but may be determined from a and/or other information.
Referring to fig. 1, a preferred embodiment of the present invention provides a method for generating a signal forwarding test case, including:
1001, acquiring a forwarding signal list for recording a first group of signals to be forwarded, which are required to be forwarded by a target controller, and a DBC file of each CAN domain connected with the target controller;
step 1002, determining a target forwarding signal group and generating a signal address list according to each DBC file and the forwarding signal list, wherein the target forwarding signal group comprises a target receiving signal and a target sending signal;
step 1003, analyzing an environment model according to the signal address list, determining a path of each target forwarding signal group in the environment model, and generating a use case signal list;
and 1004, generating a test case according to the case signal list.
In the embodiment of the invention, a test device CAN obtain a forwarding signal list applied to a target controller and a DBC file of each CAN domain connected with the target controller before testing, wherein a first signal group to be forwarded in the forwarding list is a group of signals which are forwarded by the target controller but have no obvious regularity between a signal name before forwarding and a signal name after forwarding; the test device judges signals received and sent by the target controller according to the forwarding signal list and each DBC file, determines a target forwarding signal group to be forwarded through the target controller, analyzes an environmental model according to the target forwarding signal group to generate a case signal list, and further obtains a test case of each target forwarding signal group, so that a technician only needs to manually determine the target signal group without obvious rules and capable of following, the compiling of the test case corresponding to the target forwarding signal group to be forwarded by the target controller can be realized, the complex labor of determining and compiling the target forwarding signal groups one by one when the test case is handwritten is avoided, the compiling speed and the accuracy of the test case are improved, and the test period is further shortened.
Specifically, in the method as described above, in the step of obtaining a forwarding signal list for recording a first group of signals to be forwarded, which needs to be forwarded by the target controller, the first group of signals to be forwarded includes: a first signal to be received and a first signal to be transmitted;
each row of the forwarding signal list records signal information of a first group of signals to be forwarded, and the signal information at least comprises: the CAN communication system comprises a signal name of a first signal to be received, CAN domain information of the first signal to be received, a signal name of a first signal to be sent and the CAN domain information of the first signal to be sent.
In an embodiment of the present invention, the first set of signals to be forwarded includes: the first signal to be received is a signal which needs to be forwarded continuously after the target controller receives the signal and no obvious rule exists between the name of the signal after forwarding and the name of the signal before forwarding, the first signal to be sent is a signal which needs to be forwarded after the target controller receives the signal and no obvious rule exists between the name of the signal after forwarding and the name of the signal before forwarding, namely the target controller needs to send the first signal to be sent after receiving the first signal to be received to complete the forwarding of the signal, and no obvious rule exists between the name of the first signal to be received and the name of the signal before forwarding.
Each row of the forwarding signal list records signal information of a first signal group to be forwarded, pairing of the first signal to be received and the first signal to be forwarded is guaranteed, the situation that the predetermined first signal group to be forwarded is not matched with the actual signal group to be forwarded is avoided, and the signal information comprises the signal name of each signal and CAN domain information, so that the domain positions where the first signal to be transmitted and the first signal to be received are located CAN be conveniently determined, and subsequent comparison is carried out.
Referring to fig. 2, preferably, the step of determining a target forwarding signal group and generating a signal address list according to each DBC file and the forwarding signal list, as described above, includes:
step 2001, storing attribute information of a second signal to be received and a second signal to be received in each DBC file, which are related to a target controller, into a received signal list corresponding to the DBC file, and storing attribute information of a second signal to be transmitted and a second signal to be transmitted in each DBC file, which are related to the target controller, into a transmitted signal list corresponding to the DBC file, where the attribute information includes: the method comprises the following steps of (1) signal name, signal sending period, signal length, signal precision, signal offset, signal maximum value and signal minimum value;
step 2002, sequentially selecting a received signal list corresponding to each DBC file as a first target received signal list, and selecting a transmitted signal list corresponding to other DBC files except the selected DBC file as a first target transmitted signal list, and sequentially comparing a second signal to be received serving as a first target received signal in the first target received signal list with a second signal to be transmitted serving as a first target transmitted signal in the first target transmitted signal list to obtain a first comparison result;
step 2003, if the first comparison result is that the main body of the signal name of the first target receiving signal is the same as the main body of the signal name of the first target sending signal, comparing the target attribute information of the first target receiving signal with the target attribute information of the first target sending signal to obtain a second comparison result, where the target attribute information includes: signal length, signal accuracy, signal offset, signal maximum and signal minimum;
step 2004, if the second comparison result is that the target attribute information of the first target receiving signal is the same as the target attribute information of the first target sending signal, determining that the first target receiving signal and the first target sending signal are a target forwarding signal group;
step 2005, a signal address list is generated according to the CAN domain information of the first target receiving signal, the position of the first target receiving signal in the first target receiving signal list, the CAN domain information of the first target receiving signal, and the position of the first target transmitting signal in the first target transmitting signal list.
In the embodiment of the invention, signals in each DBC file are classified according to the transceiving relation between the signals and a target controller and are stored in a received signal list or a transmitted signal list corresponding to the DBC file, wherein prefixes or suffixes are added according to the names of the signal lists to distinguish the received signal lists or the transmitted signal lists corresponding to different DBC files, preferably, the prefixes or the suffixes CAN be abbreviations of CAN domains where the DBC files are located; after all the signals are classified, selecting a received signal list corresponding to one DBC file as a first target received signal list, selecting a transmitted signal list corresponding to other DBC files except the selected DBC file as a first target transmitted signal list, sequentially selecting a second signal to be received serving as a first target received signal in the first target received signal list and a second signal to be transmitted serving as a first target transmitted signal in the first target transmitted signal list to carry out signal name comparison, carrying out preliminary judgment on whether the selected first target received signal and the second target signal are a group of target forwarding signal groups or not, and if the main body of the signal name of the first target received signal is the same as that of the first target transmitted signal, forming a group of target forwarding signal groups between the first target received signal and the first target transmitted signal, at this time, the first target receiving signal and the target attribute information of the first target transmitting signal are judged again, if the target attribute information of the first target receiving signal and the target attribute information of the first target transmitting signal are consistent, the first target receiving signal and the first target transmitting signal are determined to be a group of target forwarding signal groups, a signal address list is generated according to the CAN domain information of the first target receiving signal and the first target transmitting signal and the position in the first target receiving signal list or the first target transmitting list, and the above steps are repeated until the second signals to be received in the receiving signal lists corresponding to all DBC files are compared, that is, the determination of the common target forwarding signal group is completed, wherein the common target forwarding signal group means that the signal names of the signals before and after forwarding do not change or follow a certain obvious rule, for example: only a partial prefix or suffix is changed. The target forwarding signal group formed by each first target sending signal and each first target receiving signal can be accurately and comprehensively determined through the one-to-one comparison mode, and the situations that the omission causes subsequent generation of test cases and the omission causes incomplete test when the test is carried out according to the test cases are avoided. The complicated labor of manually determining the target forwarding signal group is reduced, the compiling speed and accuracy of the test case are improved, and the test period is further shortened.
Referring to fig. 3, preferably, in the method as described above, after the first target received signal in each target received signal list is compared, the method further includes:
step 3001, according to the CAN domain information of the first signal to be received in each row of the forwarding signal list, selecting a receiving signal list located in the same CAN domain as a second target receiving signal list;
step 3002, comparing the signal name of the first signal to be received with the signal name of each second signal to be received serving as the second target received signal in the second target received signal list in sequence to obtain a third comparison result;
step 3003, when the third comparison result is that the main body of the signal name of the first signal to be received is the same as the main body of the signal name of a second target receiving signal in the second target receiving signal list, selecting the transmitting signal list located in the same CAN domain as the second target transmitting signal list according to the CAN domain information of the first target transmitting signal;
step 3004, sequentially comparing the signal name of the first signal to be transmitted with the signal name of each second signal to be transmitted in the second target transmission signal list as the second target transmission signal, so as to obtain a fourth comparison result;
step 3005, when the fourth comparison result is that the main body of the signal name of the first signal to be transmitted is the same as the main body of the signal name of a second target transmission signal in the second target transmission signal list, acquiring target attribute information of the second target reception signal and target attribute information of the second target transmission signal;
step 3006, if the target attribute information of the second target received signal is the same as the target attribute information of the second target transmitted signal, determining that the second target received signal and the second target transmitted signal are a target forwarding signal group;
step 3007, store the CAN domain information of the second target received signal, the position of the second target received signal in the second target received signal list, the CAN domain information of the second signal to be sent, and the position of the second signal to be sent in the second target sent signal list in the signal address list.
In the embodiment of the invention, after the comparison of the first target received signals in each target received signal list is completed, that is, after the determination of the common type target forwarding signal group is completed, the corresponding second signals to be received and the second signals to be transmitted are sequentially determined according to the CAN domain information and the signals in each line in the forwarding signal list, and are stored in the signal address list as the target forwarding signal group, so as to determine the special type target forwarding signal group, wherein the special type target forwarding signal group refers to the target forwarding signal group in which there is no obvious rule in the change of the signal name before and after forwarding, and further ensure that the target forwarding signal groups forwarded by the target controller are all stored in the signal address list, which is beneficial to the subsequent operation of obtaining a test case and performing a test according to the test case. The complicated labor of manually determining the target forwarding signal group is reduced, the compiling speed and accuracy of the test case are improved, and the test period is further shortened.
Specifically, after the step of sequentially comparing a second signal to be received, which is a first target received signal in the first target received signal list, with a second signal to be transmitted, which is a first target transmitted signal in the first target transmitted signal list, to obtain a first comparison result, the method further includes:
and if the first comparison result shows that the signal name of any first target sending signal is different from the signal name of the first target receiving signal, selecting a next first target receiving signal to be sequentially compared with the first target sending signal for the signal name.
In the embodiment of the present invention, when none of the first target received signals is selected to be compared with the signal name of the first target received signal, it is determined that the first target received signal does not need to be forwarded by the target controller, and then the step 3001 is returned to select the next second signal to be received as the first target received signal for comparison.
Further, after the step of comparing the target attribute information of the first target received signal with the target attribute information of the first target transmitted signal to obtain a second comparison result, the method further includes:
and if the second comparison result is that the target attribute information of the first target receiving signal is different from the target attribute information of the first target sending signal, stopping comparison and generating first prompt information for reminding a test engineer to check whether the DBC file and the network protocol of the CAN domain where the DBC file and the CAN domain are located are correct.
In the embodiment of the invention, under the condition that the main bodies of the signal names of the first target receiving signal and the first target sending signal are the same, if the target attribute information of the first target receiving signal and the first target sending signal is different, it is determined that the DBC file to which the first target receiving signal and/or the first target sending signal belongs and the network protocol of the CAN domain have a problem, at this time, first prompt information is generated to remind a technician to check and eliminate the DBC file to which the first target receiving signal and/or the first target sending signal belongs and the network protocol of the CAN domain, and the consistency of the target forwarding signal group and the DBC file is checked at the beginning stage of the test, which is beneficial to improving the test efficiency during the subsequent test.
Specifically, after the step of sequentially comparing the signal name of the first signal to be received with the signal name of each second signal to be received in the second target received signal list to obtain a third comparison result, the method further includes:
and if the third comparison result shows that the signal name of the first signal to be received is not the same as the signal name of the second target received signal in any second target received signal list, stopping comparison and generating second prompt information for reminding a test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located and the forwarding signal list are correct or not.
In the embodiment of the present invention, when determining the target forwarding signal group by using the forwarding signal list, it is necessary to verify whether the first signal to be received stored on the forwarding signal list exists, when the main body of the signal name of the first signal to be received is different from that of each second signal to be received in the second target received signal list in the same CAN domain, determining that the first signal to be received does not exist, determining that the DBC file corresponding to the first signal to be received and the network protocol or the forwarding signal list of the CAN domain have problems, generating a second prompt message to remind a technician to check and eliminate the DBC file belonging to the first signal to be received and the network protocol and/or the forwarding signal list of the CAN domain, and the consistency of the target forwarding signal group and the DBC file is checked at the beginning stage of the test, so that the test efficiency during the subsequent test is improved.
Further, after the step of sequentially comparing the signal name of the first signal to be transmitted with the signal name of the second signal to be transmitted in the second target transmission signal list to obtain a fourth comparison result, the method further includes:
and if the fourth comparison result shows that the signal name of the first signal to be transmitted is not the same as the signal name of any second target transmission signal in the second target transmission signal list, stopping comparison and generating third prompt information for reminding a test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located and the forwarding signal list are correct or not.
In the embodiment of the present invention, when determining the target forwarding signal group by using the forwarding signal list, it is further required to verify whether the first signal to be transmitted stored on the forwarding signal list exists, when the main body of the signal name of the first signal to be transmitted is different from that of each second signal to be transmitted in the second target transmission signal list in the same CAN domain, determining that the first signal to be transmitted does not exist, determining that the DBC file corresponding to the first signal to be transmitted and the network protocol or the forwarding signal list of the CAN domain have problems, generating a third prompt message to remind a technician to check and eliminate the DBC file belonging to the first signal to be transmitted and the network protocol and/or the forwarding signal list of the CAN domain, and the consistency of the target forwarding signal group and the DBC file is checked at the beginning stage of the test, so that the test efficiency during the subsequent test is improved.
Specifically, the method further includes, after the step of acquiring the target attribute information of the second target received signal and the target attribute information of the second target transmitted signal:
and if the target attribute information of the second target receiving signal is different from the target attribute information of the second target sending signal, generating fourth prompt information for reminding a test engineer to check whether the DBC file and the network protocol of the CAN domain where the DBC file is located are correct.
In the embodiment of the present invention, under the condition that the main bodies of the signal names of the second target receiving signal and the second target transmitting signal are the same, if the target attribute information of the second target receiving signal and the second target transmitting signal is different, it is determined that the DBC file to which the second target receiving signal and/or the second target transmitting signal belongs and the network protocol of the CAN domain in which the DBC file belongs have a problem, at this time, a fourth prompt message is generated to prompt a technician to check and exclude the DBC file to which the second target receiving signal and/or the second target transmitting signal belongs and the network protocol of the CAN domain in which the DBC file belongs, and the consistency of the target forwarding signal group and the DBC file is checked at the beginning stage of the test, which is beneficial to improving the test efficiency in the subsequent test.
Referring to fig. 4, preferably, the method as described above, the environmental model parsing the signal address list, determining a path of each target forwarding signal group in the environmental model, and generating the use case signal list includes:
step 4001, sequentially performing environment model analysis according to the target forwarding signal groups stored in each row in the signal address list to obtain a first signal name corresponding to the target receiving signal and a second signal name corresponding to the target sending signal, where the first signal name carries path information of the target receiving signal and the second signal name carries path information of the target sending signal;
step 4002, generating a use case signal list according to each first signal name and each second signal name.
In the embodiment of the invention, the signal address list generated according to the target forwarding signal group is subjected to environment model analysis, a first signal name corresponding to a target receiving signal in each target forwarding signal group and a second signal name corresponding to a target sending signal are obtained by simulating a working environment during signal transmission, and the first signal name and the second signal name both carry path information, so that the operations of tracking, information extraction and the like of signals during generation of a case signal list and generation of a test case according to the case signal list are facilitated.
Preferably, in the method, the target number of rows of the test case is determined according to the theoretical number of rows and the preset number of test values, wherein the theoretical number of rows is determined according to the maximum value of the signal, the minimum value of the signal, and the accuracy of the signal by using a first preset algorithm;
when the number of theoretical lines is less than or equal to the number of preset test values, the number of target lines is the number of theoretical lines, and the values of the target receiving signal and the target sending signal are all values from the minimum value of the signal to the maximum value of the signal;
when the theoretical line number is greater than the preset test value number, the target line number is the preset test value number, and the values of the target receiving signal and the target sending signal at the moment all include: the signal processing method comprises the steps of obtaining a maximum value of a signal, a minimum value of the signal, a first numerical value and a second numerical value, wherein the first numerical value is obtained through a second preset algorithm according to the maximum value of the signal and the signal precision, and the second numerical value is obtained through a third preset algorithm according to the minimum value of the signal and the signal precision.
Specifically, in the method described above, the first preset algorithm is:
P=(N1-N2)/W+1
wherein P is the number of theoretical rows;
N1is the maximum value of the signal;
N2is the minimum value of the signal;
w is the value of the signal accuracy.
Specifically, in the method described above, the second preset algorithm is:
Na1=N1-i1W
the third preset algorithm is as follows:
Na2=N2+i2W
wherein N isa1Is a first value;
Na2is a second value;
N1is the maximum value of the signal;
N2is the minimum value of the signal;
w is the value of signal precision;
i1sequentially taking natural numbers between 1 and (n-1)/2;
i2sequentially taking natural numbers between 1 and (n-2)/2;
and N is the number of preset test values.
In the embodiment of the invention, when the test cases are generated, the target line number of the test cases is determined according to the theoretical line number and the preset test value number of each test case, and the values of the target sending signal and the target receiving signal are obtained. The determination method is convenient for accurately determining the target line number of each test case and the values of the target sending signal and the target receiving signal, is beneficial to reducing the complex labor of manual determination and writing, improves the writing speed and accuracy of the test cases, and further shortens the test period.
Preferably, in the method described above, each row of the test case includes: the system comprises a timestamp, upper and lower electric signal addresses, a target receiving signal and a target sending signal;
wherein the time stamp is the sum of the transmission periods of the target reception signal and the target transmission signal from the second row.
In the embodiment of the present invention, each row of the test case includes, but is not limited to, a timestamp, an up-down electrical signal address, a target received signal, and a target transmitted signal, and the timestamp, the up-down electrical signal address, the target received signal, and the target transmitted signal are sequentially assigned from the second row to the last row of the target row.
Referring to fig. 5, another preferred embodiment of the present invention also provides a test apparatus, including:
an obtaining module 501, configured to obtain a forwarding signal list for recording a first signal group to be forwarded, which needs to be forwarded by a target controller, and a database CAN file DBC of each controller area network CAN domain connected to the target controller;
a first processing module 502, configured to determine a target forwarding signal group according to each DBC file and a forwarding signal list, and generate a signal address list, where the target forwarding signal group includes a target receiving signal and a target sending signal;
the second processing module 503 is configured to perform environmental model analysis according to the signal address list, determine a path of each target forwarding signal group in the environmental model, and generate a use case signal list;
and a third processing module 504, configured to generate a test case according to the case signal list.
Preferably, as the test apparatus described above, the first processing module 502 includes:
the first processing sub-module 5021 is configured to store attribute information of a second signal to be received and a second signal to be received, which are related to a target controller, in each DBC file into a received signal list corresponding to the DBC file, and store attribute information of a second signal to be transmitted and a second signal to be transmitted, which are related to a target controller, in each DBC file into a transmitted signal list corresponding to the DBC file, where the attribute information includes: the method comprises the following steps of (1) signal name, signal sending period, signal length, signal precision, signal offset, signal maximum value and signal minimum value;
the second processing submodule 5022 is configured to sequentially select a received signal list corresponding to each DBC file as a first target received signal list, select a transmitted signal list corresponding to other DBC files except the selected DBC file as a first target transmitted signal list, and sequentially compare a second signal to be received, which is a first target received signal in the first target received signal list, with a second signal to be transmitted, which is a first target transmitted signal in the first target transmitted signal list, to obtain a first comparison result;
the third processing sub-module 5023 is configured to compare the target attribute information of the first target received signal with the target attribute information of the first target transmitted signal to obtain a second comparison result if the first comparison result is that the main body of the signal name of the first target received signal is the same as the main body of the signal name of the first target transmitted signal, where the target attribute information includes: signal length, signal accuracy, signal offset, signal maximum and signal minimum;
the fourth processing sub-module 5024 is configured to determine that the first target received signal and the first target transmitted signal are a target forwarding signal group if the second comparison result indicates that the target attribute information of the first target received signal is the same as the target attribute information of the first target transmitted signal;
the fifth processing submodule 5025 is configured to generate a signal address list according to the CAN domain information of the first target receiving signal, the position of the first target receiving signal in the first target receiving signal list, the CAN domain information of the first target receiving signal, and the position of the first target sending signal in the first target sending signal list.
Preferably, as the test device, the first processing module 502 further comprises:
the sixth processing submodule 5026 is configured to select a received signal list located in the same CAN domain as a second target received signal list according to the CAN domain information of the first signal to be received in each row of the forwarded signal list;
the seventh processing sub-module 5027 compares the signal name of the first signal to be received with the signal name of each second signal to be received serving as the second target received signal in the second target received signal list in sequence to obtain a third comparison result;
the eighth processing submodule 5028 is configured to select a sending signal list located in the same CAN domain as a second target sending signal list according to the CAN domain information of the first target sending signal when the third comparison result shows that the main body of the signal name of the first signal to be received is the same as the main body of the signal name of a second target receiving signal in the second target receiving signal list;
a ninth processing submodule 5029, configured to compare the signal name of the first signal to be transmitted with the signal name of each second signal to be transmitted in the second target transmission signal list, which is used as a second target transmission signal, in sequence, so as to obtain a fourth comparison result;
a tenth processing submodule 50210, configured to obtain target attribute information of the second target received signal and target attribute information of the second target transmitted signal when the fourth comparison result is that the main body of the signal name of the first signal to be transmitted is the same as the main body of the signal name of a second target transmitted signal in the second target transmitted signal list;
the eleventh processing sub-module 50211 is configured to determine that the second target received signal and the second target transmitted signal are a target forwarding signal group if the target attribute information of the second target received signal is the same as the target attribute information of the second target transmitted signal;
the twelfth processing submodule 50212 is configured to store the CAN domain information of the second target received signal, the position of the second target received signal in the second target received signal list, the CAN domain information of the second signal to be sent, and the position of the second signal to be sent in the second target sent signal list in the signal address list.
Preferably, as the test apparatus described above, the second processing module 503 includes:
a thirteenth processing sub-module 5031, configured to perform environment model analysis sequentially according to the target forwarding signal group stored in each row in the signal address list, to obtain a first signal name corresponding to the target receiving signal and a second signal name corresponding to the target sending signal, where the first signal name carries path information of the target receiving signal and the second signal name carries path information of the target sending signal;
the fourteenth processing submodule 5032 is configured to generate a use case signal list according to each first signal name and each second signal name.
Specifically, as described above for the testing apparatus, the first processing module 502 further includes:
the fifteenth processing sub-module 50213 is configured to select a next first target received signal to compare with the first target transmitted signal in sequence if the first comparison result indicates that the signal name of any first target transmitted signal is different from the signal name of the first target received signal.
Further, as the test apparatus described above, the first processing module 502 further includes:
the sixteenth processing sub-module 50214 is configured to stop the comparison and generate a first prompt message for prompting the test engineer to check whether the DBC file and the network protocol of the CAN domain are correct or not if the second comparison result is that the target attribute information of the first target receiving signal is different from the target attribute information of the first target sending signal.
Specifically, as described above for the testing apparatus, the first processing module 502 further includes:
a seventeenth processing sub-module 50215, configured to stop comparing and generate a second prompt message for prompting a test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located, and the forwarding signal list are correct if the third comparison result indicates that the signal name of the first signal to be received is not the same as the signal name of the second target receiving signal in any one of the second target receiving signal lists.
Further, as the test apparatus described above, the first processing module 502 further includes:
the eighteenth processing sub-module 50216 is configured to, if the fourth comparison result indicates that the signal name of the first signal to be sent is not the same as the signal name of any second target sending signal in the second target sending signal list, stop the comparison and generate a third prompt message for prompting the test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located, and the forwarding signal list are correct.
Specifically, as described above for the testing apparatus, the first processing module 502 further includes:
the nineteenth processing sub-module 50217 is configured to generate fourth prompt information for prompting a test engineer to check whether the DBC file and the network protocol of the CAN domain where the DBC file is located are correct or not if the target attribute information of the second target received signal is different from the target attribute information of the second target transmitted signal.
The embodiment of the test device of the invention is a device corresponding to the embodiment of the method for generating the signal forwarding test case, and all implementation means in the embodiment of the method are suitable for the embodiment of the device, and the same technical effect can be achieved.
Yet another preferred embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for generating signal forwarding test cases as described above.
Still another preferred embodiment of the present invention also provides a test system, including: a test apparatus as described above.
In the embodiment of the invention, the test case is automatically generated by detecting the relation between the signals in DBC files in all CAN domains connected with the target controller and the forwarding signal list generated by technicians according to the autonomously determined target forwarding signal group before the test device performs the test, so that the complicated labor of determining and writing the target forwarding signal group one by adopting all the handwritten test cases is avoided, the writing speed and the accuracy of the test case are improved, and the test period is further shortened.
Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (20)

1. A method for generating signal forwarding test cases, comprising:
acquiring a forwarding signal list used for recording a first signal group to be forwarded, which needs to be forwarded by a target controller, and a database CAN file DBC of each controller area network CAN domain connected with the target controller;
determining a target forwarding signal group and generating a signal address list according to each DBC file and the forwarding signal list, wherein the target forwarding signal group comprises a target receiving signal and a target sending signal;
analyzing an environment model according to the signal address list, determining a path of each target forwarding signal group in the environment model, and generating a use case signal list;
and generating a test case according to the case signal list.
2. The method according to claim 1, wherein in the step of obtaining a forwarding signal list for recording a first group of signals to be forwarded, which are required to be forwarded by a target controller, the first group of signals to be forwarded includes: a first signal to be received and a first signal to be transmitted;
each row of the forwarding signal list records signal information of the first group of signals to be forwarded, and the signal information at least comprises: the signal name of the first signal to be received, the CAN domain information of the first signal to be received, the signal name of the first signal to be transmitted and the CAN domain information of the first signal to be transmitted.
3. The method of claim 2, wherein the step of determining a target forwarding signal group and generating a signal address list according to each DBC file and the forwarding signal list comprises:
storing a second signal to be received related to the target controller and attribute information of the second signal to be received in each DBC file into a received signal list corresponding to the DBC file, and storing a second signal to be transmitted related to the target controller and the attribute information of the second signal to be transmitted in each DBC file into a transmitted signal list corresponding to the DBC file, wherein the attribute information includes: the method comprises the following steps of (1) signal name, signal sending period, signal length, signal precision, signal offset, signal maximum value and signal minimum value;
sequentially selecting the received signal list corresponding to each DBC file as a first target received signal list, taking the transmitted signal lists corresponding to other DBC files except the selected DBC file as a first target transmitted signal list, and sequentially comparing a second signal to be received serving as a first target received signal in the first target received signal list with a second signal to be transmitted serving as a first target transmitted signal in the first target transmitted signal list to obtain a first comparison result;
if the first comparison result is that the main body of the signal name of the first target receiving signal is the same as the main body of the signal name of the first target sending signal, comparing the target attribute information of the first target receiving signal with the target attribute information of the first target sending signal to obtain a second comparison result, where the target attribute information includes: signal length, signal accuracy, signal offset, signal maximum and signal minimum;
if the second comparison result is that the target attribute information of the first target receiving signal is the same as the target attribute information of the first target sending signal, determining that the first target receiving signal and the first target sending signal are the target forwarding signal group;
and generating the signal address list according to the CAN domain information of the first target receiving signal, the position of the first target receiving signal in the first target receiving signal list, the CAN domain information of the first target receiving signal and the position of the first target sending signal in the first target sending signal list.
4. The method according to claim 3, wherein when the comparison of the first target received signal in each target received signal list is completed, the method further comprises:
selecting the received signal list positioned in the same CAN domain as a second target received signal list according to the CAN domain information of the first signal to be received in each row of the forwarded signal list;
comparing the signal name of the first signal to be received with the signal name of each second signal to be received serving as a second target received signal in the second target received signal list in sequence to obtain a third comparison result;
when the third comparison result is that the main body of the signal name of the first signal to be received is the same as the main body of the signal name of a second target received signal in the second target received signal list, selecting the transmitted signal list in the same CAN domain as a second target transmitted signal list according to the CAN domain information of the first target transmitted signal;
sequentially comparing the signal name of the first signal to be transmitted with the signal name of each second signal to be transmitted serving as a second target transmission signal in the second target transmission signal list to obtain a fourth comparison result;
when the fourth comparison result is that the main body of the signal name of the first signal to be transmitted is the same as the main body of the signal name of a second target transmission signal in the second target transmission signal list, acquiring the target attribute information of the second target reception signal and the target attribute information of the second target transmission signal;
if the target attribute information of the second target receiving signal is the same as the target attribute information of the second target transmitting signal, determining that the second target receiving signal and the second target transmitting signal are the target forwarding signal group;
and storing the CAN domain information of the second target receiving signal, the position of the second target receiving signal in the second target receiving signal list, the CAN domain information of the second signal to be sent and the position of the second signal to be sent in the second target sending signal list into the signal address list.
5. The method according to claim 3, wherein after the step of sequentially comparing the signal name of the second signal to be received in the first target received signal list as the first target received signal with the signal name of the second signal to be transmitted in the first target transmitted signal list as the first target transmitted signal to obtain the first comparison result, the method further comprises:
and if the first comparison result shows that the signal name of any first target sending signal is different from the signal name of the first target receiving signal, selecting the next first target receiving signal to sequentially compare with the first target sending signal.
6. The method according to claim 3, wherein after the step of comparing the target attribute information of the first target received signal with the target attribute information of the first target transmitted signal to obtain a second comparison result, the method further comprises:
and if the second comparison result is that the target attribute information of the first target receiving signal is different from the target attribute information of the first target sending signal, stopping comparison and generating first prompt information for reminding a test engineer to check whether the DBC file and the network protocol of the CAN domain are correct.
7. The method according to claim 4, wherein after the step of comparing the signal name of the first signal to be received with the signal name of each second signal to be received in the second target received signal list in sequence to obtain a third comparison result, the method further comprises:
and if the third comparison result shows that the signal name of the first signal to be received is not the same as the signal name of the second target received signal in any one of the second target received signal lists, stopping comparison and generating second prompt information for reminding a test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located and the forwarded signal list are correct.
8. The method according to claim 4, wherein after the step of sequentially comparing the signal name of the first signal to be transmitted with the signal name of the second signal to be transmitted in the second target transmission signal list to obtain a fourth comparison result, the method further comprises:
and if the fourth comparison result shows that the signal name of the first signal to be transmitted is not the same as the signal name of any second target transmission signal in the second target transmission signal list, stopping comparison and generating third prompt information for reminding a test engineer to check whether the DBC file, the network protocol of the CAN domain where the DBC file is located and the forwarding signal list are correct.
9. The method according to claim 4, wherein the step of obtaining the target attribute information of the second target received signal and the target attribute information of the second target transmitted signal is followed by further comprising:
and if the target attribute information of the second target receiving signal is different from the target attribute information of the second target sending signal, generating fourth prompt information for reminding a test engineer to check whether the DBC file and the network protocol of the CAN domain where the DBC file is located are correct.
10. The method of claim 1, wherein the step of performing environment model analysis on the signal address list, determining a path of each target forwarding signal group in an environment model, and generating a use case signal list comprises:
sequentially performing environment model analysis according to the target forwarding signal group stored in each row in the signal address list to obtain a first signal name corresponding to the target receiving signal and a second signal name corresponding to the target sending signal, wherein the first signal name carries path information of the target receiving signal, and the second signal name carries path information of the target sending signal;
and generating the use case signal list according to each first signal name and each second signal name.
11. The method according to claim 3, wherein the target number of rows of the test case is determined according to a theoretical number of rows and a preset number of test values, wherein the theoretical number of rows is determined according to the maximum value of the signal, the minimum value of the signal, and the accuracy of the signal by a first preset algorithm;
when the number of theoretical lines is less than or equal to the number of preset test values, the target number of lines is the number of theoretical lines, and values of the target receiving signal and the target sending signal are all values from a signal minimum value to a signal maximum value;
when the theoretical line number is greater than the preset test value number, the target line number is the preset test value number, and values of the target receiving signal and the target sending signal both include: the signal processing method comprises a maximum value of a signal, a minimum value of the signal, a first numerical value and a second numerical value, wherein the first numerical value is obtained through a second preset algorithm according to the maximum value of the signal and the signal precision, and the second numerical value is obtained through a third preset algorithm according to the minimum value of the signal and the signal precision.
12. The method of claim 11, wherein the first predetermined algorithm is:
P=(N1-N2)/W+1
wherein P is the number of theoretical rows;
N1is the maximum value of the signal;
N2is the minimum value of the signal;
w is the value of the signal accuracy.
13. The method of claim 11, wherein the second predetermined algorithm is:
Na1=N1-i1W
the third preset algorithm is as follows:
Na2=N2+i2W
wherein N isa1Is a first value;
Na2is a second value;
N1is the maximum value of the signal;
N2is the minimum value of the signal;
w is the value of signal precision;
i1sequentially taking natural numbers between 1 and (n-1)/2;
i2sequentially taking natural numbers between 1 and (n-2)/2;
and N is the number of preset test values.
14. The method of generating signal forwarding test cases of claim 10 wherein each row of said test cases comprises: the system comprises a timestamp, upper and lower electric signal addresses, a target receiving signal and a target sending signal;
wherein the time stamp is a sum of transmission periods of the target reception signal and the target transmission signal from a second row.
15. A test apparatus, comprising:
the system comprises an acquisition module, a forwarding module and a forwarding module, wherein the acquisition module is used for acquiring a forwarding signal list used for recording a first signal group to be forwarded, which needs to be forwarded by a target controller, and a database CAN file DBC of each controller area network CAN domain connected with the target controller;
the first processing module is used for determining a target forwarding signal group and generating a signal address list according to each DBC file and the forwarding signal list, wherein the target forwarding signal group comprises a target receiving signal and a target sending signal;
the second processing module is used for carrying out environmental model analysis according to the signal address list, determining a path of each target forwarding signal group in an environmental model and generating a use case signal list;
and the third processing module is used for generating a test case according to the case signal list.
16. The testing device of claim 15, wherein the first processing module comprises:
a first processing sub-module, configured to store attribute information of a second signal to be received and a second signal to be received, which are related to the target controller, in each DBC file into a received signal list corresponding to the DBC file, and store the attribute information of a second signal to be transmitted and the second signal to be transmitted, which are related to the target controller, in each DBC file into a transmitted signal list corresponding to the DBC file, where the attribute information includes: the method comprises the following steps of (1) signal name, signal sending period, signal length, signal precision, signal offset, signal maximum value and signal minimum value;
the second processing submodule is used for sequentially selecting the received signal list corresponding to each DBC file as a first target received signal list, taking the transmitted signal lists corresponding to other DBC files except the selected DBC file as a first target transmitted signal list, and sequentially comparing the signal name of a second signal to be received serving as a first target received signal in the first target received signal list with the signal name of a second signal to be transmitted serving as a first target transmitted signal in the first target transmitted signal list to obtain a first comparison result;
a third processing sub-module, configured to compare, if the first comparison result is that a main body of the signal name of the first target received signal is the same as a main body of the signal name of the first target transmitted signal, target attribute information of the first target received signal and the target attribute information of the first target transmitted signal, to obtain a second comparison result, where the target attribute information includes: signal length, signal accuracy, signal offset, signal maximum and signal minimum;
a fourth processing sub-module, configured to determine that the first target received signal and the first target transmitted signal are the target forwarding signal group if the second comparison result indicates that the target attribute information of the first target received signal is the same as the target attribute information of the first target transmitted signal;
and the fifth processing submodule is used for generating the signal address list according to the CAN domain information of the first target receiving signal, the position of the first target receiving signal in the first target receiving signal list, the CAN domain information of the first target receiving signal and the position of the first target sending signal in the first target sending signal list.
17. The testing device of claim 16, wherein the first processing module further comprises:
the sixth processing submodule is used for selecting the received signal list positioned in the same CAN domain as a second target received signal list according to the CAN domain information of the first signal to be received in each row of the forwarded signal list;
a seventh processing sub-module, configured to compare the signal name of the first signal to be received with the signal name of each second signal to be received serving as a second target received signal in the second target received signal list in sequence, so as to obtain a third comparison result;
an eighth processing submodule, configured to select, when the third comparison result is that a main body of the signal name of the first signal to be received is the same as a main body of a signal name of a second target received signal in the second target received signal list, the transmitted signal list located in the same CAN domain as the second target transmitted signal list according to the CAN domain information of the first target transmitted signal;
a ninth processing sub-module, configured to compare a signal name of the first signal to be transmitted with signal names of the second signals to be transmitted, which are in the second target transmission signal list and are each used as a second target transmission signal, in sequence, so as to obtain a fourth comparison result;
a tenth processing submodule, configured to obtain the target attribute information of the second target received signal and the target attribute information of the second target transmitted signal when the fourth comparison result is that a main body of the signal name of the first signal to be transmitted is the same as a main body of a signal name of a second target transmitted signal in the second target transmitted signal list;
an eleventh processing sub-module, configured to determine that the second target received signal and the second target transmitted signal are the target forwarding signal group if the target attribute information of the second target received signal is the same as the target attribute information of the second target transmitted signal;
a twelfth processing sub-module, configured to store, in the signal address list, the CAN domain information of the second target received signal, the position of the second target received signal in the second target received signal list, the CAN domain information of the second signal to be sent, and the position of the second signal to be sent in the second target sent signal list.
18. The testing device of claim 15, wherein the second processing module comprises:
a thirteenth processing sub-module, configured to perform environment model analysis sequentially according to the target forwarding signal group stored in each row in the signal address list, to obtain a first signal name corresponding to the target receiving signal and a second signal name corresponding to the target sending signal, where the first signal name carries path information of the target receiving signal and the second signal name carries path information of the target sending signal;
and a fourteenth processing submodule, configured to generate the use case signal list according to each of the first signal names and each of the second signal names.
19. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of generating signal-forwarding test cases according to any one of claims 1 to 14.
20. A test system, comprising: a test device according to any one of claims 15 to 18.
CN201811157784.3A 2018-09-30 2018-09-30 Method, device and test system for generating signal forwarding test case Active CN109327354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811157784.3A CN109327354B (en) 2018-09-30 2018-09-30 Method, device and test system for generating signal forwarding test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811157784.3A CN109327354B (en) 2018-09-30 2018-09-30 Method, device and test system for generating signal forwarding test case

Publications (2)

Publication Number Publication Date
CN109327354A CN109327354A (en) 2019-02-12
CN109327354B true CN109327354B (en) 2020-09-25

Family

ID=65266722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811157784.3A Active CN109327354B (en) 2018-09-30 2018-09-30 Method, device and test system for generating signal forwarding test case

Country Status (1)

Country Link
CN (1) CN109327354B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112147967A (en) * 2019-06-27 2020-12-29 北京新能源汽车股份有限公司 Automatic generation method and device for scene test case of automobile controller
CN113518015B (en) * 2021-04-08 2023-03-14 重庆长安汽车股份有限公司 Automatic realization method based on vehicle machine CAN network signal test

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8762784B1 (en) * 2005-12-22 2014-06-24 The Mathworks, Inc. Viewing multi-dimensional metric data from multiple test cases
CN106294138A (en) * 2016-07-29 2017-01-04 东软集团股份有限公司 Method for generating test case and device
CN107145140A (en) * 2017-05-18 2017-09-08 中国第汽车股份有限公司 Vehicle-mounted electronic control unit CAN interface Auto-Test System and its method of testing

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105262644B (en) * 2015-11-03 2018-08-21 株洲南车时代电气股份有限公司 A kind of universal test system and test method based on protocol configuration
CN107402880B (en) * 2016-05-20 2020-10-16 腾讯科技(北京)有限公司 Test method and electronic equipment
CN106330618A (en) * 2016-09-19 2017-01-11 中国第汽车股份有限公司 Gateway routing automatic test system and test method based on CAN/LIN/MOST hybrid buses
CN106484616B (en) * 2016-09-30 2019-05-14 北京新能源汽车股份有限公司 A kind of automatic interface testing method and device of entire car controller
CN106850372B (en) * 2017-02-22 2020-04-21 重庆长安新能源汽车科技有限公司 Method and system for testing controller CAN signal
CN107977317A (en) * 2017-12-22 2018-05-01 上海庆科信息技术有限公司 A kind of test method of data network, system and relevant apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8762784B1 (en) * 2005-12-22 2014-06-24 The Mathworks, Inc. Viewing multi-dimensional metric data from multiple test cases
CN106294138A (en) * 2016-07-29 2017-01-04 东软集团股份有限公司 Method for generating test case and device
CN107145140A (en) * 2017-05-18 2017-09-08 中国第汽车股份有限公司 Vehicle-mounted electronic control unit CAN interface Auto-Test System and its method of testing

Also Published As

Publication number Publication date
CN109327354A (en) 2019-02-12

Similar Documents

Publication Publication Date Title
CN108563214B (en) Vehicle diagnosis method, device and equipment
CN111371638B (en) Intelligent equipment testing method and device, server and storage medium
CN102222043B (en) Testing method and testing device
CN109522228B (en) Interface automation test data construction method, device, platform and storage medium
CN109327354B (en) Method, device and test system for generating signal forwarding test case
CN107179971B (en) Automatic coding method and system for CAN bus fault processing
CN111639002B (en) Sleep power consumption testing method, system, computer equipment and storage medium
CN109660533B (en) Method and device for identifying abnormal flow in real time, computer equipment and storage medium
CN105117345A (en) Interface testing method and device for application program
CN113608518A (en) Data generation method, device, terminal equipment and medium
CN114124694A (en) Configuration method and configuration device of Internet of things equipment, electronic equipment and medium
CN111796578A (en) Vehicle controller testing method, device and system and storage medium
CN115277882A (en) CAN message database establishing method and device, vehicle-mounted electronic equipment and storage medium
CN113133041B (en) Method and device for testing vehicle-to-vehicle communication function in dynamic interval train control vehicle
CN109088780A (en) A kind of signal detecting method and detection device
CN111598403B (en) Method and device for determining automobile test result, server and storage medium
CN112685311A (en) Test script automatic generation method and device, computer equipment and storage medium
CN111563037A (en) Test optimization method and device based on test questions, storage medium and terminal
CN110472345B (en) Post-processing system based on ABAQUS and implementation method
CN113985849A (en) Method for writing DTC (digital control channel) read ECU (electronic control unit) version of automatic clear-reading whole vehicle based on CANoe software
CN112561388A (en) Information processing method, device and equipment based on Internet of things
CN112306040A (en) Vehicle detection method, device, equipment and server
CN111983989A (en) Offline detection method and control equipment
CN117150995B (en) Driving source code tracking method, electronic equipment and medium
CN117971778A (en) File merging method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant