CN115567340B - CAN bus test engineering generation method, device, equipment and medium - Google Patents

CAN bus test engineering generation method, device, equipment and medium Download PDF

Info

Publication number
CN115567340B
CN115567340B CN202211160953.5A CN202211160953A CN115567340B CN 115567340 B CN115567340 B CN 115567340B CN 202211160953 A CN202211160953 A CN 202211160953A CN 115567340 B CN115567340 B CN 115567340B
Authority
CN
China
Prior art keywords
functional
input information
engineering
codes
bus
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
CN202211160953.5A
Other languages
Chinese (zh)
Other versions
CN115567340A (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.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile 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 Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202211160953.5A priority Critical patent/CN115567340B/en
Publication of CN115567340A publication Critical patent/CN115567340A/en
Application granted granted Critical
Publication of CN115567340B publication Critical patent/CN115567340B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • 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
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to the technical field of automobile testing, in particular to a method, a device, equipment and a storage medium for generating test engineering of a CAN bus, wherein the method comprises the following steps: determining a functional group of functions to be tested of the CAN bus; performing hierarchical decomposition on the test engineering script of the CAN bus according to the functional groups to obtain a functional program, and performing layer-by-layer assembly on the functional program to obtain a functional layer of the test engineering script; identifying the type and rule of the input information of each functional layer according to the functional group, extracting the prepositive information of the test engineering script based on the type and rule of the input information, generating the engineering codes and the system variables of each functional layer based on the prepositive information, and integrating the engineering codes and the codes of the system variables of all the functional layers to generate the script of the test engineering. Therefore, the problems of high workload, low construction efficiency, high labor cost and the like, which are caused by the need of manually constructing a test, are solved.

Description

CAN bus test engineering generation method, device, equipment and medium
Technical Field
The present application relates to the field of automobile testing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating a test project of a CAN bus.
Background
In vehicles, a real vehicle test is required, and most OEM (Original Equipment Manufacturer ) manufacturers currently perform a simulation test on a message test on a CAN (Controller Area Network ) bus by building a test bench with the help of professional bus hardware equipment and software tools before performing the real vehicle test. The CAN bus alarm sending analysis is an essential test content for simulation test. The CAN bus message is to be automated as far as possible, and is built without a test engineering.
In the related art, network node simulation and CAN message receiving and sending are realized by means of a bus development test tool, manual test and automatic test CAN be realized, but automatic test only considers automation of functions, and does not consider automation of test engineering construction per se, and with the increase of project complexity and the increase of CAN channel number, the manual construction of test engineering is more difficult, and the workload is increased.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for generating test engineering of a CAN bus, which are used for solving the problems that the test engineering is inconvenient to construct manually, the workload is overlarge and the like along with the increase of project complexity and CAN channel quantity in the related technology.
An embodiment of a first aspect of the present application provides a test engineering generating method for a CAN bus, including the steps of: determining a functional group of functions to be tested of the CAN bus; performing hierarchical decomposition on the test engineering script of the CAN bus according to the functional group to obtain a functional program, and performing layer-by-layer assembly on the functional program to obtain a functional layer of the test engineering script; identifying the type and rule of the input information of each functional layer according to the functional group, extracting the prepositive information of the test engineering script based on the type and rule of the input information, generating the engineering code and the system variable of each functional layer based on the prepositive information, and integrating the engineering codes and the codes of the system variables of all the functional layers to generate the script of the test engineering.
According to the technical means, the embodiment of the application carries out classification hierarchical processing on the test engineering test level, subdivides and assembles the test function level, optimizes the test engineering level, and facilitates automatic generation of the test engineering, so that the test engineering does not need to be manually built, the workload of building is reduced, and the building efficiency of the test engineering is improved.
Optionally, the identifying the type and rule of the input information of each functional layer according to the functional group includes: acquiring input information required by writing codes corresponding to each group of functions in the function group; classifying according to the input information required by each group of function writing codes, determining the type of the input information of each functional layer, extracting the functional logic of the input information required by each group of function writing codes according to the matrix table of the CAN bus, and obtaining the rule of the input information of each functional layer by utilizing the functional logic extraction.
According to the technical means, the embodiment of the application fully realizes the aim by combining the functions according to the CAN bus matrix table, refines the input information rule required by the construction of the test engineering, so that the generated input information is used as the automatic generation of the test engineering, the construction and maintenance efficiency of the test engineering is improved, and the labor cost is reduced.
Optionally, the extracting the pre-information of the test engineering script based on the type and rule of the input information includes: acquiring a generation code of the preamble information; and generating the preamble information corresponding to the type and rule of the input information by using the generation code.
According to the technical means, the embodiment of the application adopts the generation code to realize the one-key extraction and generation of the input information table from the CAN bus matrix table, so that a data source is conveniently provided for the automatic generation of the test engineering, and the dependence on the pre-information CAN be reduced.
Optionally, the generating the engineering code and the code of the system variable of each functional layer based on the pre-information includes: coding the pre-information by using a preset high-level programming language to obtain engineering codes of each functional layer; and writing codes of the pre-information by using definition rules of preset system variables and the preset high-level programming language to obtain codes of the system variables.
According to the technical means, the embodiment of the application CAN quickly complete the one-key generation of the multi-path CAN engineering script through the automatic generation of the code and the system variable code of the test engineering, the test engineering is newly built and maintained at low cost, and the multi-path bus matrix code generation CAN be realized in batches only by newly building and maintaining the same script, so that the maintenance cost of the test engineering is reduced and the construction efficiency is improved.
An embodiment of a second aspect of the present application provides a test engineering generating device for a CAN bus, including: the determining module is used for determining the function group of the function to be tested of the CAN bus; the packaging module is used for carrying out hierarchical decomposition on the test engineering script of the CAN bus according to the functional group to obtain a functional program, and carrying out layer-by-layer assembly on the functional program to obtain a functional layer of the test engineering script; the processing module is used for identifying the type and rule of the input information of each functional layer according to the functional group and extracting the prepositive information of the test engineering script based on the type and rule of the input information; and the generation module is used for generating engineering codes and system variables of each functional layer based on the pre-information, and integrating the engineering codes and the codes of the system variables of all the functional layers to generate the script of the test engineering.
Optionally, the processing module is further configured to: acquiring input information required by writing codes corresponding to each group of functions in the function group; classifying according to the input information required by each group of function writing codes, determining the type of the input information of each functional layer, extracting the functional logic of the input information required by each group of function writing codes according to the matrix table of the CAN bus, and obtaining the rule of the input information of each functional layer by utilizing the functional logic extraction.
Optionally, the processing module is further configured to: acquiring a generation code of the preamble information; and generating the preamble information corresponding to the type and rule of the input information by using the generation code.
Optionally, the generating module is further configured to: coding the pre-information by using a preset high-level programming language to obtain engineering codes of each functional layer; and writing codes of the pre-information by using definition rules of preset system variables and the preset high-level programming language to obtain codes of the system variables.
An embodiment of a third aspect of the present application provides an electronic device, including: the test engineering generation method of the CAN bus comprises a memory, a processor and a computer program which is stored in the memory and CAN run on the processor, wherein the processor executes the program to realize the test engineering generation method of the CAN bus.
An embodiment of a fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program that is executed by a processor for implementing the test engineering generation method of a CAN bus as described in the above embodiment.
Therefore, the application has at least the following beneficial effects:
(1) According to the embodiment of the application, the test function levels are subdivided and assembled by classifying and layering the test levels of the test engineering, so that the test engineering levels are optimized, and the test engineering is convenient to automatically generate, thus the test engineering is not required to be manually built, the workload of building is reduced, and the building efficiency of the test engineering is improved.
(2) According to the embodiment of the application, the aim is fully realized according to the CAN bus matrix table and the function, and the input information rule required by the construction of the test engineering is extracted, so that the generated input information is automatically generated as the test engineering, the construction and maintenance efficiency of the test engineering is improved, and the labor cost is reduced.
(3) The embodiment of the application adopts the generation code to realize the one-key extraction from the CAN bus matrix table to generate the input information table so as to provide a data source for the automatic generation of the test engineering and reduce the dependence on the pre-information.
(4) According to the embodiment of the application, the code of the test engineering and the system variable code are automatically generated, so that the one-key generation of the multi-path CAN engineering script CAN be rapidly completed, the test engineering is newly built and the maintenance cost is low, the multi-path bus matrix code generation CAN be realized in batches only by newly building and maintaining the same script, the maintenance cost of the test engineering is reduced, and the construction efficiency is improved.
Additional aspects and advantages of the application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flowchart of a test engineering generation method of a CAN bus provided in accordance with an embodiment of the application;
FIG. 2 is a code level division diagram provided in accordance with an embodiment of the present application;
FIG. 3 is a code integration block diagram provided in accordance with an embodiment of the present application;
fig. 4 is a flowchart of a test engineering generation method of a CAN bus according to an embodiment of the present application;
Fig. 5 is an exemplary diagram of a test engineering generating device of a CAN bus according to an embodiment of the present application;
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present application and should not be construed as limiting the application.
In the related art, a general test platform for an automobile electronic controller based on CANoe is provided, network node simulation and receiving and transmitting of CAN messages are realized by means of a bus development test tool, manual and automatic testing CAN be realized, but the automatic testing only considers the automation of functions, and does not consider the automation of the construction of test engineering. In practical projects, the complexity of the projects is higher and higher, the number of CAN channels is more and more, and the number of messages and signal quantities are more and more large, so that the manual construction of test engineering is more difficult, the workload is increased in multiple stages, and an automatic generation method of the test engineering based on a CAN bus is urgently needed to be explored.
The following describes a test engineering generation method, a device, an electronic device and a storage medium of a CAN bus according to an embodiment of the present application with reference to the accompanying drawings. Aiming at the problems that the complexity of projects and the number of CAN channels are increased, and the message and the signal quantity are larger and larger, so that the manual construction of test engineering is more difficult and the workload is large, the application provides a test engineering generation method of a CAN bus. Therefore, the problems that in the related art, a test project needs to be built manually, the workload is overlarge, the building efficiency is low and the like are solved.
Specifically, fig. 1 is a schematic flow chart of a test engineering generation method of a CAN bus according to an embodiment of the present application.
As shown in fig. 1, the test engineering generation method of the CAN bus includes the following steps:
in step S101, a functional group of functions to be tested of the CAN bus is determined.
The functional grouping may be performed according to specific situations, which is not limited, for example: the functional major classes can be classified into message, signal, CRC, DTC and the like, and then the functional major classes are respectively subjected to refinement and decomposition, and the message processing related can be classified into message definition, message event message processing, message period message processing and the like.
It will be appreciated that the functions to be tested of the CAN bus need to be grouped for subsequent testing.
In step S102, the test engineering script of the CAN bus is decomposed hierarchically according to the functional group to obtain a functional program, and the functional program is assembled layer by layer to obtain a functional layer of the test engineering script.
The method is characterized in that a mode similar to C language file reference is adopted, the grouped functional programs are assembled layer by layer, so that single functions are single as much as possible, and the engineering implementation program is clear in level.
It should be noted that the existing test function hierarchy is not clear, each function implementation program is mixed in one file, the functions are not layered, and the automatic generation of test engineering is inconvenient, so the test engineering hierarchy is subdivided and assembled fully according to the characteristics of different functions, and the test functions are automatically generated.
In step S103, the type and rule of the input information of each functional layer are identified according to the functional group, the preamble information of the test engineering script is extracted based on the type and rule of the input information, the engineering code and the system variable of each functional layer are generated based on the preamble information, and the script of the test engineering is generated by integrating the engineering codes and the codes of the system variables of all functional layers.
The recognition and refinement of the input information rule are prerequisites for automatically generating the test engineering, and the input information rule required by the construction of the test engineering is refined by fully realizing the target according to the CAN bus matrix table and combining the functions.
It should be noted that, according to the above-mentioned division of the functional layers, the engineering codes of each functional layer are different, as shown in fig. 2, the engineering codes of all functional layers and the codes of the system variables are integrated, and only the original input file needs to be updated, so that one code can be implemented to complete the engineering script one-key generation of the multi-path bus message. If only one path of bus message is changed, only the engineering script corresponding to the path of bus message can be updated and generated.
In the embodiment of the application, the type and rule of the input information of each functional layer are identified according to the functional group, and the method comprises the following steps: acquiring input information required by writing codes corresponding to each group of functions in the function group; classifying according to the input information required by each group of function writing codes, determining the type of the input information of each functional layer, extracting the functional logic of the input information required by each group of function writing codes according to the matrix table of the CAN bus, and extracting the rule of the input information of each functional layer by utilizing the functional logic.
According to the grouping of the functions, the test engineering codes required to be written for different functional groupings analyze and arrange required input information, such as: aiming at bus message transmission, the method needs to use message transmission, message ID, message period, message DLC length, crcCounter signal name, crc-ID, CRCCheck signal name, bytes segments to which crc belongs, and the like; for signal processing, a signal sender, a signal name, a message ID to which a signal belongs, a signal initial value, and the like are required.
It can be understood that, according to the input information of each function, the rules of corresponding analysis and extraction of the input information of the corresponding function are combined with the input information sources (such as a signal matrix table), such as: the message sending distinguishes the message sent by the controller from the message sent by the controller, and screening and extracting are carried out according to the message sender. CRC (cyclic redundancy check) accurately obtains the extraction rule of information required by CRC according to the signal naming characteristics, CRC signal length characteristics, chinese naming characteristics and the like of the CRC.
In the embodiment of the application, the extraction of the pre-information of the test engineering script based on the type and rule of the input information comprises the following steps: acquiring a generating code of the pre-information; and generating the preamble information corresponding to the type and rule of the input information by using the generation code.
It will be appreciated that based on the refined type and rule of input information set forth in the above embodiments, one-touch automatic extraction of input information is implemented in a high-level programming language based on the source of the input information (e.g., signal matrix table).
The signal matrix table has a plurality of contents and is complicated, and a plurality of contents are irrelevant to the construction of the test engineering, and the input information is automatically generated by extracting the rule and one key, so that the preamble information required by the construction of the test engineering can be quickly obtained. The method of generating the input information and generating the engineering code according to the input information can reduce the coupling degree of the code and increase the stability of the code. In the early stage of the project, the input information sources (such as a signal matrix table) are frequently updated, and the input information changes along with the change of the signal sources. At this time, only the codes for automatically generating the input information need to be adapted and updated, the subsequent code processing logic can be kept inconvenient, the code coupling degree is reduced, and the maintenance cost of the test engineering is reduced as much as possible.
In an embodiment of the present application, generating engineering codes and codes of system variables for each functional layer based on the pre-information includes: coding the pre-information by using a preset high-level programming language to obtain engineering codes of each functional layer; and writing codes of the pre-information by using definition rules of preset system variables and a preset high-level programming language to obtain codes of the system variables.
The engineering codes are obtained by coding automatically generated input information through a high-level programming language, and the codes of the system variables are generated by combining rules defined by the engineering variables according to the automatically generated input information and adopting the high-level programming language to quickly realize one-key generation of the system variables.
It should be noted that although the messages distinguish between ID and signal names, the sending processing logic of the messages in the test engineering is similar, so that the processing logic is extracted, and then a function logic is processed by using the same function by adopting a high-level programming language according to the automatically generated input information, a plurality of messages call the same function, so that the generation of engineering codes by one key is quickly realized, and the integrated block diagram of the codes is shown in fig. 3.
The following describes a test engineering generation method of the CAN bus according to a specific embodiment, as shown in fig. 4, and the steps are as follows:
1. Optimizing existing test engineering levels
Firstly, the functions to be realized are grouped and classified according to the functional characteristics, and the test engineering script is decomposed in a hierarchical manner according to the functional groups. For example, the functional major classes are classified into message, signal, CRC, DTC according to the functional major classes, and then the functional major classes are respectively refined and decomposed, and the message processing related can be classified into message definition, message event message processing, message period message processing and the like.
Secondly, the grouped functional programs are assembled layer by layer in a mode similar to the reference of the C language header file, so that single functions are single as much as possible, and the engineering implementation program has clear level.
2. Refining rules of input information
And in combination with the functional groups in 1, analyzing and sorting required input information aiming at test engineering codes required to be written for different functional groups. For example, for bus messaging, a message sender, a message ID, a message period, a message DLC length, crcCounter signal names, crc-IDs, CRCCheck signal names, bytes segments to which crc belongs, etc. are required. For signal processing, a signal sender, a signal name, a message ID to which a signal belongs, a signal initial value, and the like are required.
According to the input information of each function, the input information sources (such as a signal matrix table) are combined, and the rules of corresponding function input information are correspondingly analyzed and refined. For example, the message sending distinguishes the message sent by the controller from the message sent by the controller, and the screening and extraction are performed according to the sender of the message. CRC (cyclic redundancy check) accurately obtains the extraction rule of information required by CRC according to the signal naming characteristics, CRC signal length characteristics, chinese naming characteristics and the like of the CRC.
3. Automatically generating input information
And 2, combining the type and rule of the input information extracted in the step 2, and adopting a high-level programming language to realize one-key automatic extraction of the input information according to the source (such as a signal matrix table) of the input information.
4. Automatic generation of engineering codes
And automatically generating corresponding engineering codes by adopting a high-level programming language according to the input information automatically generated in step 3.
5. Automatic generation of system variables
The system variable plays a very important role in the CAN bus test, and the value of a bus signal is usually changed by modifying the value of the system variable, so that the corresponding relation exists between the system variable and the signal, the more the signal quantity is operated, the more the system variable is operated, and the time for manually defining a large number of system variables is complicated. And according to the automatically generated input information 3, combining with rules defined by engineering system variables, and adopting a high-level programming language to quickly realize one-key generation of the system variables. The input sources of 4 and 5 are 3, so that the system variable names can be well consistent with the signal names, and only the rule attribute of the system variable is required to be additionally added, thereby improving the readability of codes.
6. Code integration
And integrating the codes generated in 3, 4 and 5, and only updating an original input file (such as a signal matrix table) to realize one-key generation of the engineering script of the multi-path bus message by one code. If only one path of bus message is changed, only the engineering script corresponding to the path of bus message can be updated and generated.
According to the test engineering generation method of the CAN bus, provided by the embodiment of the application, the test engineering test levels are classified and layered, the test function levels are subdivided and assembled, the test engineering levels are optimized, and the test engineering is convenient to automatically generate, so that the test engineering is not required to be manually built, the building workload is reduced, and the building efficiency of the test engineering is improved; fully according to the CAN bus matrix table, combining with functions to achieve targets, refining input information rules required by test engineering construction so as to facilitate the automatic generation of generated input information as test engineering, improving the efficiency of test engineering construction and maintenance and reducing labor cost; the generation codes are adopted to realize the one-key extraction and generation of the input information table from the CAN bus matrix table, so that a data source is conveniently provided for the automatic generation of the test engineering, and the dependence on the pre-information CAN be reduced; by automatically generating the codes of the test engineering and the system variable codes, the one-key generation of the multi-path CAN engineering script CAN be completed rapidly, the test engineering is newly built and the maintenance cost is low, the multi-path bus matrix codes CAN be generated in batches only by newly building and maintaining the same script, the maintenance cost of the test engineering is reduced, and the construction efficiency is improved.
Next, a test engineering generating device for a CAN bus according to an embodiment of the present application will be described with reference to the accompanying drawings.
Fig. 5 is a block schematic diagram of a test engineering generation device of a CAN bus according to an embodiment of the present application.
As shown in fig. 5, the test engineering generation device 10 of the CAN bus includes: the system comprises a determining module 100, a packaging module 200, a processing module 300 and a generating module 400.
The determining module 100 is used for determining a function group of functions to be tested of the CAN bus; the packaging module 200 is used for performing hierarchical decomposition on the test engineering script of the CAN bus according to the functional group to obtain a functional program, and performing layer-by-layer assembly on the functional program to obtain a functional layer of the test engineering script; the processing module 300 is configured to identify a type and a rule of input information of each functional layer according to the functional group, and extract pre-information of the test engineering script based on the type and the rule of the input information; the generating module 400 is configured to generate engineering codes and system variables of each functional layer based on the pre-information, and integrate the engineering codes and the codes of the system variables of all the functional layers to generate scripts of the test engineering.
Further, the processing module 300 is further configured to: acquiring input information required by writing codes corresponding to each group of functions in the function group; classifying according to the input information required by each group of function writing codes, determining the type of the input information of each functional layer, extracting the functional logic of the input information required by each group of function writing codes according to the matrix table of the CAN bus, and extracting the rule of the input information of each functional layer by utilizing the functional logic.
In an embodiment of the present application, the processing module 300 is further configured to: acquiring a generating code of the pre-information; and generating the preamble information corresponding to the type and rule of the input information by using the generation code.
In an embodiment of the present application, the generating module 400 is further configured to: coding the pre-information by using a preset high-level programming language to obtain engineering codes of each functional layer; and writing codes by using definition rules of preset system variables and preset advanced programming language pre-information to obtain codes of the system variables.
It should be noted that the foregoing explanation of the embodiment of the method for generating the test engineering of the CAN bus is also applicable to the device for generating the test engineering of the CAN bus of this embodiment, and will not be repeated here.
According to the test engineering generating device of the CAN bus, provided by the embodiment of the application, the test engineering levels are optimized, the functions realized by engineering programs are clear at a glance, the corresponding relation between codes and functions of each level is clearer, and the coupling degree between function modules is reduced; the dependence on the pre-information can be reduced, and the automatic generation of the test engineering can be realized through the original input information such as the communication matrix before a specific functional test range is not taken, so that the time for constructing the test engineering and verifying the link is advanced; the multi-path CAN engineering script one-key generation CAN be completed rapidly, the test engineering is small in new construction and maintenance cost, the multi-path bus matrix code generation CAN be realized in batches only by newly constructing and maintaining the same script, and the engineering construction time is not increased along with the increase of message semaphores; the flexibility is strong, a certain bus signal is changed, and the generation of the bus test engineering script can be completed by one key; the engineering construction experience can be well accumulated, the history engineering codes can be inherited and reused by the subsequent similar projects, and only the logic change part is needed to be changed, so that the engineering construction period is greatly shortened.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device may include:
a memory 601, a processor 602, and a computer program stored on the memory 601 and executable on the processor 602.
The processor 602 implements the test engineering generation method of the CAN bus provided in the above embodiment when executing a program.
Further, the electronic device further includes:
a communication interface 603 for communication between the memory 601 and the processor 602.
A memory 601 for storing a computer program executable on the processor 602.
The memory 601 may comprise high-speed RAM (Random Access Memory ) memory, and may also include non-volatile memory, such as at least one disk memory.
If the memory 601, the processor 602, and the communication interface 603 are implemented independently, the communication interface 603, the memory 601, and the processor 602 may be connected to each other through a bus and perform communication with each other. The bus may be an ISA (Industry Standard Architecture ) bus, a PCI (PERIPHERAL COMPONENT, external device interconnect) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is shown in fig. 6, but not only one bus or one type of bus.
Alternatively, in a specific implementation, if the memory 601, the processor 602, and the communication interface 603 are integrated on a chip, the memory 601, the processor 602, and the communication interface 603 may perform communication with each other through internal interfaces.
The processor 602 may be a CPU (Central Processing Unit ) or an ASIC (Application SPECIFIC INTEGRATED Circuit, application specific integrated Circuit) or one or more integrated circuits configured to implement embodiments of the present application.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the test engineering generation method of the CAN bus.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or N embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, "N" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more N executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the N steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable gate arrays, field programmable gate arrays, and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (9)

1. The test engineering generation method of the CAN bus is characterized by comprising the following steps of:
Determining a functional group of functions to be tested of the CAN bus;
performing hierarchical decomposition on the test engineering script of the CAN bus according to the functional group to obtain a functional program, and performing layer-by-layer assembly on the functional program to obtain a functional layer of the test engineering script;
Identifying the type and rule of input information of each functional layer according to the functional group, extracting the prepositive information of the test engineering script based on the type and rule of the input information, generating engineering codes and system variables of each functional layer based on the prepositive information, and generating the script of the test engineering by integrating the engineering codes and the codes of the system variables of all the functional layers;
the identifying the type and the rule of the input information of each functional layer according to the functional group comprises the following steps:
Acquiring input information required by writing codes corresponding to each group of functions in the function group;
classifying according to the input information required by each group of function writing codes, determining the type of the input information of each functional layer, extracting the functional logic of the input information required by each group of function writing codes according to the matrix table of the CAN bus, and obtaining the rule of the input information of each functional layer by utilizing the functional logic extraction.
2. The method of claim 1, wherein the extracting the preamble information of the test engineering script based on the type and rule of the input information comprises:
acquiring a generation code of the preamble information;
And generating the preamble information corresponding to the type and rule of the input information by using the generation code.
3. The method of claim 1, wherein generating engineering code and code for system variables for each functional layer based on the pre-information comprises:
coding the pre-information by using a preset high-level programming language to obtain engineering codes of each functional layer;
and writing codes of the pre-information by using definition rules of preset system variables and the preset high-level programming language to obtain codes of the system variables.
4. The utility model provides a test engineering generating device of CAN bus which characterized in that includes:
the determining module is used for determining the function group of the function to be tested of the CAN bus;
the packaging module is used for carrying out hierarchical decomposition on the test engineering script of the CAN bus according to the functional group to obtain a functional program, and carrying out layer-by-layer assembly on the functional program to obtain a functional layer of the test engineering script;
The processing module is used for identifying the type and rule of the input information of each functional layer according to the functional group and extracting the prepositive information of the test engineering script based on the type and rule of the input information;
the generation module is used for generating engineering codes and system variables of each functional layer based on the pre-information, and integrating the engineering codes and the codes of the system variables of all the functional layers to generate scripts of the test engineering;
the identifying the type and the rule of the input information of each functional layer according to the functional group comprises the following steps:
Acquiring input information required by writing codes corresponding to each group of functions in the function group;
classifying according to the input information required by each group of function writing codes, determining the type of the input information of each functional layer, extracting the functional logic of the input information required by each group of function writing codes according to the matrix table of the CAN bus, and obtaining the rule of the input information of each functional layer by utilizing the functional logic extraction.
5. The apparatus of claim 4, wherein the processing module is further to:
Acquiring input information required by writing codes corresponding to each group of functions in the function group;
classifying according to the input information required by each group of function writing codes, determining the type of the input information of each functional layer, extracting the functional logic of the input information required by each group of function writing codes according to the matrix table of the CAN bus, and obtaining the rule of the input information of each functional layer by utilizing the functional logic extraction.
6. The apparatus of claim 4, wherein the processing module is further to:
acquiring a generation code of the preamble information;
And generating the preamble information corresponding to the type and rule of the input information by using the generation code.
7. The apparatus of claim 4, wherein the generating module is further configured to:
coding the pre-information by using a preset high-level programming language to obtain engineering codes of each functional layer;
and writing codes of the pre-information by using definition rules of preset system variables and the preset high-level programming language to obtain codes of the system variables.
8. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor executing the program to implement the test engineering generation method of the CAN bus of any one of claims 1-3.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that the program is executed by a processor for implementing the test engineering generation method of a CAN bus as claimed in any one of claims 1-3.
CN202211160953.5A 2022-09-22 2022-09-22 CAN bus test engineering generation method, device, equipment and medium Active CN115567340B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211160953.5A CN115567340B (en) 2022-09-22 2022-09-22 CAN bus test engineering generation method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211160953.5A CN115567340B (en) 2022-09-22 2022-09-22 CAN bus test engineering generation method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN115567340A CN115567340A (en) 2023-01-03
CN115567340B true CN115567340B (en) 2024-04-26

Family

ID=84741300

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211160953.5A Active CN115567340B (en) 2022-09-22 2022-09-22 CAN bus test engineering generation method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115567340B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08235024A (en) * 1995-02-28 1996-09-13 Toshiba Corp Automatic test device for software
CN1767453A (en) * 2004-10-31 2006-05-03 中兴通讯股份有限公司 Automatic test method and system
KR20090028366A (en) * 2007-09-14 2009-03-18 주식회사 신한은행 System and method for testing program source code and program recording medium
CN103455422A (en) * 2013-08-30 2013-12-18 上海斐讯数据通信技术有限公司 Software function automatic testing method
JP2019121265A (en) * 2018-01-10 2019-07-22 富士通株式会社 Verification procedure generation program, verification procedure generation method and verification procedure generation device
CN112306042A (en) * 2020-10-30 2021-02-02 重庆长安汽车股份有限公司 Automatic test system and method for automatic driving controller
CN112667494A (en) * 2020-12-08 2021-04-16 上海纳恩汽车技术股份有限公司 Automobile UDS automatic testing method and system based on configuration table and storage medium
CN113419946A (en) * 2021-05-31 2021-09-21 西南电子技术研究所(中国电子科技集团公司第十研究所) Ice interface test case and test script automatic generation method
CN113535581A (en) * 2021-07-30 2021-10-22 东风商用车有限公司 Test script generation method, device, equipment and computer readable storage medium
JP2021189570A (en) * 2020-05-26 2021-12-13 富士通株式会社 Scenario generation program, test management device, scenario generation method, and system
CN114924737A (en) * 2022-03-18 2022-08-19 中国第一汽车股份有限公司 Battery management system source code integration test method and device and electronic equipment
CN115017050A (en) * 2022-06-23 2022-09-06 际络科技(上海)有限公司 Automatic driving test scene generation system and method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10317431A1 (en) * 2003-04-15 2004-10-28 Rood Technology Deutschland Gmbh + Co Procedure for generating tester controls
JP4148527B2 (en) * 2006-06-05 2008-09-10 インターナショナル・ビジネス・マシーンズ・コーポレーション Functional test script generator
US11269760B2 (en) * 2020-01-02 2022-03-08 Accenture Global Solutions Limited Systems and methods for automated testing using artificial intelligence techniques

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08235024A (en) * 1995-02-28 1996-09-13 Toshiba Corp Automatic test device for software
CN1767453A (en) * 2004-10-31 2006-05-03 中兴通讯股份有限公司 Automatic test method and system
KR20090028366A (en) * 2007-09-14 2009-03-18 주식회사 신한은행 System and method for testing program source code and program recording medium
CN103455422A (en) * 2013-08-30 2013-12-18 上海斐讯数据通信技术有限公司 Software function automatic testing method
JP2019121265A (en) * 2018-01-10 2019-07-22 富士通株式会社 Verification procedure generation program, verification procedure generation method and verification procedure generation device
JP2021189570A (en) * 2020-05-26 2021-12-13 富士通株式会社 Scenario generation program, test management device, scenario generation method, and system
CN112306042A (en) * 2020-10-30 2021-02-02 重庆长安汽车股份有限公司 Automatic test system and method for automatic driving controller
CN112667494A (en) * 2020-12-08 2021-04-16 上海纳恩汽车技术股份有限公司 Automobile UDS automatic testing method and system based on configuration table and storage medium
CN113419946A (en) * 2021-05-31 2021-09-21 西南电子技术研究所(中国电子科技集团公司第十研究所) Ice interface test case and test script automatic generation method
CN113535581A (en) * 2021-07-30 2021-10-22 东风商用车有限公司 Test script generation method, device, equipment and computer readable storage medium
CN114924737A (en) * 2022-03-18 2022-08-19 中国第一汽车股份有限公司 Battery management system source code integration test method and device and electronic equipment
CN115017050A (en) * 2022-06-23 2022-09-06 际络科技(上海)有限公司 Automatic driving test scene generation system and method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Coverage-directed test generation through automatic constraint extraction;Onur Guzey et al.;2007 IEEE International high level design validation and test workshop;20071210;全文 *
基于CAN/LIN总线的车载网关自动化测试系统设计;梁晨一;;农业装备与车辆工程;20201010(第10期);全文 *
基于样本程序的自动化测试工具;王津;左春;张正;;计算机工程;20200421(第03期);全文 *

Also Published As

Publication number Publication date
CN115567340A (en) 2023-01-03

Similar Documents

Publication Publication Date Title
CN110554958B (en) Graph database testing method, system, device and storage medium
US20060101331A1 (en) Methods and systems for automated test-case generation
CN113189970B (en) Hardware-in-loop automatic test method and system of CAN bus controller and storage medium
CN110244688A (en) Meter bus panel automatic generation method and its system based on LabVIEW
CN114326659A (en) Fault diagnosis system and method for automobile electronic control unit
CN114460925B (en) Automatic test method for CAN interface HIL of electric automobile controller
CN115567340B (en) CAN bus test engineering generation method, device, equipment and medium
CN113448590A (en) Method and device for quickly generating remote control injection data, computer equipment and medium
CN116521217A (en) Method, system and storage medium for rapidly configuring BSW based on AUTOSAR tool
CN114780326B (en) Cross-platform calibration test method, device and equipment
CN115470100A (en) Signal scene testing method and device for automobile parts
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
CN114329090A (en) Path reference searching method and device, electronic equipment and storage medium
CN113672509A (en) Automatic testing method, device, testing platform and storage medium
CN116991706B (en) Vehicle automatic test method, device, equipment and storage medium
CN114448851B (en) Automatic data testing method and system
US20220415101A1 (en) Method and Device for the Computer-Supported Monitoring of the Operation of a Vehicle Service
CN111563033B (en) Simulation data generation method and device
CN117667680A (en) Use case testing method, system, equipment and storage medium
CN117193849A (en) File generation method and device, electronic equipment and readable storage medium
CN115828804A (en) Method for modifying RTL source code file and electronic equipment
CN115859410A (en) Model management method and device
CN117785267A (en) DBC file repairing method and device and electronic equipment
CN112800729A (en) Automatic generation and application method and tool for physical and chemical detection model
CN114326674A (en) ECU (electronic control Unit) flashing method and device, electronic equipment and 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