CN115567340A - Test engineering generation method, device, equipment and medium of CAN bus - Google Patents

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

Info

Publication number
CN115567340A
CN115567340A CN202211160953.5A CN202211160953A CN115567340A CN 115567340 A CN115567340 A CN 115567340A CN 202211160953 A CN202211160953 A CN 202211160953A CN 115567340 A CN115567340 A CN 115567340A
Authority
CN
China
Prior art keywords
engineering
input information
bus
test
functional
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.)
Granted
Application number
CN202211160953.5A
Other languages
Chinese (zh)
Other versions
CN115567340B (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

Images

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 test engineering generation method, a device, equipment and a storage medium of a CAN bus, wherein the method comprises the following steps: determining a function group of a function 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 assembling the functional program layer by layer to obtain a functional layer of the test engineering script; identifying the type and the rule of input information of each functional layer according to the functional groups, extracting the preposed information of the test engineering script based on the type and the rule of the input information, generating an engineering code and a system variable of each functional layer based on the preposed information, and integrating the engineering codes of all the functional layers and codes of the system variables to generate the script of the test engineering. Therefore, the problems that manual setting up test is needed, the workload is large, the setting up efficiency is low, the labor cost is high and the like are solved.

Description

Test engineering generation method, device, equipment and medium of CAN bus
Technical Field
The present disclosure relates to the field of automotive testing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating a test engineering of a CAN bus.
Background
In a vehicle, a real-time test needs to be performed on the vehicle, and most of current OEM (Original Equipment Manufacturer) manufacturers build a test bench to perform a simulation test on a message test on a CAN (Controller Area Network) bus by means of a professional bus hardware device and a software tool before performing the real-time test. The CAN bus break sending analysis is the essential test content for the simulation test. The CAN bus message is required to be automated as much as possible, and the test engineering construction is not required.
In the related technology, 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 the automatic test only considers the automation of functions and does not consider the automation of test engineering construction, and the manual construction of the test engineering is more difficult and the workload is increased along with the increase of the project complexity and the increase of the number of CAN channels.
Disclosure of Invention
The application provides a test engineering generation method, a test engineering generation device, test engineering generation equipment and a storage medium of a CAN bus, and aims to solve the problems that test engineering is inconvenient to manually set up and the workload is too large and the like along with the increase of project complexity and the number of CAN channels in the related technology.
An embodiment of a first aspect of the present application provides a test engineering generation method for a CAN bus, including the following steps: determining a function group of a function to be tested of the CAN bus; carrying out hierarchical decomposition on the test engineering script of the CAN bus according to the functional groups to obtain a functional program, and assembling the functional program layer by layer to obtain a functional layer of the test engineering script; and identifying the type and the rule of input information of each functional layer according to the functional groups, extracting the preposed information of the test engineering script based on the type and the rule of the input information, generating an engineering code and a system variable of each functional layer based on the preposed information, and integrating the engineering codes and the system variables of all the functional layers to generate the script of the test engineering.
According to the technical means, the test engineering test levels are classified and processed in a hierarchical mode, the test function levels are subdivided and assembled, the test engineering levels are optimized, the test engineering is automatically generated conveniently, the test engineering does not need to be manually built, the building workload is reduced, and the building efficiency of the test engineering is improved.
Optionally, the identifying the type and the rule of the input information of each functional layer according to the functional group includes: acquiring input information required when codes corresponding to each group of functions in the functional groups are compiled; classifying according to the input information required by each group of function compiling codes, determining the type of the input information of each functional layer, extracting the function logic of the input information required by each group of function compiling 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 function logic extraction.
According to the technical means, the method and the device have the advantages that the target is realized by combining functions and refining the input information rule required by the test engineering construction fully according to the CAN bus matrix table, so that the generated input information is automatically generated as the test engineering in the follow-up process, the efficiency of the test engineering construction and maintenance is improved, and the labor cost is reduced.
Optionally, the extracting the pre-information of the test engineering script based on the type and the rule of the input information includes: acquiring a generation code of the front information; and generating the front information corresponding to the type and the rule of the input information by using the generated code.
According to the technical means, the embodiment of the application adopts the generated code to realize one-key extraction and generation of the input information table from the CAN bus matrix table, so that a data source is provided for automatic generation of a test project, and the dependence on the front information CAN be reduced.
Optionally, the generating the engineering code and the system variable of each functional layer based on the preposition information includes: coding the prepositive information by using a preset high-level programming language to obtain an engineering code of each functional layer; and coding the preposed information by using a definition rule of a preset system variable and the preset high-level programming language to obtain a code of the system variable.
According to the technical means, the multi-path CAN engineering script generation CAN be completed quickly by automatically generating the code of the test engineering and the system variable code, the test engineering new construction and maintenance cost is low, the multi-path bus matrix code generation CAN be realized in batch only by newly constructing and maintaining the same script, the test engineering maintenance cost 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 groups to obtain a functional program, and assembling the functional program layer by layer to obtain a functional layer of the test engineering script; the processing module is used for identifying the type and the rule of input information of each functional layer according to the functional groups and extracting the preposed information of the test engineering script based on the type and the rule of the input information; and the generating module is used for generating the engineering codes and the system variables of each functional layer based on the prepositive information, and integrating the engineering codes and 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 when codes corresponding to each group of functions in the functional groups are compiled; classifying according to the input information required by each group of function compiling codes, determining the type of the input information of each functional layer, extracting the function logic of the input information required by each group of function compiling 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 function logic.
Optionally, the processing module is further configured to: acquiring a generation code of the front information; and generating the front information corresponding to the type and the rule of the input information by using the generated code.
Optionally, the generating module is further configured to: coding the prepositive information by using a preset high-level programming language to obtain an engineering code of each functional layer; and coding the preposed information by using a definition rule of a preset system variable and the preset high-level programming language to obtain a code of the system variable.
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 on 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 according to the embodiment.
A fourth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor, so as to implement the test engineering generating method for a CAN bus according to the foregoing embodiments.
Therefore, the application has at least the following beneficial effects:
(1) The embodiment of the application classifies and hierarchically processes the testing levels of the testing engineering, subdivides and assembles the testing function levels, optimizes the testing engineering levels, facilitates automatic generation of the testing engineering, and accordingly does not need manual construction of the testing engineering, reduces construction workload and improves construction efficiency of the testing engineering.
(2) According to the CAN bus matrix table, the target is realized by combining functions, and the required input information rule is built in the test engineering, so that the subsequent input information generated is automatically generated as the test engineering, the efficiency of building and maintaining the test engineering is improved, and the labor cost is reduced.
(3) The embodiment of the application adopts the generated code to realize one-key extraction and generation of the input information table from the CAN bus matrix table, so that a data source is provided for automatic generation of a test project, and the dependence on the preposed information CAN be reduced.
(4) According to the embodiment of the application, the multi-path CAN engineering script CAN be generated by one key quickly through automatic generation of the code of the test engineering and the system variable code, the test engineering is newly built and is low in maintenance cost, the generation of the multi-path bus matrix code 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 building efficiency is improved.
Additional aspects and advantages of the present 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 present application.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a test engineering generation method for a CAN bus according to an embodiment of the present disclosure;
FIG. 2 is a code hierarchy partitioning diagram provided in accordance with an embodiment of the present application;
FIG. 3 is a block diagram of code integration provided in accordance with an embodiment of the present application;
fig. 4 is a flowchart of a test engineering generation method for a CAN bus according to an embodiment of the present disclosure;
fig. 5 is an exemplary diagram of a test engineering generation apparatus for a CAN bus provided 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
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The CANoe-based general test platform for the automobile electronic controller is provided in the related technology, network node simulation and CAN message receiving and sending are realized by means of a bus development test tool, manual and automatic test CAN be realized, but the automatic test only considers the automation of functions and does not consider the automation of test engineering construction. In actual projects, the complexity of the project is higher and higher, the number of CAN channels is more and more, and the message and signal quantity is larger and larger, so that the manual construction of the test project is more and more difficult, the workload is multiplied by several times, and an automatic test project generation method based on a CAN bus is urgently needed to be explored.
The following describes a test engineering generation method, a test engineering generation device, an electronic device, and a storage medium for a CAN bus according to an embodiment of the present application with reference to the drawings. Aiming at the problems that the manual construction of the test engineering is more and more difficult and the workload is large due to the fact that the message and the signal quantity are larger and larger along with the increase of the project complexity and the number of CAN channels in the background technology, the application provides the test engineering generation method of the CAN bus. Therefore, the problems that in the related art, a test project needs to be manually set up, the workload is overlarge, the setting-up 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 provided in the embodiment of the present application.
As shown in fig. 1, the test engineering generating method of the CAN bus includes the following steps:
in step S101, a function group of the function to be tested of the CAN bus is determined.
The functional groups may be grouped according to specific situations, which is not limited, for example: the function classes can be divided into message, signal, CRC, DTC and the like, and then the function classes are respectively refined and decomposed, and the message processing can be divided into message definition, message event message processing, message period message processing and the like.
It CAN be understood 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 hierarchically decomposed according to the functional groups to obtain the functional programs, and the functional programs are assembled layer by layer to obtain the functional layers of the test engineering script.
The grouped functional programs are assembled layer by layer in a mode similar to C language file reference, so that the single function is single as much as possible, and the engineering implementation program level is clear.
It should be noted that, the existing test function hierarchy is not clear, and each function implementation program is mixed in one file, and the function is not layered, so that the test engineering is not convenient to automatically generate, and therefore, the test engineering hierarchy is subdivided and assembled fully according to the characteristics of different functions, so that the test function is automatically generated.
In step S103, the type and rule of the input information of each functional layer are identified according to the functional groups, the pre-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 pre-information, and the engineering code and the code of the system variable of all functional layers are integrated to generate the script of the test engineering.
The identification and the extraction of the input information rule are prerequisites for automatic generation of the test engineering, and the input information rule required by the test engineering construction is extracted by combining a function realization target according to the CAN bus matrix table.
It should be noted that, according to the above-mentioned division of the functional layers, the engineering codes of each functional layer are different, and 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 complete one-key generation of the engineering script of the multi-path bus message. If only one path of bus message is changed, the engineering script corresponding to the generated path of bus message can be updated.
In the embodiment of the present application, identifying the type and rule of input information of each functional layer according to the functional groups includes: acquiring input information required when each group of function corresponding codes in the function group are compiled; classifying according to input information required by each group of function compiling codes, determining the type of the input information of each functional layer, extracting the function logic of the input information required by each group of function compiling codes according to a matrix table of the CAN bus, and obtaining the rule of the input information of each functional layer by utilizing function logic extraction.
According to the grouping of the functions, the test engineering codes which need to be written aiming at different functional groups analyze and arrange the required input information, such as: for bus message sending, message ID, message period, message DLC length, crcCounter signal name, crc-ID, CRCCheck signal name, bytes Segment to which crc belongs and the like 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.
It can be understood that, according to the sorted input information of each function, in combination with the source of the input information (e.g. signal matrix table), the rule for refining the input information of the corresponding function for the corresponding analysis is as follows: the message sending distinguishes the message sent by the controller and the message sent to the controller, and the message is screened and extracted according to the message sender. The CRC can accurately obtain the extraction rule of the information required by the CRC according to the signal naming characteristics, the CRC signal length characteristics, the Chinese naming characteristics and the like of the CRC.
In the embodiment of the application, extracting the pre-information of the test engineering script based on the type and the rule of the input information includes: acquiring a generation code of the front information; and generating the front information corresponding to the type and the rule of the input information by using the generated code.
It will be appreciated that, based on the refined input information types and rules set forth in the above embodiments, the one-key automatic extraction of input information is implemented in a high-level programming language according to the source of the input information (e.g., signal matrix table).
It should be noted that the content of the signal matrix table is many and complicated, many contents are irrelevant to the building of the test engineering, and the prepositive information required by the building of the test engineering can be quickly obtained by abstracting the rule and automatically generating the input information by one key. By adopting the mode of firstly generating the input information and then generating the engineering code according to the input information, the coupling degree of the code can be reduced, and the stability of the code is increased. In the early stage of the project, the input information source (such as the signal matrix table) is frequently updated, and the input information changes along with the change of the signal source. At the moment, only the codes of the automatically generated 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 the embodiment of the present application, generating the engineering code and the code of the system variable of each functional layer based on the preposition information includes: coding the preposition information by using a preset high-level programming language to obtain an engineering code of each functional layer; and compiling codes of the preposed information by using a definition rule of a preset system variable and a preset high-level programming language to obtain codes of the system variable.
The engineering code is obtained by coding automatically generated input information through a high-level programming language, and the code of the system variable is generated by adopting the high-level programming language to quickly realize one-key generation of the system variable according to the automatically generated input information and by combining with the rule defined by the engineering variable.
It should be noted that although the message distinguishes ID and signal name, the sending processing logic of the message in the test engineering is similar, so that the processing logic is extracted, then according to the automatically generated input information, the high level programming language is adopted to implement the processing of one functional logic by using the same function, multiple messages call the same function, and the one-key generation of the engineering code is rapidly implemented, and the integrated block diagram of the code is shown in fig. 3.
The method for generating the test engineering of the CAN bus will be described below by using a specific embodiment, as shown in fig. 4, the steps are as follows:
1. optimizing existing test engineering hierarchies
Firstly, the functions to be realized are grouped and classified according to the functional characteristics, and the test engineering script is hierarchically decomposed according to the functional groups. For example, the message processing may be divided into message definition, message event message processing, message period message processing, and the like according to the function categories, and then the function categories are subdivided and decomposed.
Secondly, the grouped functional programs are assembled layer by layer in a mode similar to C language header file reference, so that the single function is single as much as possible, and the engineering implementation program level is clear.
2. Refining input information laws
And (4) analyzing and sorting required input information aiming at test engineering codes required to be written by different functional groups by combining the functional groups in the step (1). For example, for bus message transmission, a message sender, a message ID, a message cycle, a message DLC length, a crcCounter signal name, a crc-ID, a CRCCheck signal name, a byte Segment to which crc belongs, and the like 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.
And correspondingly analyzing and refining rules of the corresponding function input information according to the sorted function input information and by combining input information sources (such as a signal matrix table). For example, the message sending distinguishes the message sent by the controller from the message sent to the controller, and the message is screened and extracted according to the message sender. The CRC can accurately obtain the extraction rule of the information required by the CRC according to the signal naming characteristics, the CRC signal length characteristics, the Chinese naming characteristics and the like of the CRC.
3. Automatically generating input information
And (3) combining the type and the rule of the input information extracted in the step (2), and realizing one-key automatic extraction of the input information by adopting a high-level programming language according to the source (such as a signal matrix table) of the input information.
4. Automatic generation of engineering code
And 3, automatically generating corresponding engineering codes by adopting a high-level programming language according to the automatically generated input information.
5. System variable automatic generation
The function of the system variable in the CAN bus test is very important, and the value of the bus signal is usually changed by modifying the value of the system variable, so that the system variable and the signal have a corresponding relationship, the more the signal quantity is operated, the more the system variable is operated, and the tedious and time-consuming manual definition of a large number of system variables. And 3, according to the automatically generated input information, combining the rules defined by the engineering system variables, and quickly realizing the one-key generation of the system variables by adopting a high-level programming language. 4 and 5, the input sources are both 3, the system variables can be well consistent with the signal names in the system variable naming, and the readability of the codes is improved only by additionally adding the rule attributes of the system variables.
6. Code integration
The codes generated by the 3, 4 and 5 are integrated, and only the original input file (such as a signal matrix table) needs to be updated, so that one code can complete one-key generation of the engineering script of the multi-channel bus message. If only one path of bus message is changed, the engineering script corresponding to the generated path of bus message can be updated.
According to the test engineering generation method of the CAN bus, classification and hierarchical processing are carried out on test engineering test levels, and test function levels are subdivided and assembled, so that the test engineering levels are optimized, automatic generation of test engineering is facilitated, manual construction of the test engineering is not needed, construction workload is reduced, and construction efficiency of the test engineering is improved; the method has the advantages that the target is realized by combining functions according to the CAN bus matrix table, and the input information rule required by the test engineering construction is refined, so that the generated input information is automatically generated as the test engineering in the follow-up process, the efficiency of the test engineering construction and maintenance is improved, and the labor cost is reduced; the input information table is extracted and generated from the CAN bus matrix table by one key by adopting a generated code, so that a data source is provided for automatic generation of a test project, and the dependence on the preposed information CAN be reduced; the multi-path CAN engineering script generation CAN be completed quickly by automatically generating the code of the test engineering and the system variable code, the test engineering is low 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, the maintenance cost of the test engineering is reduced, and the construction efficiency is improved.
Next, a test engineering generating apparatus of a CAN bus proposed according to an embodiment of the present application is described with reference to the drawings.
Fig. 5 is a block diagram schematically illustrating a test engineering generating apparatus for a CAN bus according to an embodiment of the present disclosure.
As shown in fig. 5, the test-engineering generating apparatus 10 for a CAN bus includes: a determination module 100, a packaging module 200, a processing module 300, and a generation module 400.
The determining module 100 is configured to determine a function group of a function 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 groups to obtain a functional program, and assembling the functional program layer by layer to obtain a functional layer of the test engineering script; the processing module 300 is configured to identify the type and rule of input information of each functional layer according to the functional groups, and extract the pre-information of the test engineering script based on the type and rule of the input information; the generating module 400 is configured to generate the engineering code and the system variable of each functional layer based on the pre-position information, and integrate the engineering code and the code of the system variable of all functional layers to generate a script of the test engineering.
Further, the processing module 300 is further configured to: acquiring input information required when codes corresponding to each group of functions in the functional groups are compiled; classifying according to input information required by each group of function compiling codes, determining the type of the input information of each functional layer, extracting the function logic of the input information required by each group of function compiling codes according to a matrix table of the CAN bus, and obtaining the rule of the input information of each functional layer by utilizing function logic extraction.
In an embodiment of the present application, the processing module 300 is further configured to: acquiring a generation code of the front information; and generating the front information corresponding to the type and the rule of the input information by using the generated code.
In an embodiment of the present application, the generating module 400 is further configured to: coding the preposition information by using a preset high-level programming language to obtain an engineering code of each functional layer; and compiling codes by using the definition rules of the preset system variables and the preset high-level programming language preposition information to obtain the codes of the system variables.
It should be noted that the foregoing explanation of the embodiment of the test engineering generating method for the CAN bus is also applicable to the test engineering generating apparatus for the CAN bus of this embodiment, and details are not repeated here.
According to the test engineering generation device of the CAN bus, the test engineering levels are optimized, the functions realized by engineering programs are clear at a glance, the code and function corresponding relation of each level is clearer, and the coupling degree between the functional modules is reduced; the dependence on the preposed information can be reduced, the automatic generation of the test engineering can still be realized through the original input information such as a communication matrix before the specific function test range is not taken, and the test engineering construction and link verification time is advanced; the generation of multipath CAN engineering scripts by one key CAN be completed quickly, the test engineering construction and maintenance cost is low, the generation of multipath bus matrix codes CAN be realized in batch only by newly constructing and maintaining the same script, and the construction time length of the engineering is not increased along with the increase of message signal quantity; the flexibility is strong, a certain path of bus signal is changed, and the path of bus test engineering script generation can be completed by one key; the engineering construction experience can be well accumulated, the subsequent similar projects can inherit and reuse historical engineering codes, only the change logic part needs to be changed, and 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 embodiments when executing the program.
Further, the electronic device further includes:
a communication interface 603 for communication between the memory 601 and the processor 602.
The memory 601 is used for storing computer programs that can be run on the processor 602.
The Memory 601 may include a high-speed RAM (Random Access Memory) Memory, and may also include a 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 interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus.
Optionally, 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 complete mutual communication through an internal interface.
The processor 602 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present Application.
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for generating the test engineering of the CAN bus is implemented.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," 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 application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer 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, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "N" means at least two, e.g., two, three, etc., unless specifically limited 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 steps of a custom logic function or process, and alternate 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 implementing the embodiments of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above 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. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a programmable gate array, a field programmable gate array, or the like.
It will be understood by those skilled in the art that all or part of the steps carried out in the method of implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and the program, when executed, includes one or a combination of the steps of the method embodiments.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (10)

1. A test engineering generation method of a CAN bus is characterized by comprising the following steps:
determining a function group of a function to be tested of the CAN bus;
carrying out hierarchical decomposition on the test engineering script of the CAN bus according to the functional groups to obtain a functional program, and assembling the functional program layer by layer to obtain a functional layer of the test engineering script;
and identifying the type and the rule of input information of each functional layer according to the functional groups, extracting the prepositive information of the test engineering script based on the type and the rule of the input information, generating an engineering code and a system variable of each functional layer based on the prepositive information, and integrating the engineering codes and the system variables of all the functional layers to generate the script of the test engineering.
2. The method of claim 1, wherein identifying the type and regularity of each functional layer input message according to the functional groups comprises:
acquiring input information required when codes corresponding to each group of functions in the functional groups are compiled;
classifying according to the input information required by each group of function compiling codes, determining the type of the input information of each functional layer, extracting the function logic of the input information required by each group of function compiling 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 function logic extraction.
3. The method of claim 1, wherein the extracting the pre-information of the test engineering script based on the type and the rule of the input information comprises:
acquiring a generation code of the front information;
and generating the front information corresponding to the type and the rule of the input information by using the generated code.
4. The method of claim 1, wherein generating code for engineering code and system variables for each functional layer based on the preposition information comprises:
coding the prepositive information by using a preset high-level programming language to obtain an engineering code of each functional layer;
and coding the preposed information by using a definition rule of a preset system variable and the preset high-level programming language to obtain a code of the system variable.
5. A test engineering generating device of a CAN bus is characterized by comprising:
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 groups to obtain a functional program, and assembling the functional program layer by layer to obtain a functional layer of the test engineering script;
the processing module is used for identifying the type and the rule of input information of each functional layer according to the functional groups and extracting the preposed information of the test engineering script based on the type and the rule of the input information;
and the generating module is used for generating the engineering codes and the system variables of each functional layer based on the prepositive information, and integrating the codes of the engineering codes and the system variables of all the functional layers to generate the script of the test engineering.
6. The apparatus of claim 5, wherein the processing module is further configured to:
acquiring input information required when codes corresponding to each group of functions in the functional groups are compiled;
classifying according to the input information required by each group of function compiling codes, determining the type of the input information of each functional layer, extracting the function logic of the input information required by each group of function compiling 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 function logic extraction.
7. The apparatus of claim 5, wherein the processing module is further configured to:
acquiring a generation code of the prepositive information;
and generating the front information corresponding to the type and the rule of the input information by using the generated code.
8. The apparatus of claim 5, wherein the generating module is further configured to:
coding the prepositive information by using a preset high-level programming language to obtain an engineering code of each functional layer;
and coding the preposed information by using a definition rule of a preset system variable and the preset high-level programming language to obtain a code of the system variable.
9. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor executing the program to implement the test engineering generation method of a CAN-bus according to any of claims 1-4.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the program is executed by a processor for implementing a test engineering generation method for a CAN-bus according to any of claims 1-4.
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 true CN115567340A (en) 2023-01-03
CN115567340B 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 (15)

* 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
US20050022086A1 (en) * 2003-04-15 2005-01-27 Anton Kotz Method for generating tester controls
CN1767453A (en) * 2004-10-31 2006-05-03 中兴通讯股份有限公司 Automatic test method and system
US20080072100A1 (en) * 2006-06-05 2008-03-20 International Business Machines Corporation Generating functional test scripts
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
US20210209011A1 (en) * 2020-01-02 2021-07-08 Accenture Inc. Systems and methods for automated testing using artificial intelligence techniques
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

Patent Citations (15)

* 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
US20050022086A1 (en) * 2003-04-15 2005-01-27 Anton Kotz Method for generating tester controls
CN1767453A (en) * 2004-10-31 2006-05-03 中兴通讯股份有限公司 Automatic test method and system
US20080072100A1 (en) * 2006-06-05 2008-03-20 International Business Machines Corporation Generating functional test scripts
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
US20210209011A1 (en) * 2020-01-02 2021-07-08 Accenture Inc. Systems and methods for automated testing using artificial intelligence techniques
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
ONUR GUZEY ET AL.: "Coverage-directed test generation through automatic constraint extraction", 2007 IEEE INTERNATIONAL HIGH LEVEL DESIGN VALIDATION AND TEST WORKSHOP, 10 December 2007 (2007-12-10) *
梁晨一;: "基于CAN/LIN总线的车载网关自动化测试系统设计", 农业装备与车辆工程, no. 10, 10 October 2020 (2020-10-10) *
王津;左春;张正;: "基于样本程序的自动化测试工具", 计算机工程, no. 03, 21 April 2020 (2020-04-21) *

Also Published As

Publication number Publication date
CN115567340B (en) 2024-04-26

Similar Documents

Publication Publication Date Title
US8010844B2 (en) File mutation method and system using file section information and mutation rules
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
CN111324540B (en) Interface testing method and device
CN112527676A (en) Model automation test method, device and storage medium
CN111679979A (en) Destructive testing method and device
CN110543427A (en) Test case storage method and device, electronic equipment and storage medium
CN114460925A (en) Automatic HIL (high-level intelligence) testing method for CAN (controller area network) interface of electric automobile controller
CN115567340B (en) CAN bus test engineering generation method, device, equipment and medium
CN111580409B (en) Fault simulation test method for real-time embedded system
CN115755867A (en) Vehicle diagnosis method and related device
CN116521217A (en) Method, system and storage medium for rapidly configuring BSW based on AUTOSAR tool
CN115828804A (en) Method for modifying RTL source code file and electronic equipment
CN112733454B (en) Equipment predictive maintenance method and device based on joint learning
CN114297088A (en) Method, device, equipment and medium for testing front end vue frame assembly
CN114285840A (en) Vehicle data acquisition method, intelligent terminal and storage medium
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
CN113434405A (en) Method and device for determining test file, storage medium and electronic device
CN112579457B (en) Data architecture management and control method and system based on artificial intelligence
CN110532315B (en) Method and system for automatically generating reliability prediction report import file
JP4397393B2 (en) Method and apparatus for modifying modular structured messages
CN113595787B (en) Real-time log automatic alarm method, program and medium based on log template
CN116991706B (en) Vehicle automatic test method, device, equipment and storage medium
CN116756050B (en) MBSE-based inertial product use case analysis method, system and storage medium
CN113343659B (en) Analysis report generation method, device, 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