A test-based message sending method, device, equipment and medium

By acquiring and processing test messages with verification mechanisms, the problem of sending messages with checksum and rolling counter verification in complex code implementations in existing technologies is solved. This achieves efficient message sending and verification algorithm verification, and has good portability.

CN116866207BActive Publication Date: 2026-08-04BEI DOU ZHI LIAN KE JI YOU XIAN GONG SI +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEI DOU ZHI LIAN KE JI YOU XIAN GONG SI
Filing Date
2023-08-23
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

The existing technology requires writing complex code to send messages with checksum and rolling counter verification during the automotive R&D stage, which is technically difficult and inconvenient to maintain.

Method used

A test-based message sending method is provided, which obtains a message to be tested with a verification mechanism, performs verification processing, and copies and assigns values ​​to achieve the sending of messages with checksum and rolling counter.

Benefits of technology

It enables the sending of messages with checksum and rolling counter, verifies whether the verification algorithm meets the requirements, and verifies whether the instrument display function is normal. It has strong portability and is easy to modify.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116866207B_ABST
    Figure CN116866207B_ABST
Patent Text Reader

Abstract

The application provides a test-based message sending method and device, electronic equipment and a storage medium. The method comprises the following steps: obtaining a to-be-tested message; in response to a sending operation on the to-be-tested message, receiving the to-be-tested message, and performing a checking process on the to-be-tested message to obtain a checking result; copying and assigning the checking result to the to-be-tested message to obtain a to-be-sent message; and sending the to-be-sent message to a bus. The application can improve the test efficiency of messages with a checking mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle testing technology, and in particular to a test-based message transmission method, apparatus, device, and medium. Background Technology

[0002] With the development of the automotive industry, the security and stability of data interaction between various automotive modules are receiving increasing attention. Therefore, in CAN bus communication, checksum verification and rolling counter mechanisms have been added to critical messages from some modules (EMS, TCU, ESP, ADAS, etc.) to prevent errors and missing frames in transmitted messages, and also to prevent unauthorized individuals from using tools to deceive the vehicle control unit and gain control of the vehicle. Current technical solutions require code implementation to perform checksum verification and rolling counter checks before sending messages.

[0003] However, during the automotive R&D phase, the development of various controls relies on bench testing. For testers, general testing tools can only send ordinary messages. To send messages with checksum and rolling counter verification, code needs to be written, which is technically challenging, with complex code logic, different algorithms for different projects, and inconvenient maintenance. Summary of the Invention

[0004] In view of this, embodiments of this application provide a test-based message sending method, apparatus, device, and medium that can improve the testing efficiency of messages with verification mechanisms.

[0005] The technical solution of this application embodiment is implemented as follows: In a first aspect, embodiments of this application provide a test-based message sending method, comprising the following steps: Obtain the message to be tested, wherein the message to be tested has a verification mechanism; In response to the sending operation of the message to be tested, the message to be tested is received, and the message to be tested is verified to obtain the verification result; The verification result is copied and assigned to the message to be tested to obtain the message to be sent; The message to be sent is sent to the bus.

[0006] In one possible implementation, obtaining the message to be tested includes: In response to an operation that opens the message editing menu, at least one message is displayed in the message editing menu; Select a target message from the at least one message as the message to be tested, and add the message to be tested to the message sending component and the message receiving component.

[0007] In one possible implementation, before receiving the message to be tested in response to a sending operation for the message to be tested, performing verification processing on the message to be tested, and obtaining a verification result, the method further includes: Create a new script module for verifying the message to be tested; An IF instruction is added to the script module, wherein the IF instruction is used to determine whether the message receiving component has received the message to be tested and to execute subsequent scripts; Add a calculation script to the script module, wherein the calculation script is used to perform verification processing on the message to be tested; A first assignment script is added to the script module, wherein the first assignment script is used to assign the calculation result of the calculation script to the message sending component. Add an End IF instruction to the script module, wherein the End IF instruction is used to end the IF instruction.

[0008] In one possible implementation, the step of receiving the message to be tested in response to a transmission operation for the message to be tested, and performing verification processing on the message to be tested to obtain a verification result, includes: The message to be tested is sent through the message sending component, and the message to be tested is received through the message receiving component. When the IF instruction determines that the receiving message component has received the message to be tested, it performs a calculation on the message to be tested according to the verification algorithm through the calculation script to obtain the calculation result.

[0009] In one possible implementation, the step of copying and assigning the verification result to the message to be tested to obtain the message to be sent includes: The calculation result is assigned to the message sending component through the first assignment script; Execute the End IF instruction to end the IF instruction.

[0010] In one possible implementation, the script module further includes a second assignment script, which is used to clear the received message component. After the first assignment script assigns the calculation result to the sent message component, the module further includes: The second assignment script clears the received message component to prepare for the next reception.

[0011] In one possible implementation, the method further includes: In response to a modification request for the message to be tested, the modified message to be tested is added to the message sending component and the message receiving component; Modify the calculation script to match the modified test message.

[0012] Secondly, embodiments of this application also provide a test-based message sending apparatus, the apparatus comprising: The acquisition module is used to acquire the message to be tested, wherein the message to be tested has a verification mechanism; The verification module is used to respond to the sending operation of the message to be tested, receive the message to be tested, perform verification processing on the message to be tested, and obtain the verification result. The assignment module is used to copy and assign the verification result to the message to be tested to obtain the message to be sent. The sending module is used to send the message to be sent to the bus.

[0013] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the test-based message transmission method described in any of the first aspects.

[0014] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the test-based message sending method described in any of the first aspects.

[0015] The embodiments of this application have the following beneficial effects: (1) The sending of messages with checksum verification and rolling counter has been implemented; (2) It can verify whether the verification algorithm meets the requirements definition; (3) It can verify whether the instrument's function display is normal and meets the test requirements; (4) It has strong portability and is easy to modify. The calculation script can be directly modified according to the calculation algorithm for different projects. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating steps S101-S104 provided in the embodiments of this application; Figure 2 This is a flowchart illustrating steps S201-S202 provided in the embodiments of this application; Figure 3 This is a flowchart illustrating steps S301-S305 provided in the embodiments of this application; Figure 4 This is a flowchart illustrating steps S401-S402 provided in the embodiments of this application; Figure 5 This is a flowchart illustrating steps S501-S502 provided in the embodiments of this application; Figure 6 This is a flowchart illustrating steps S601-S602 provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of a test-based message sending device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the composition structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0019] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0020] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0021] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0022] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application and is not intended to limit this application.

[0024] See Figure 1 , Figure 1 This is a flowchart illustrating steps S101-S104 of the test-based message sending method provided in this application embodiment, which will be combined with... Figure 1 Steps S101-S104 are explained below.

[0025] Step S101: Obtain the message to be tested, wherein the message to be tested has a verification mechanism; Step S102: In response to the sending operation for the message to be tested, receive the message to be tested, and perform verification processing on the message to be tested to obtain the verification result; Step S103: Copy the verification result and assign it to the message to be tested to obtain the message to be sent; Step S104: Send the message to be sent to the bus.

[0026] The above-described test-based message sending method has the following advantages: (1) The sending of messages with checksum verification and rolling counter has been implemented; (2) It can verify whether the verification algorithm meets the requirements definition; (3) It can verify whether the instrument's function display is normal and meets the test requirements; (4) It has strong portability and is easy to modify. The calculation script can be directly modified according to the calculation algorithm for different projects.

[0027] The exemplary steps described above in the embodiments of this application will be explained below.

[0028] The principle upon which the embodiments of this application are based is: When a CAN message is sent to the bus, each node listens for messages on the bus. After VSpy3 sends a message, it also receives the message. VSpy3 performs logical operations on the message and then sends the processed message back to the bus.

[0029] In step S101, the message to be tested is obtained, wherein the message to be tested has a verification mechanism.

[0030] In some embodiments, see Figure 2 , Figure 2 This is a flowchart illustrating steps S201-S202 provided in the embodiments of this application. Figure 1 The step S101 shown can be implemented through steps S201-S202, which will be explained in conjunction with each step.

[0031] In step S201, in response to the message editing menu opening operation, at least one message is displayed in the message editing menu.

[0032] In step S202, a target message is selected from the at least one message as the message to be tested, and the message to be tested is added to the message sending component and the message receiving component.

[0033] For example, select the 0x33F message in the Message Editor interface of Vspy3 and add the message to Receive (receive message component) and TX (send message component).

[0034] In step S102, in response to the sending operation of the message to be tested, the message to be tested is received, and the message to be tested is verified to obtain the verification result.

[0035] In some embodiments, see Figure 3 , Figure 3 This is a flowchart illustrating steps S301-S305 provided in the embodiments of this application. During execution... Figure 1Before step S102, steps S301-S305 can be performed, and each step will be explained in detail.

[0036] In step S301, a new script module is created for verifying the message to be tested.

[0037] In step S302, an IF instruction is added to the script module, wherein the IF instruction is used to determine whether the receiving message component has received the message to be tested and to execute subsequent scripts.

[0038] In step S303, a calculation script is added to the script module, wherein the calculation script is used to perform verification processing on the message to be tested.

[0039] In step S304, a first assignment script is added to the script module, wherein the first assignment script is used to assign the calculation result of the calculation script to the message sending component.

[0040] In step S305, an End IF instruction is added to the script module, wherein the End IF instruction is used to end the IF instruction.

[0041] In some embodiments, see Figure 4 , Figure 4 This is a flowchart illustrating steps S401-S402 provided in the embodiments of this application. Figure 1 The step S102 shown can be implemented through steps S401-S402, and will be explained in conjunction with each step.

[0042] In step S401, the message to be tested is sent through the message sending component and received through the message receiving component.

[0043] In step S402, after the IF instruction determines that the receiving message component has received the message to be tested, the message to be tested is processed by the calculation script according to the verification algorithm to obtain the calculation result.

[0044] In step S103, the verification result is copied and assigned to the message to be tested to obtain the message to be sent.

[0045] In some embodiments, see Figure 5 , Figure 5 This is a flowchart illustrating steps S501-S502 provided in the embodiment of this application. The step of copying and assigning the verification result to the message to be tested to obtain the message to be sent can be achieved through steps S501-S502. Each step will be explained in conjunction with the steps.

[0046] In step S501, the calculation result is assigned to the message sending component through the first assignment script.

[0047] In step S502, the End IF instruction is executed to end the IF instruction.

[0048] In step S104, the message to be sent is sent to the bus.

[0049] For example, in Vspy3, select a message from the Message Editor menu and add the message to Receive and TX; Click on Function Blocks in the menu; Create a new Function Block; Under the new Function Blocks, select the IF instruction and add an instruction that receives the message.

[0050] Select the first Set value instruction, add an operation, such as performing a checksum operation on the received message and then assigning the result to the TX message; Select the End IF directive, click Run VSpy3 Project, and run Function Blocks.

[0051] In some embodiments, the script module further includes a second assignment script, which is used to clear the received message component. After the calculation result is assigned to the sent message component by the first assignment script, the module further includes: The second assignment script clears the received message component to prepare for the next reception.

[0052] Here, after selecting the first Set value instruction and adding operations, such as calculating the received message according to the verification algorithm and assigning it to the TX message, a second Set value instruction can be added to clear the received message status and wait for the next time the message is received on the bus.

[0053] In some embodiments, see Figure 6 , Figure 6 This is a flowchart illustrating steps S601-S602 provided in the embodiments of this application. The method further includes steps S601-S602, which will be explained in conjunction with each step.

[0054] In step S601, in response to the modification request for the message to be tested, the modified message to be tested is added to the sending message component and the receiving message component.

[0055] In step S602, the calculation script is modified to match the modified message to be tested.

[0056] Here, when the message to be tested needs to be modified, simply select the corresponding message from the Message Editor interface and modify the calculation script. The calculation script matches the corresponding verification strategy, which can be preset in advance for users to choose from.

[0057] The following is a complete processing procedure: Test Description: The ADAS sends a message containing a checksum and rolling counter, which includes information such as ACC operating status and cruise speed. In a real vehicle, the instrument cluster needs to correctly receive this message to display the ACC operating status, i.e., illuminate the ACC indicator light and display the ACC cruise speed value. Therefore, in bench simulation testing, this ADAS message needs to be simulated to test whether the instrument cluster's verification algorithm is correct and whether the display function meets the requirements.

[0058] A CAN message is 8 bytes long. Assume the checksum signal is located in the 8th byte, and the rolling counter signal is located in the lower 4 bits of the 7th byte. The checksum and rolling counter signals are assumed to follow these rules: Bytes 1 through 7 (7 bytes in total) are XORed, and the result is assigned to the 8th byte. The rolling counter signal increments by 1, accumulating to 15 before resetting to 0 and starting anew.

[0059] Step 1: Select the 0x33F message in the Message Editor interface and add it to Receive and TX.

[0060] Step 2: Click on Function Blocks in the menu to create a new Function Block.

[0061] Step 3: In the new Function Blocks interface, select the IF instruction and add an expression to receive CAN bus 0x33F messages: {ACC_GENERAL_STATUS(Present):in0-0}=1.

[0062] Step 4: Select the Set Value command and add the expression: {ALIVECOUNTER_ACC3 (Value):in0-sig11-0}+1. The rolling counter will complete the accumulation and assign the value to ALIVECOUNTER_ACC3 in TX.

[0063] Step 5: Select the Set Value command and add the expression: {ACC_GENERAL_STATUS (ReceivedMessage B1):in0-100-index(0)}xor{ACC_GENERAL_STATUS (Received Message B2):in0-100-index(1)}xor{ACC_GENERAL_STATUS (Received Message B3):in0-100-index(2)}xor{ACC_GENERAL_STATUS (Received Message B4):in0-100-index(3)}xor{ACC_GENERAL_STATUS (Received Message B5):in0-100-index(4)}xor{ACC_GENERAL_STATUS(Received Message B6):in0-100-index(5)}xor{ACC_GENERAL_STATUS (ReceivedMessage B7):in0-100-index(6)}+1, complete the checksum verification operation and assign the value to CHECKSUM_ACC3 in TX.

[0064] Step 6: Select the IF instruction and add the expression: {ALIVECOUNTER_ACC3 (Value):out210-sig11-0}>15, which is used to determine whether the rolling counter exceeds 15.

[0065] Step 7: Select the Set Value command and add the expression: {ALIVECOUNTER_ACC3 (Value):out210-sig11-0}=0. After the rolling counter exceeds 15, ALIVECOUNTER_ACC3 will be reset to 0.

[0066] Step 8: Select the Set Value command and add the expression: {ACC_GENERAL_STATUS (ReceivedMessage B1):in0-100-index(0)}xor{ACC_GENERAL_STATUS (Received Message B2):in0-100-index(1)}xor{ACC_GENERAL_STATUS (Received Message B3):in0-100-index(2)}xor{ACC_GENERAL_STATUS (Received Message B4):in0-100-index(3)}xor{ACC_GENERAL_STATUS (Received Message B5):in0-100-index(4)}xor{ACC_GENERAL_STATUS(Received Message B6):in0-100-index(5)}xor{ACC_GENERAL_STATUS (ReceivedMessage B7):in0-100-index(6)}+1, and assign the value to CHECKSUM_ACC3 in TX.

[0067] Step 9: Select the Set Value command and add the expression: {ACC_GENERAL_STATUS (Present):in0-0}=0 to clear the 0x33F message reception status and wait for the next CAN bus 0x33F reception.

[0068] By following the above 9 steps, the message with checksum verification and rolling counter is sent, and the receiving end can then correctly receive the message.

[0069] In some embodiments, the above principle can be extended to simulate gateway functions, such as routing messages on the CAN1 bus to the CAN2 bus.

[0070] Specifically, by modifying the calculation script into a routing script, the processed message can simulate routing from the CAN1 bus to the CAN2 bus.

[0071] In some embodiments, CAN network diagnostic tests can also be performed, involving fault handling, such as recording DTCs for checksum errors, clearing DTCs after checksum verification is restored to correct, recording DTCs for discontinuous or repeated rolling counter counts, and clearing DTCs after rolling counter is restored to correct.

[0072] In summary, the embodiments of this application have the following beneficial effects: (1) The sending of messages with checksum verification and rolling counter has been implemented; (2) It can verify whether the verification algorithm meets the requirements definition; (3) It can verify whether the instrument's function display is normal and meets the test requirements; (4) It has strong portability and is easy to modify. The calculation script can be directly modified according to the calculation algorithm for different projects.

[0073] Based on the same inventive concept, this application also provides a test-based message sending device corresponding to the test-based message sending method in the first embodiment. Since the principle of the device in this application is similar to that of the above-mentioned test-based message sending method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0074] like Figure 7 As shown, Figure 7 This is a schematic diagram of the structure of a test-based message sending device 700 provided in an embodiment of this application. The test-based message sending device 700 includes: The acquisition module 701 is used to acquire the message to be tested, wherein the message to be tested has a verification mechanism; The verification module 702 is used to receive the message to be tested in response to the sending operation of the message to be tested, and to perform verification processing on the message to be tested to obtain the verification result. The assignment module 703 is used to copy and assign the verification result to the message to be tested to obtain the message to be sent. The sending module 704 is used to send the message to be sent to the bus.

[0075] Those skilled in the art should understand that Figure 7 The functions of each unit in the test-based message sending apparatus 700 shown can be understood by referring to the relevant description of the test-based message sending method described above. Figure 7 The functions of each unit in the test-based message sending device 700 shown can be implemented by a program running on a processor or by specific logic circuits.

[0076] In one possible implementation, the acquisition module 701 acquires the message to be tested, including: In response to an operation that opens the message editing menu, at least one message is displayed in the message editing menu; Select a target message from the at least one message as the message to be tested, and add the message to be tested to the message sending component and the message receiving component.

[0077] In one possible implementation, in response to a transmission operation for the message to be tested, the verification module 702 receives the message to be tested and performs verification processing on the message to be tested. Before obtaining the verification result, the method further includes: Create a new script module for verifying the message to be tested; An IF instruction is added to the script module, wherein the IF instruction is used to determine whether the message receiving component has received the message to be tested and to execute subsequent scripts; Add a calculation script to the script module, wherein the calculation script is used to perform verification processing on the message to be tested; A first assignment script is added to the script module, wherein the first assignment script is used to assign the calculation result of the calculation script to the message sending component. Add an End IF instruction to the script module, wherein the End IF instruction is used to end the IF instruction.

[0078] In one possible implementation, the verification module 702, in response to a transmission operation for the message to be tested, receives the message to be tested and performs verification processing on the message to be tested to obtain a verification result, including: The message to be tested is sent through the message sending component, and the message to be tested is received through the message receiving component. When the IF instruction determines that the receiving message component has received the message to be tested, it performs a calculation on the message to be tested according to the verification algorithm through the calculation script to obtain the calculation result.

[0079] In one possible implementation, the assignment module 703 copies and assigns the verification result to the message to be tested, obtaining a message to be sent, including: The calculation result is assigned to the message sending component through the first assignment script; Execute the End IF instruction to end the IF instruction.

[0080] In one possible implementation, after the assignment module 703 assigns the calculation result to the message sending component via the first assignment script, it further includes: The second assignment script clears the received message component to prepare for the next reception.

[0081] In one possible implementation, the verification module 702 further includes: In response to a modification request for the message to be tested, the modified message to be tested is added to the message sending component and the message receiving component; Modify the calculation script to match the modified test message.

[0082] The above-mentioned test-based message sending device has the following beneficial effects: (1) The sending of messages with checksum verification and rolling counter has been implemented; (2) It can verify whether the verification algorithm meets the requirements definition; (3) It can verify whether the instrument's function display is normal and meets the test requirements; (4) It has strong portability and is easy to modify. The calculation script can be directly modified according to the calculation algorithm for different projects.

[0083] like Figure 8 As shown, Figure 8 This is a schematic diagram of the composition structure of the electronic device 800 provided in the embodiments of this application. The electronic device 800 includes: The device 800 includes a processor 801, a storage medium 802, and a bus 803. The storage medium 802 stores machine-readable instructions executable by the processor 801. When the electronic device 800 is running, the processor 801 communicates with the storage medium 802 via the bus 803. The processor 801 executes the machine-readable instructions to perform the steps of the test-based message sending method described in the embodiments of this application.

[0084] In practical applications, the various components in the electronic device 800 are coupled together via bus 803. It can be understood that bus 803 is used to achieve communication between these components. In addition to a data bus, bus 803 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 8 The general labeled all buses as Bus 803.

[0085] The above-mentioned electronic devices have the following beneficial effects: (1) The sending of messages with checksum verification and rolling counter has been implemented; (2) It can verify whether the verification algorithm meets the requirements definition; (3) It can verify whether the instrument's function display is normal and meets the test requirements; (4) It has strong portability and is easy to modify. The calculation script can be directly modified according to the calculation algorithm for different projects.

[0086] This application also provides a computer-readable storage medium storing executable instructions, which, when executed by at least one processor 801, implement the test-based message sending method described in this application.

[0087] In some embodiments, the storage medium may be a magnetic random access memory (FRAM), a read-only memory (ROM), or a programmable read-only memory (PROM). Erasable Programmable Read-Only Memory (EPROM) Electrically Erasable Programmable Read-Only Memory (EEPROM) Read-only memory, flash memory, magnetic surface storage, optical disc, or CD-ROM ROM, Compact Disc Read It can be a memory such as a memory only; or it can be a device that includes one or any combination of the above-mentioned memories.

[0088] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0089] As an example, executable instructions may, but do not necessarily, correspond to files in the file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0090] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0091] The aforementioned computer-readable storage media have the following beneficial effects: (1) The sending of messages with checksum verification and rolling counter has been implemented; (2) It can verify whether the verification algorithm meets the requirements definition; (3) It can verify whether the instrument's function display is normal and meets the test requirements; (4) It has strong portability and is easy to modify. The calculation script can be directly modified according to the calculation algorithm for different projects.

[0092] In the several embodiments provided in this application, it should be understood that the disclosed methods and electronic devices can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0093] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0094] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0095] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a platform server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0096] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A test-based message sending method, characterized in that, The method includes: Obtain the message to be tested, wherein the message to be tested has a verification mechanism; In response to the sending operation of the message to be tested, the message to be tested is received, and the message to be tested is verified to obtain the verification result; The verification result is copied and assigned to the message to be tested to obtain the message to be sent; Send the message to be sent to the bus; Before the method responds to the sending operation for the message to be tested, receives the message to be tested, performs verification processing on the message to be tested, and obtains the verification result, the method further includes: Create a new script module for verifying the message to be tested; An IF instruction is added to the script module, wherein the IF instruction is used to determine whether the message receiving component has received the message to be tested and to execute subsequent scripts; Add a calculation script to the script module, wherein the calculation script is used to perform verification processing on the message to be tested; A first assignment script is added to the script module, wherein the first assignment script is used to assign the calculation result of the calculation script to the message sending component. Add an End IF instruction to the script module, wherein the End IF instruction is used to end the IF instruction; The response to the sending operation of the message to be tested includes receiving the message to be tested, performing verification processing on the message to be tested, and obtaining a verification result, including: The message to be tested is sent through the message sending component, and the message to be tested is received through the message receiving component. When the IF instruction determines that the receiving message component has received the message to be tested, it performs a calculation on the message to be tested according to the verification algorithm through the calculation script to obtain the calculation result. The step of copying and assigning the verification result to the message to be tested to obtain the message to be sent includes: The calculation result is assigned to the message sending component through the first assignment script; Execute the End IF instruction to end the IF instruction.

2. The method according to claim 1, characterized in that, The acquisition of the message to be tested includes: In response to an operation that opens the message editing menu, at least one message is displayed in the message editing menu; Select a target message from the at least one message as the message to be tested, and add the message to be tested to the message sending component and the message receiving component.

3. The method according to claim 1, characterized in that, The script module further includes a second assignment script, which is used to clear the received message component. After the calculation result is assigned to the sent message component through the first assignment script, the module further includes: The second assignment script clears the received message component to prepare for the next reception.

4. The method according to claim 1, characterized in that, The method further includes: In response to a modification request for the message to be tested, the modified message to be tested is added to the message sending component and the message receiving component; Modify the calculation script to match the modified test message.

5. A test-based message sending device, characterized in that, The device includes: The acquisition module is used to acquire the message to be tested, wherein the message to be tested has a verification mechanism; The verification module is configured to, in response to a sending operation for the message to be tested, receive the message to be tested, and perform verification processing on the message to be tested to obtain a verification result; before receiving the message to be tested and performing verification processing on the message to be tested to obtain a verification result, the module is further configured to: create a script module for verifying the message to be tested; add an IF instruction to the script module, wherein the IF instruction is used to determine whether the receiving message component has received the message to be tested and execute subsequent scripts; add a calculation script to the script module, wherein the calculation script is used to perform verification processing on the message to be tested; add a first assignment script to the script module, wherein the first assignment script is used to assign the calculation result of the calculation script to the sending message component; add an End IF instruction to the script module, wherein the End IF instruction... The IF instruction is used to terminate the IF instruction; the response to the sending operation of the message to be tested, receiving the message to be tested, and performing verification processing on the message to be tested to obtain a verification result includes: sending the message to be tested through the sending message component, and receiving the message to be tested through the receiving message component; when the IF instruction determines that the receiving message component has received the message to be tested, the calculation script performs a calculation on the message to be tested according to the verification algorithm to obtain the calculation result; The assignment module is used to copy and assign the verification result to the message to be tested to obtain a message to be sent; the step of copying and assigning the verification result to the message to be tested to obtain a message to be sent includes: assigning the calculation result to the message sending component through the first assignment script; executing the End IF instruction to end the IF instruction; The sending module is used to send the message to be sent to the bus.

6. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the test-based message transmission method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the test-based message sending method as described in any one of claims 1 to 4.