CN117784763A - Message sending method and device, electronic equipment and storage medium - Google Patents
Message sending method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117784763A CN117784763A CN202311827989.9A CN202311827989A CN117784763A CN 117784763 A CN117784763 A CN 117784763A CN 202311827989 A CN202311827989 A CN 202311827989A CN 117784763 A CN117784763 A CN 117784763A
- Authority
- CN
- China
- Prior art keywords
- message
- sending
- controller
- tested
- virtual node
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000012360 testing method Methods 0.000 claims abstract description 12
- 238000004088 simulation Methods 0.000 claims abstract description 10
- 238000004590 computer program Methods 0.000 claims description 16
- 230000008569 process Effects 0.000 claims description 12
- 230000004044 response Effects 0.000 claims description 9
- 238000012800 visualization Methods 0.000 claims 1
- 238000012545 processing Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000000007 visual effect Effects 0.000 description 8
- 238000011161 development Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000000725 suspension Substances 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Digital Computer Display Output (AREA)
Abstract
The embodiment of the invention discloses a message sending method, a message sending device, electronic equipment and a storage medium. The method comprises the following steps: displaying a preset message configuration interface aiming at a controller to be tested, wherein the preset message configuration interface is configured with message configuration data; responding to a message sending instruction aiming at a controller to be tested, determining a target virtual node corresponding to the controller to be tested, loading a preset message sending script corresponding to the target virtual node, wherein the target virtual node is a virtual node based on CANoe simulation; determining a message configuration variable corresponding to the message configuration data in a preset message sending script, and assigning the message configuration data to the message configuration variable to obtain an assigned message sending script; and sending a first message to the controller to be tested by executing the assigned message sending script. According to the technical scheme provided by the embodiment of the invention, the message required by the controller can be flexibly sent to the controller to be tested based on CANoe, and the testing efficiency of the controller is further improved.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a message sending method, a message sending device, electronic equipment and a storage medium.
Background
In the development process of an electronic controller, the electronic controller often needs to be tested, and the test process usually comprises a step of sending a message to the electronic controller.
In the related art, a IG (interactive generator) module in CANoe (CAN open environment, bus development environment) is generally used to send a message to an electronic controller.
However, the conventional IG module of CANoe generally performs a message sending process based on fixed message sending information, so that the message sending lacks flexibility, thereby affecting the test efficiency.
Disclosure of Invention
The invention provides a message sending method, a message sending device, electronic equipment and a storage medium, so that a message required by a controller to be tested can be sent to the controller to be tested more flexibly based on CANoe, and the testing efficiency of the controller is further improved.
According to an aspect of the present invention, there is provided a method for sending a message, including:
displaying a preset message configuration interface aiming at a controller to be tested, wherein the preset message configuration interface is configured with message configuration data;
responding to a message sending instruction aiming at the controller to be tested, determining a target virtual node corresponding to the controller to be tested, and loading a preset message sending script corresponding to the target virtual node, wherein the target virtual node is a virtual node based on CANoe simulation;
determining a message configuration variable corresponding to the message configuration data in the preset message sending script, and assigning the message configuration data to the message configuration variable to obtain an assigned message sending script;
and sending a first message to the controller to be tested by executing the assigned message sending script.
Optionally, the message configuration data includes target message data and message sending policy data corresponding to the target message data, and the sending, by executing the assigned message sending script, the first message to the to-be-tested controller includes: and generating a first message containing the target message data by executing the message sending script, and sending the first message to the controller to be tested according to the message sending strategy data.
Optionally, the message sending policy data includes at least one of an identifier of the message data, a message sending period, a single frame message data length, a message sending number, an interval duration of two adjacent sending messages, and a pause duration of two adjacent sending messages.
Optionally, the preset message configuration interface displays a sending control, and before the response to the message sending instruction for the to-be-tested controller, the method further includes: responding to control triggering operation for the sending control, and determining message configuration data bound with the sending control; and generating a message sending instruction aiming at the controller to be tested based on the message configuration data.
Optionally, the preset message configuration interface displays a pause control, and the method further includes: in the process of sending a first message to the to-be-detected controller, generating a message pause sending instruction after receiving a control triggering operation acting on the pause control; and suspending the message sending operation of sending the first message to the to-be-detected controller based on the message suspending sending instruction.
Optionally, the preset message configuration interface is a visual interface preset for CANoe.
Optionally, the method further comprises: and when the controller to be tested is detected to generate a second message, the second message is sent to the target virtual node, so that the target virtual node feeds back a response message corresponding to the second message to the controller to be tested.
According to another aspect of the present invention, there is provided a message transmitting apparatus. The device comprises:
the configuration data obtaining module is used for displaying a preset message configuration interface aiming at the controller to be tested, wherein the preset message configuration interface is configured with message configuration data;
the script loading module is used for responding to a message sending instruction aiming at the controller to be tested, determining a target virtual node corresponding to the controller to be tested, and loading a preset message sending script corresponding to the target virtual node, wherein the target virtual node is a virtual node based on CANoe simulation;
the variable assignment module is used for determining a message configuration variable corresponding to the message configuration data in the preset message sending script, and assigning the message configuration data to the message configuration variable to obtain an assigned message sending script;
and the message sending module is used for sending a first message to the controller to be tested by executing the assigned message sending script.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the messaging method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a method for sending a message according to any embodiment of the present invention.
According to the technical scheme, the preset message configuration interface for the controller to be tested is displayed, wherein the preset message configuration interface is configured with message configuration data. According to the technical scheme, the visual interface is taken as an inlet, so that message configuration data can be configured conveniently and flexibly. And responding to a message sending instruction aiming at the controller to be tested, and determining a target virtual node corresponding to the controller to be tested. Loading a preset message sending script corresponding to the target virtual node, wherein the target virtual node is a virtual node based on CANoe simulation. Determining a message configuration variable corresponding to the message configuration data in the preset message sending script, and assigning the message configuration data to the message configuration variable to obtain an assigned message sending script. According to the technical scheme, the script is sent aiming at the message pre-written by the target virtual node, and the message configuration variables are defined in the script to acquire the message configuration data, so that the situation of modifying the script is avoided, and the development cost is reduced. And sending a first message to the controller to be tested by executing the assigned message sending script. According to the technical scheme provided by the embodiment of the invention, the message required by the controller can be flexibly sent to the controller to be tested based on CANoe, and the testing efficiency of the controller is further improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a message sending method according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a message sending device according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It will be appreciated that the data (including but not limited to the data itself, the acquisition or use of the data) involved in the present technical solution should comply with the corresponding legal regulations and the requirements of the relevant regulations.
Example 1
Fig. 1 is a flow chart of a message sending method according to a first embodiment of the present invention, where the method may be performed by a message sending device, and the message sending device may be implemented in hardware and/or software, and the message sending device may be configured in an electronic device such as a computer or a server.
As shown in fig. 1, the method of the present embodiment includes:
s110, displaying a preset message configuration interface for the controller to be tested, wherein the preset message configuration interface is configured with message configuration data.
The controller to be tested can be understood as a controller which needs to be tested in a form of sending a message. In the embodiment of the invention, the controller to be tested can be a whole vehicle controller. The number of controllers to be tested may be one, two or more. The preset message configuration interface may be understood as an interface for configuring message configuration data of the controller to be tested. The message configuration data can be understood as data which needs to be configured when the controller to be tested sends the message.
In the embodiment of the present invention, the message configuration data may include target message data and message sending policy data corresponding to the target message data. The target message data can understand the message content to be sent to the controller to be tested. The message sending policy data can be understood as control data sent by a message when sending the message to the controller to be tested. Optionally, the message sending policy data may include at least one of an identifier of the message data, a message sending period, a single frame message data length, a number of message sending times, a duration of an interval between two adjacent sending messages, and a duration of a pause between two adjacent sending messages. Wherein, the identification of the message data can be used for distinguishing different messages. According to the embodiment of the invention, the message sending can be accurately controlled by configuring the message configuration data.
In the embodiment of the present invention, the preset message configuration interface may be a visual interface preset for the CANoe, that is, a visual interface developed for the CANoe application and used for configuring the message sending information of the controller to be tested. In other words, the preset message configuration interface is newly added to the CANoe application. The processing has the advantage that the function provided by the CANoe application can be conveniently used through the preset message configuration interface.
In the embodiment of the invention, the visualized message configuration interface is taken as an inlet, so that the message configuration data of the to-be-tested controller can be configured more conveniently, the message configuration data of the to-be-tested controller can be flexibly adjusted, the difficulty of message sending processing of the to-be-tested controller is reduced, the message sending processing flow of the to-be-tested controller is simplified, and the technical effect of testing efficiency of the to-be-tested controller is further improved.
In an embodiment of the present invention, before the presenting the preset message configuration interface for the target controller, the method may further include: responding to message data configuration operation aiming at control to be tested, and displaying a preset message configuration interface; and further, based on the preset message configuration interface, receiving message configuration data input by the to-be-tested controller, thereby obtaining the message configuration data of the to-be-tested controller.
On the basis of the above embodiment, the method may further include: and under the condition that the preset message configuration interface displays the message configuration data configured for the to-be-tested controller, responding to the data modification operation for the message configuration data, and modifying the message configuration data of the to-be-tested controller. Thus, the modified data can be used as message configuration data of the controller to be tested.
S120, responding to a message sending instruction aiming at the controller to be tested, determining a target virtual node corresponding to the controller to be tested, and loading a preset message sending script corresponding to the target virtual node.
The message sending instruction can be understood as an instruction for sending a message to the to-be-tested controller, namely an instruction for sending the message to the to-be-tested controller. The target virtual node may be understood as a virtual node that is sent to the controller under test. It should be noted that, the correspondence between the controller and the virtual node may be one-to-one. In the embodiment of the invention, the target virtual node may be a virtual node based on CANoe simulation. The preset message sending script may be understood as a message sending script written in advance for the target virtual node. The message sending script can be used for generating a message based on message configuration data configured by a preset message configuration interface and sending the message to the controller to be tested. The file of the preset message sending script may be a can file.
In the embodiment of the present invention, there are various ways of determining the target virtual node corresponding to the controller to be tested, and the determination way is not specifically limited herein.
As an optional implementation manner in the embodiment of the present invention, if there are multiple virtual nodes and the multiple virtual nodes include virtual nodes corresponding to the to-be-tested controller, the virtual node corresponding to the to-be-tested controller may be determined as a target virtual node according to a correspondence between the controller and the virtual node.
As another optional implementation manner in the embodiment of the present invention, if there are multiple virtual nodes and the multiple virtual nodes do not include virtual nodes corresponding to the controller to be tested, one virtual node may be simulated based on CANoe for the controller to be tested, and the virtual node is used as a virtual node corresponding to the controller to be tested and is used as a target virtual node.
As a further optional implementation manner in the embodiment of the present invention, if there is a virtual node and the virtual node is not bound to a controller, the virtual node may be used as a target virtual node corresponding to the controller to be tested; alternatively, a virtual node may be simulated based on CANoe for the controller to be tested, and the virtual node may be used as a target virtual node corresponding to the controller to be tested. It can be understood that if there is one virtual node and the virtual node is bound with a controller, it is necessary to simulate one virtual node for the controller to be tested based on CANoe, and use the virtual node as a target virtual node corresponding to the controller to be tested.
In an embodiment of the present invention, loading a preset message sending script corresponding to the target virtual node may include: and determining the preset message sending script corresponding to the target virtual node according to the corresponding relation between the virtual node and the preset message sending script. And then a preset message sending script corresponding to the target virtual node can be loaded.
In the embodiment of the invention, the preset message configuration interface displays a sending control. The sending control is understood as a control for controlling the target virtual node to send a message to the controller to be tested. Before the instruction is sent in response to the message for the controller to be tested, the method further comprises: responding to control triggering operation for the sending control, and determining message configuration data bound with the sending control; and generating a message sending instruction aiming at the controller to be tested based on the message configuration data.
Specifically, after receiving a control triggering operation for the sending control, the message configuration data bound with the sending control can be determined according to the binding relation between the sending control and the message configuration data. And further, a message sending instruction aiming at the controller to be tested can be generated based on the message configuration data.
The message configuration data may include, for example, an identifier of the message data, a message transmission period, a single-frame message data length, a number of message transmissions, an interval duration between two adjacent messages transmitted, and a pause duration between two adjacent messages transmitted. The message configuration data bound with the sending control can comprise an identifier of message data, a message sending period, a single-frame message data length, message sending times and interval duration binding of two adjacent sending messages. Then, a message sending instruction for the to-be-detected controller can be generated based on the identification of the message data, the message sending period, the data length of the single-frame message, the message sending times and the interval duration of the two adjacent messages.
S130, determining a message configuration variable corresponding to the message configuration data in the preset message sending script, and assigning the message configuration data to the message configuration variable to obtain an assigned message sending script.
The message configuration variables may be understood as variables defined for message configuration data in a preset message transmission script. The correspondence between the message configuration variables and the message configuration data may be one-to-one. In the embodiment of the invention, the abstract concept of the message configuration data is represented by defining the message configuration variables in the preset message sending script. The advantage of this is that the message configuration variables can be given different values and can be modified during execution of the preset messaging script. By defining the message configuration variables, the preset message sending script can dynamically store or operate data in the running process, so that the preset message sending script has higher flexibility. In addition, reusability of the preset message sending script can be improved.
In the embodiment of the invention, the preset message sending script is defined with message configuration variables. After determining the message configuration data, determining the message configuration variable corresponding to the message configuration data in the preset message sending script according to the corresponding relation between the message configuration data and the message configuration variable. And further, the message configuration data can be assigned to the message configuration variable, so that an assigned message sending script is obtained.
S140, sending a first message to the to-be-tested controller by executing the assigned message sending script.
In the embodiment of the present invention, the first message may be understood as a message that needs to be sent to the to-be-tested controller. And controlling the target virtual node to generate a message which needs to be sent to the controller to be tested, namely a first message by executing the assigned message sending script. After the target virtual node generates the first message, the target virtual node may be sent to the to-be-tested controller.
After the target virtual node generates the first message, the target virtual node may be sent to the to-be-tested controller, or specifically, after the target virtual node generates the first message, the target virtual node may be controlled to send the first message to a bus connected to the to-be-tested controller. And then the first message can be transmitted to the to-be-tested controller through the bus.
In the embodiment of the present invention, when the message configuration data includes target message data and message sending policy data corresponding to the target message data, the sending, by executing the assigned message sending script, the first message to the to-be-tested controller may include: generating a first message containing the target message data by executing the message sending script; and then the first message can be sent to the to-be-tested controller according to the message sending strategy data.
On the basis of the embodiment, the preset message configuration interface displays a pause control. The pause control can be used for controlling the first message to pause sending in the process of sending the first message to the to-be-detected controller. In the embodiment of the invention, the pause control can control the pause of the message to the controller to be tested at any time according to the actual demand. The method may further comprise: in the process of sending a first message to the to-be-detected controller, after receiving a control trigger operation acting on the pause control, a message pause sending instruction can be generated; and then, based on the message sending suspension instruction, suspending the message sending operation of sending the first message to the to-be-detected controller. The message sending suspension instruction can be understood as an instruction for suspending sending of the first message to the to-be-tested controller.
On the basis of the foregoing embodiment, after the sending the first packet to the to-be-tested controller, the method further includes: determining whether the controller to be tested generates a second message corresponding to the first message; if yes, the second message is sent to the target virtual node, so that the target virtual node feeds back a response message corresponding to the second message to the to-be-tested controller, interaction between the to-be-tested controller and the target virtual node through messages is achieved, and the testing efficiency of the controller is further improved. The second message may be understood as a response message generated by the to-be-detected controller for the first message.
In the embodiment of the present invention, determining whether the controller to be tested generates the second message corresponding to the first message may include determining whether the controller to be tested generates the second message corresponding to the first message by adopting a polling mode. The polling mode is defined with a polling interval duration. It should be noted that the duration of the polling interval may be set according to actual requirements, which is not specifically limited herein.
According to the technical scheme, the preset message configuration interface for the controller to be tested is displayed, wherein the preset message configuration interface is configured with message configuration data. According to the technical scheme, the visual interface is taken as an inlet, so that message configuration data can be configured conveniently and flexibly. And responding to a message sending instruction aiming at the controller to be tested, and determining a target virtual node corresponding to the controller to be tested. Loading a preset message sending script corresponding to the target virtual node, wherein the target virtual node is a virtual node based on CANoe simulation. Determining a message configuration variable corresponding to the message configuration data in the preset message sending script, and assigning the message configuration data to the message configuration variable to obtain an assigned message sending script. According to the technical scheme, the script is sent aiming at the message pre-written by the target virtual node, and the message configuration variables are defined in the script to acquire the message configuration data, so that the situation of modifying the script is avoided, and the development cost is reduced. And sending a first message to the controller to be tested by executing the assigned message sending script. According to the technical scheme provided by the embodiment of the invention, the message required by the controller can be flexibly sent to the controller to be tested based on CANoe, and the testing efficiency of the controller is further improved.
Example two
Fig. 2 is a schematic structural diagram of a message sending device according to a third embodiment of the present invention. As shown in fig. 2, the apparatus includes: configuration data obtaining module 210, script loading module 220, variable assignment module 230 and message sending module 240.
The configuration data obtaining module 210 is configured to display a preset message configuration interface for the controller to be tested, where the preset message configuration interface is configured with message configuration data;
the script loading module 220 is configured to determine a target virtual node corresponding to the to-be-tested controller in response to a message sending instruction for the to-be-tested controller, and load a preset message sending script corresponding to the target virtual node, where the target virtual node is a virtual node based on CANoe simulation;
the variable assignment module 230 is configured to determine a message configuration variable corresponding to the message configuration data in the preset message sending script, and assign the message configuration data to the message configuration variable, so as to obtain an assigned message sending script;
and the message sending module 240 is configured to send a first message to the to-be-tested controller by executing the assigned message sending script.
According to the technical scheme, a preset message configuration interface for the controller to be tested is displayed through the configuration data obtaining module, wherein the preset message configuration interface is configured with the message configuration data. According to the technical scheme, the visual interface is taken as an inlet, so that message configuration data can be configured conveniently and flexibly. Responding to a message sending instruction aiming at the controller to be tested through a script loading module, and determining a target virtual node corresponding to the controller to be tested; loading a preset message sending script corresponding to the target virtual node, wherein the target virtual node is a virtual node based on CANoe simulation. And determining a message configuration variable corresponding to the message configuration data in the preset message sending script through a variable assignment module, and assigning the message configuration data to the message configuration variable to obtain an assigned message sending script. According to the technical scheme, the script is sent aiming at the message pre-written by the target virtual node, and the message configuration variables are defined in the script to acquire the message configuration data, so that the situation of modifying the script is avoided, and the development cost is reduced. And sending a first message to the controller to be tested by executing the assigned message sending script through a message sending module. According to the technical scheme provided by the embodiment of the invention, the message required by the controller can be flexibly sent to the controller to be tested based on CANoe, and the testing efficiency of the controller is further improved.
Optionally, the message configuration data includes target message data and message sending policy data corresponding to the target message data; and the message sending module 240 is configured to generate a first message including the target message data by executing the message sending script, and send the first message to the to-be-tested controller according to the message sending policy data.
Optionally, the message sending policy data includes at least one of an identifier of the message data, a message sending period, a single frame message data length, a message sending number, an interval duration of two adjacent sending messages, and a pause duration of two adjacent sending messages.
Optionally, the preset message configuration interface displays a sending control; the device also comprises a sending instruction generating module, a sending instruction generating module and a sending instruction generating module, wherein the sending instruction generating module is used for responding to control triggering operation aiming at the sending control before responding to the message sending instruction aiming at the controller to be tested, and determining message configuration data bound with the sending control; and generating a message sending instruction aiming at the controller to be tested based on the message configuration data.
Optionally, the preset message configuration interface displays a pause control, and the device further includes a message sending pause module, configured to generate a message pause sending instruction after receiving a control triggering operation acting on the pause control in a process of sending a first message to the to-be-tested controller; and suspending the message sending operation of sending the first message to the to-be-detected controller based on the message suspending sending instruction.
Optionally, the preset message configuration interface is a visual interface preset for CANoe.
Optionally, the device further includes an interaction module, configured to send, when it is detected that the controller to be tested generates the second message, the second message to the target virtual node, so that the target virtual node feeds back a response message corresponding to the second message to the controller to be tested.
The message sending device provided by the embodiment of the invention can execute the message sending method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, each unit and module included in the foregoing message sending apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding function can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Example III
Fig. 3 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the messaging method.
In some embodiments, the messaging method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. One or more of the steps of the messaging method described above may be performed when a computer program is loaded into RAM 13 and executed by processor 11. Alternatively, in other embodiments, the processor 11 may be configured to perform the messaging method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. A method for sending a message, comprising:
displaying a preset message configuration interface aiming at a controller to be tested, wherein the preset message configuration interface is configured with message configuration data;
responding to a message sending instruction aiming at the controller to be tested, determining a target virtual node corresponding to the controller to be tested, and loading a preset message sending script corresponding to the target virtual node, wherein the target virtual node is a virtual node based on CANoe simulation;
determining a message configuration variable corresponding to the message configuration data in the preset message sending script, and assigning the message configuration data to the message configuration variable to obtain an assigned message sending script;
and sending a first message to the controller to be tested by executing the assigned message sending script.
2. The method according to claim 1, wherein the message configuration data includes target message data and message sending policy data corresponding to the target message data, and the sending the first message to the to-be-tested controller by executing the assigned message sending script includes:
and generating a first message containing the target message data by executing the message sending script, and sending the first message to the controller to be tested according to the message sending strategy data.
3. The method of claim 2, wherein the message sending policy data includes at least one of an identification of message data, a message sending period, a single frame message data length, a number of message sending times, a time interval between two adjacent sending messages, and a time pause between two adjacent sending messages.
4. The method of claim 1, wherein the preset messaging interface presents a send control, the method further comprising, prior to the responding to the messaging instruction for the controller under test:
responding to control triggering operation for the sending control, and determining message configuration data bound with the sending control;
and generating a message sending instruction aiming at the controller to be tested based on the message configuration data.
5. The method of claim 1, wherein the preset messaging configuration interface presents a pause control, the method further comprising:
in the process of sending a first message to the to-be-detected controller, generating a message pause sending instruction after receiving a control triggering operation acting on the pause control;
and suspending the message sending operation of sending the first message to the to-be-detected controller based on the message suspending sending instruction.
6. The method of claim 1, wherein the preset message configuration interface is a visualization interface preset for CANoe.
7. The method of claim 1, wherein after the sending the first message to the controller under test, the method further comprises:
determining whether the controller to be tested generates a second message corresponding to the first message, wherein the second message is a response message fed back by the controller to be tested aiming at the first message;
if yes, the second message is sent to the target virtual node, so that the target virtual node feeds back a response message corresponding to the second message to the controller to be tested.
8. A message transmitting apparatus, comprising:
the configuration data obtaining module is used for displaying a preset message configuration interface aiming at the controller to be tested, wherein the preset message configuration interface is configured with message configuration data;
the script loading module is used for responding to a message sending instruction aiming at the controller to be tested, determining a target virtual node corresponding to the controller to be tested, and loading a preset message sending script corresponding to the target virtual node, wherein the target virtual node is a virtual node based on CANoe simulation;
the variable assignment module is used for determining a message configuration variable corresponding to the message configuration data in the preset message sending script, and assigning the message configuration data to the message configuration variable to obtain an assigned message sending script;
and the message sending module is used for sending a first message to the controller to be tested by executing the assigned message sending script.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the messaging method of any of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the messaging method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311827989.9A CN117784763A (en) | 2023-12-27 | 2023-12-27 | Message sending method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311827989.9A CN117784763A (en) | 2023-12-27 | 2023-12-27 | Message sending method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117784763A true CN117784763A (en) | 2024-03-29 |
Family
ID=90385125
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311827989.9A Pending CN117784763A (en) | 2023-12-27 | 2023-12-27 | Message sending method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117784763A (en) |
-
2023
- 2023-12-27 CN CN202311827989.9A patent/CN117784763A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104834602B (en) | A kind of program dissemination method, device and program delivery system | |
CN114389969A (en) | Client test method and device, electronic equipment and storage medium | |
CN113609027A (en) | ARM cloud server testing method and device, electronic equipment and storage medium | |
CN116684302A (en) | Method and device for testing vehicle-mounted Ethernet | |
CN115481594B (en) | Scoreboard implementation method, scoreboard, electronic equipment and storage medium | |
CN117784763A (en) | Message sending method and device, electronic equipment and storage medium | |
CN115576791A (en) | Dynamic adjustment method and device for pressure measurement thread, electronic equipment and storage medium | |
CN114116487B (en) | Pressure testing method and device, electronic equipment and storage medium | |
CN115933591A (en) | Controller diagnosis method, device, equipment and storage medium | |
CN116126719A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN115599438A (en) | Method, device, equipment and medium for constructing application program publishing package | |
CN113656268B (en) | Performance test method and device for business service, electronic equipment and storage medium | |
CN114610511B (en) | Input verification method and device, electronic equipment and storage medium | |
CN117520080B (en) | Server testing method, device, equipment and medium | |
CN115967638A (en) | Equipment simulation system, method, equipment and storage medium | |
CN116303098A (en) | Application testing method and device, electronic equipment and storage medium | |
CN116192686B (en) | BMC stability test method, device, equipment and medium | |
CN114401267B (en) | Cloud application login method, device, equipment, medium and program product | |
CN115080205B (en) | Task execution method, device, electronic equipment and readable storage medium | |
CN114490421A (en) | Method, device, equipment and storage medium for detecting native rendering performance of application | |
CN117971581A (en) | Equipment testing method and device, electronic equipment and storage medium | |
CN115470193A (en) | Radar data simulation method, device, equipment and medium | |
CN116719719A (en) | Test method, test device, electronic equipment and storage medium | |
CN115665005A (en) | Equipment test method, device, equipment and medium | |
CN117539719A (en) | Application operation monitoring method, device, equipment and 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 |