Multi-device calibration system, multi-device calibration method, device and medium
By connecting multiple devices to be calibrated on the CAN bus and using the device extension number and preset data protocol, the problem of low calibration efficiency of large-scale products in the prior art is solved, and efficient and accurate multi-equipment batch calibration is achieved.
Patent Information
- Application Number
- CN202510186381.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-06-10
AI Technical Summary
The prior art is difficult to achieve single large-volume product calibration, mainly due to the limitations of factors such as line complexity, bus form and data volume.
By using the CAN bus, multiple devices to be calibrated are connected to the same CAN channel at the same time. The upper computer enters the calibration mode through the device unlocking and switching instructions, generates the device expansion number, and generates and transmits calibration data through the preset data protocol.
The efficiency improvement of multi-equipment batch calibration is achieved, greatly reducing the overall time required, and improving the accuracy and reliability of equipment calibration.
Smart Images

Figure CN120121094A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of device calibration, and in particular to a multi-device calibration system, a multi-device calibration method, a device, and a medium. Background Art
[0002] Before a product is put into use, its key characteristics must be calibrated by a specific method, and this process is called calibration. Taking an Inertial Measurement Unit (IMU) as an example, this is a device used to measure the three-axis attitude angle (or angular rate) and acceleration of an object, mainly composed of an accelerometer and a gyroscope. IMUs are widely used in motion control devices such as drones and robots, and are also used in application scenarios that require precise displacement estimation. To ensure measurement accuracy, before using an IMU, its key characteristics such as temperature drift, noise, and zero offset usually need to be calibrated.
[0003] Currently, standard Controller Area Network (CAN) communication interfaces are usually used for calibration operations, and a one-to-one CAN interface calibration method is mostly adopted. However, due to limitations such as line complexity, bus form, and data volume, it is difficult to achieve single-batch calibration of products. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a multi-device calibration system, a multi-device calibration method, a device, and a medium. A method for batch calibrating devices using a CAN bus connects multiple devices to be calibrated to the same CAN channel at the same time, enabling multiple devices to be calibrated simultaneously in a single operation, improving the efficiency of multi-device batch calibration, and greatly reducing the overall time required. Moreover, the host computer can identify different devices to be calibrated through the device extension number, and the devices to be calibrated can also obtain the target calibration parameters required for their own calibration from multiple calibration parameters sent by the host computer through the device extension number, enhancing the accuracy and reliability of device calibration.
[0005] In a first aspect, an embodiment of this application provides a multi-device calibration system. The multi-device calibration system includes a host computer and multiple devices to be calibrated, and the multiple devices to be calibrated are connected to the host computer through the same CAN bus;
[0006] The host computer is configured to, when obtaining device information sent by each device to be calibrated through the CAN bus, send a device unlocking instruction to each device to be calibrated through the CAN bus to enable each device to be calibrated to enter a specific mode, and send a switching instruction to each device to be calibrated;
[0007] The device to be calibrated is used to switch to the device calibration mode and generate a device extension number when receiving the switching instruction, generate calibration data using a preset data protocol and raw data, and send the device extension number and the calibration data to the host computer through the CAN bus;
[0008] The host computer is further used to decode the calibration data of the device to be calibrated using the preset data protocol to obtain the raw data corresponding to the device to be calibrated, calculate the calibration parameters of the device to be calibrated from the raw data of the device to be calibrated, and return the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, so that the device to be calibrated can obtain the corresponding target calibration parameters based on the device extension number and complete its own calibration based on the target calibration parameters.
[0009] Further, when the host computer is used to return the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, the host computer is further used to:
[0010] Send a specific instruction to the device to be calibrated through the CAN bus, so that the device to be calibrated can feedback response information to the host computer through the CAN bus when obtaining the target calibration parameters.
[0011] Further, after the host computer is used to send a specific instruction to the device to be calibrated through the CAN bus, the host computer is further used to:
[0012] When the response information feedback from the device to be calibrated is not received, the device to be calibrated is marked as an abnormal device.
[0013] Further, when the host computer is used to calculate the calibration parameters of the device to be calibrated from the raw data of the device to be calibrated, the host computer is further used to:
[0014] When it is detected that the device to be calibrated is in an abnormal state based on the raw data, the device to be calibrated is marked as an abnormal device.
[0015] Further, the device to be calibrated is further used to generate the device extension number through the following steps:
[0016] Determine the preset number of digits of the device extension number to be generated;
[0017] Generate the device extension number according to the device serial number and the preset number of digits.
[0018] Further, when the device to be calibrated is used to generate calibration data using a preset data protocol and raw data, it is used to:
[0019] Compress the original data to a preset length to obtain compressed data bytes;
[0020] Read the message sequence number of the message counter, and generate specific data bytes based on the message sequence number, device number, and data type identifier of the original data;
[0021] Concatenate the compressed data bytes, the specific data bytes, and the check value to obtain the calibrated data.
[0022] In a second aspect, an embodiment of the present application further provides a multi-device calibration method, which is applied to a multi-device calibration system. The multi-device calibration method includes:
[0023] When the host computer obtains the device information sent by each device to be calibrated through the CAN bus, send a device unlocking instruction to each device to be calibrated through the CAN bus to enable each device to be calibrated to enter a specific mode, and send a switching instruction to each device to be calibrated;
[0024] When receiving the switching instruction, the device to be calibrated switches to the device calibration mode and generates a device extension number, generates calibrated data using a preset data protocol and original data, and sends the device extension number and the calibrated data to the host computer through the CAN bus;
[0025] The host computer decodes the calibrated data of the device to be calibrated using the preset data protocol to obtain the original data corresponding to the device to be calibrated, calculates the calibration parameters of the device to be calibrated from the original data of the device to be calibrated, and returns the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, so that the device to be calibrated obtains the corresponding target calibration parameters based on the device extension number and completes its own calibration based on the target calibration parameters.
[0026] Further, when the host computer returns the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, the multi-device calibration method further includes:
[0027] The host computer sends a specific instruction to the device to be calibrated through the CAN bus, so that the device to be calibrated feeds back response information to the host computer through the CAN bus when it obtains the target calibration parameters.
[0028] Further, after the host computer sends a specific instruction to the device to be calibrated through the CAN bus, the multi-device calibration method further includes:
[0029] When the response information feedback by the device to be calibrated is not received, the device to be calibrated is marked as an abnormal device.
[0030] Further, when the host computer calculates the calibration parameters of the device to be calibrated from the original data of the device to be calibrated, the multi-device calibration method further includes:
[0031] When an abnormal state of the device to be calibrated is detected based on the original data, the device to be calibrated is marked as an abnormal device.
[0032] Further, when the device to be calibrated generates calibration data using a preset data protocol and the original data, the multi-device calibration method further includes:
[0033] Compress the original data to a preset length to obtain compressed data bytes;
[0034] Read the message sequence number of the message counter, and generate specific data bytes based on the message sequence number, device number, and data type identifier of the original data;
[0035] Concatenate the compressed data bytes, the specific data bytes, and the check value to obtain the calibration data.
[0036] In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the multi-device calibration method as described above are executed.
[0037] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the multi-device calibration method as described above are executed.
[0038] A multi-device calibration system, a multi-device calibration method, a device and a medium provided by an embodiment of the present application. A plurality of devices to be calibrated are connected to a host computer through the same CAN bus. When the host computer obtains device information sent by each device to be calibrated through the CAN bus, it sends a device unlocking instruction to each device to be calibrated through the CAN bus to enable each device to enter a specific mode, and sends a switching instruction to each device to be calibrated. When the device to be calibrated receives the switching instruction, it switches to the device calibration mode and generates a device extension number, generates calibration data by using a preset data protocol and original data, and sends the device extension number and the calibration data to the host computer through the CAN bus. The host computer decodes the calibration data of the device to be calibrated by using the preset data protocol to obtain the original data corresponding to the device to be calibrated, calculates the calibration parameters of the device to be calibrated from the original data of the device to be calibrated, and returns the device extension number and the calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, so that the device to be calibrated obtains the corresponding target calibration parameters based on the device extension number and completes its own calibration based on the target calibration parameters.
[0039] The method for batch calibrating devices using the CAN bus in this application connects multiple devices to be calibrated to the same CAN channel at the same time, realizing multi-channel CAN calibration. Multiple devices to be calibrated can be calibrated at the same time, and multi-channel acquisition, calibration, and analysis and testing can be realized without changing the software of the existing product. Multiple devices to be calibrated can be processed at the same time, improving the efficiency of multi-device batch calibration and greatly reducing the overall required time. And each device to be calibrated generates its own unique device extension number. The host computer can identify different devices to be calibrated through the device extension number, and the device to be calibrated can also obtain the target calibration parameters required for its own calibration from multiple calibration parameters sent by the host computer through the device extension number, improving the accuracy and reliability of device calibration.
[0040] To make the above objects, features, and advantages of the present application more obvious and understandable, the following specifically gives preferred embodiments and, in conjunction with the accompanying drawings, makes a detailed description as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] To more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can also be obtained based on these drawings without creative efforts.
[0042] Figure 1 It is a schematic structural diagram of a multi-device calibration system provided by an embodiment of the present application;
[0043] Figure 2 A schematic flowchart of a multi-device calibration provided by an embodiment of the present application;
[0044] Figure 3 A flowchart of a multi-device calibration method provided by an embodiment of the present application;
[0045] Figure 4 A schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are only a part rather than all of the embodiments of the present application. Usually, the components of the embodiments of the present application described and illustrated in the accompanying drawings herein can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application claimed, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, every other embodiment obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.
[0047] First, the applicable application scenarios of the present application are introduced. The present application can be applied to the technical field of device calibration.
[0048] Before a product is put into use, its key characteristics must be calibrated by a specific method, and this process is called calibration. Taking an inertial measurement unit (IMU) as an example, this is a device used to measure the three-axis attitude angle (or angular rate) and acceleration of an object, mainly composed of an accelerometer and a gyroscope. IMUs are widely used in motion control devices, such as drones, robots, etc., and are also used in application scenarios that require accurate displacement estimation. To ensure measurement accuracy, before using an IMU, its key characteristics, such as temperature drift, noise, zero bias, etc., usually need to be calibrated.
[0049] It has been found through research that the CAN (Controller Area Network) communication interface is usually used in products. The CAN communication adopts a two-wire specification. The characteristics of CAN communication are half-duplex, bus-type, multi-master control, and the messages are in broadcast form. The CAN bus communication, in cooperation with the terminal resistors, provides an impedance that matches the bus characteristics, prevents signal reflection, ensures signal integrity, and thus guarantees the stability and reliability of data transmission. Under normal circumstances, after the device is powered on, it outputs standard information, which is usually the information required by the user. The unified output information, input information, ID, output frequency, etc. will be defined. Under one CAN bus channel, only one device can be mounted so as to accurately identify the data source, parse and use the data. Currently, the standard CAN communication interface is usually adopted for calibration operations, and the one-to-one CAN interface calibration method is mostly used. However, due to factors such as line complexity, bus form, and data volume, it is difficult to achieve single-batch calibration of products.
[0050] To solve the technical problem of the large difficulty in calibrating a large number of devices caused by the fact that only one device can be mounted on one CAN channel in the above-mentioned existing technology, based on this, the embodiment of the present application provides a multi-device calibration system, which improves the efficiency of multi-device batch calibration, greatly reduces the overall time required, and also improves the accuracy and reliability of device calibration.
[0051] Please refer to Figure 1 , Figure 1 which is a schematic structural diagram of a multi-device calibration system provided by an embodiment of the present application. As Figure 1 shown in, the multi-device calibration system 100 provided by the embodiment of the present application includes a host computer A and multiple devices to be calibrated B1... Bn. The multiple devices to be calibrated B1... Bn are connected to the host computer A through the same CAN bus.
[0052] The host computer is used to, when obtaining the device information sent by each device to be calibrated through the CAN bus, send a device unlocking instruction to each device to be calibrated through the CAN bus to enable each device to be calibrated to enter a specific mode, and send a switching instruction to each device to be calibrated.
[0053] Here, for the above steps, at the beginning of calibration, first the host computer needs to power on all the devices to be calibrated. At this time, the host computer cannot recognize how many devices to be calibrated are on the channel. Then the host computer needs to check whether there are devices to be calibrated on the CAN channel. If there are, proceed to the next step; if not, wait or prompt an error. Specifically, each device to be calibrated periodically sends device information to the host computer via the CAN bus. If the host computer receives this information via the CAN bus within a preset time after power-on, it determines that there is a device to be calibrated connected. It can be understood that at this time, the device information sent by the devices to be calibrated is a unified device number and content. Therefore, each device to be calibrated cannot be recognized.
[0054] Then, the host computer sends a device unlocking instruction to each device to be calibrated via the CAN bus so that each device to be calibrated enters a specific mode. Here, according to the embodiments provided in the present application, the specific mode is the internal mode. The host computer sends an unlocking instruction to each device to be calibrated to make the device enter the internal mode. After the device to be calibrated is unlocked and enters the internal mode based on the unlocking instruction, corresponding permissions are opened for the host computer, enabling the host computer to subsequently obtain and modify corresponding data of the device to be calibrated. Specifically, the unlocking instruction is two pieces of message information with standard CAN IDs, sent continuously, and the sending time interval should be less than 500 ms, which is used to correctly unlock the device to be calibrated and make it enter the internal mode. The ID of this message is the standard reception ID of the device to be calibrated, usually reserved through user settings. As an example, the unlocking message can be 0x58, 0x52, 0x55, 0x4E, 0x4C, 0x43, 0x46, 0x47, / *"XRUNLCFG"* / 0x55, 0x4E, 0x4C, 0x43, 0x46, 0x47, 0x52, 0x58 / *"UNLCFGRX"* / . Then, the host computer sends a switching instruction to each device to be calibrated via the CAN bus. Here, since all the devices to be calibrated are on the same CAN channel, this information will be broadcast to all devices to be calibrated. As an example, the current calibration mode switching message is: 0x58, 0x52, 0x06, 0x00, 0x00, 0x00, 0x00, 0x16.
[0055] The device to be calibrated is used to switch to the device calibration mode and generate a device extension number when receiving the switching instruction, generate calibration data using a preset data protocol and original data, and send the device extension number and the calibration data to the host computer via the CAN bus.
[0056] Here, for each device to be calibrated, the device to be calibrated receives a switching instruction to switch to the device calibration mode, and generates its own device extension number in the device calibration mode. In this way, even if multiple devices to be calibrated are hung on the same CAN channel, the host computer can identify the device to be calibrated individually through the device extension number. At the same time, the device to be calibrated generates calibration data according to the pre-set preset data protocol and its own original data, and sends the device extension number and calibration data to the host computer through the CAN bus.
[0057] As an optional embodiment, according to the multi-device calibration system provided by the present application, the device to be calibrated is further used to generate the device extension number through the following steps:
[0058] Determine a preset number of digits of a device extension number to be generated; and generate the device extension number according to the device serial number and the preset number of digits.
[0059] Here, the device serial number refers to the device SN number (Serial Number). The SN number is a unique identifier assigned by the manufacturer to each device, usually consisting of letters, numbers or a combination, and is used to distinguish different devices of the same model.
[0060] Each device to be calibrated will generate a unique device extension number based on its own serial number (SN number), and the device extension number obtained thereby is unique. For the above two steps, in the specific implementation, the device to be calibrated first determines the preset number of digits of the device extension number to be generated. Here, as an example, the preset number of digits of the device extension number to be generated can be 29 digits, which is not specifically limited in this application. Then, the device to be calibrated generates its own device extension number based on its own device serial number and the preset number of digits. Here, as an example, when the preset number of digits is 29 digits, the device serial number is 29 digits, and the device serial number can be directly used as the device extension number. For another example, if the device serial number is 32 digits, the 4th to 32nd digits of the device serial number can be used as the device extension number. For another example, if the device serial number is 28 digits, the device serial number can be used as the 1st to 28th digits of the device extension number, and the 29th digit is 0. In this way, the device extension number generated by each device to be calibrated is unique. In this case, one device extension number corresponds to one device to be calibrated. At this time, the host computer can accurately identify each device to be calibrated on the channel and the number of devices to be calibrated on the channel. There will be no conflict when the devices to be calibrated on the same CAN bus send information. At the same time, the arbitration mechanism of the CAN bus can be used to send information of multiple devices to be calibrated in time.
[0061] As an optional embodiment, according to the multi-device calibration system provided by the present application, when the device to be calibrated is used to generate calibration data using a preset data protocol and raw data, it is specifically used to:
[0062] A: Compress the original data to a preset length to obtain compressed data bytes.
[0063] Here, since the standard CAN message can only send 8 bytes of data, it is necessary to compress the original data of the device to be calibrated. For step A above, in specific implementation, in the 8-byte standard message, the first 6 bytes are used to transmit the original data of the device to be calibrated. For example, when the device to be calibrated is an inertial measurement unit, the original data may include the information of three-axis accelerometers, three-axis gyroscopes, and temperature. Compress the original data of the device to be calibrated to 6 bytes to obtain compressed data bytes.
[0064] B: Read the message sequence number of the message counter and generate specific data bytes based on the message sequence number, device number, and data type identifier of the original data.
[0065] Here, the message counter is a mechanism used to identify and track the order of data transmission, usually used in communication protocols to ensure data integrity and order. In this application, the message counter is used to implement time-division multiplexing, that is, multiple messages are transmitted under the same CAN ID. For step B above, in specific implementation, read the message sequence number of the message counter and generate specific data bytes based on the message sequence number, device number, and data type identifier of the original data. Here, in the 7th byte, the first four bits are used to mark the message counter, which cycles from 0 to 15, the next two bits are used to calibrate the device number of the device to be calibrated, so that the data of multiple devices to be calibrated in the same product can be identified, and the next two bits are used to indicate the data type. For example, when the device to be calibrated is an inertial measurement unit, the data type includes accelerometer data, gyroscope data, and temperature data.
[0066] C: Concatenate the compressed data bytes, the specific data bytes, and the check value to obtain the calibrated data.
[0067] Here, the check value can be CRC8 check. CRC8 (Cyclic Redundancy Check) is a check algorithm used to detect data transmission errors. It calculates the check value of the data and attaches it to the data frame. The receiving party can verify the integrity of the data by recalculating the check value. For step C above, in specific implementation, concatenate the compressed data bytes obtained in step A, the specific data bytes obtained in step B, and the check value to obtain the calibrated data.
[0068] In this way, according to the above steps A - C, since CAN messages can only carry a small amount of data (8 bytes), the present application adopts a special data packaging strategy, enabling more information to be included in one message. For example, some bytes are used to represent different sensor readings, a message sequence number is added to the standard 8 - byte data, and a checksum is added to ensure data integrity. Through time - division multiplexing and message extension, the 8 - byte limit of the CAN bus is effectively utilized to achieve the transmission of data of multiple devices to be calibrated.
[0069] Here, it should be noted that the above steps A - C are only one embodiment of the data packaging protocol. In fact, the data packaging protocol is not limited to the above embodiment.
[0070] The host computer is further configured to use the preset data protocol to decode the calibration data of the device to be calibrated to obtain the original data corresponding to the device to be calibrated, calculate the calibration parameters of the device to be calibrated from the original data of the device to be calibrated, and return the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, so that the device to be calibrated can obtain the corresponding target calibration parameters based on the device extension number and complete its own calibration based on the target calibration parameters.
[0071] Here, in specific implementation, after the host computer receives the calibration data of each device to be calibrated, it decodes the calibration data according to the above - mentioned preset data protocol to obtain the required original data. Then, the host computer calculates the calibration parameters of the device to be calibrated based on the original data. Specifically, the host computer can identify whether the device to be calibrated is abnormal through the original data and calibration turntable information, etc., and calculate the calibration parameters of the device to be calibrated. The host computer returns the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus. Since each device to be calibrated has a unique device extension number, the device to be calibrated can determine the target calibration parameters it needs from the multiple calibration parameters sent by the host computer based on the device extension number and complete its own calibration based on the target calibration parameters.
[0072] As an alternative embodiment, when the host computer is used to calculate the calibration parameters of the device to be calibrated from the original data of the device to be calibrated, the host computer is further configured to:
[0073] When it is detected based on the original data that the device to be calibrated is in an abnormal state, the device to be calibrated is marked as an abnormal device.
[0074] Here, when the host computer calculates the calibration parameters, when the host computer detects that the device to be calibrated is in an abnormal state based on the original data of the device to be calibrated, the device to be calibrated is marked as an abnormal device.
[0075] As an alternative embodiment, when the host computer is used to return the device expansion number and calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, the host computer is further used for:
[0076] Sending a specific instruction to the device to be calibrated through the CAN bus, so that the device to be calibrated feeds back response information to the host computer through the CAN bus when obtaining the target calibration parameter.
[0077] Here, when the host computer sends calibration parameters, the host computer also sends a specific instruction to each device to be calibrated through the CAN bus to instruct the device to be calibrated to enter the silent mode. In the silent mode, only the host computer sends calibration parameters to the corresponding device to be calibrated through the CAN bus, and the device to be calibrated feeds back the corresponding response information to the host computer when obtaining the target calibration parameter it needs. Other devices to be calibrated do not send messages to the host computer through the CAN bus until the calibration parameters of all devices to be calibrated are sent.
[0078] Further, after the host computer is used to send a specific instruction to the device to be calibrated through the CAN bus, the host computer is further used for:
[0079] When the response information fed back by the device to be calibrated is not received, the device to be calibrated is marked as an abnormal device.
[0080] Here, when the host computer does not receive the response information fed back by the device to be calibrated, the device to be calibrated is marked as an abnormal device.
[0081] Further, the host computer counts the calibration status of each device to be calibrated, that is, a normal device or an abnormal device, and outputs it to complete the calibration of multiple devices to be calibrated.
[0082] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a multi-device calibration provided by an embodiment of the present application. As shown in Figure 2As shown, first, the host computer powers on. Then, it identifies whether there is a device connected under each CAN channel by checking if it can receive CAN messages. If there is, it sends a switching command. Each device in the multi-device system obtains the command sent by the host computer and switches to the device calibration mode based on the switching command. At this time, the device will output information with a specific ID. Then, the host computer collects the data with the specific ID sent by the device, and each ID corresponds to a device. Due to the characteristics of the CAN bus, when each ID sends information, it can only contain 8 bytes of data at a time. Count the total number of CAN IDs under all CAN channels, that is, how many devices are on the CAN bus. The device compresses the data to be sent and uses the time-division multiplexing method to send the data by means of time-sharing marking. After the host computer receives the data, it parses and repackages it to obtain the original data, and calculates the calibration parameters of the device to be calibrated through the corresponding algorithm. Then, the host computer saves the calibration parameters for traceability and sends the calibration data to the device through the specific ID. When sending the calibration parameters to the device, a specific instruction is sent to make the device enter the silent mode. In the silent mode, the device does not send information to the bus and only replies with the response information related to the reception of the calibration parameters until the calibration parameters of all devices are received. If an abnormality is found in the device during the calculation of the calibration parameters, or an abnormality occurs during the device's reception of the calibration parameters, the abnormal state of the device can be marked. For each device, it enters the silent mode based on the specific instruction sent by the host computer, receives the calibration parameters, and gives a response to the host computer to indicate the completion of the reception of the calibration parameters. The host computer determines and identifies that the device has successfully received the calibration parameters, simultaneously counts the calibration status of the multi-devices and gives an output, and stores it for traceability. At this time, the calibration is completed.
[0083] The multi-device calibration system provided by the embodiment of the present application connects multiple devices to be calibrated to the host computer through the same CAN bus. When the host computer obtains the device information sent by each device to be calibrated through the CAN bus, it sends a device unlocking instruction to each device to be calibrated through the CAN bus to make each device to be calibrated enter a specific mode, and sends a switching instruction to each device to be calibrated; when the device to be calibrated receives the switching instruction, it switches to the device calibration mode and generates a device extension number, generates calibration data by using a preset data protocol and the original data, and sends the device extension number and the calibration data to the host computer through the CAN bus; the host computer decodes the calibration data of the device to be calibrated by using the preset data protocol to obtain the original data corresponding to the device to be calibrated, calculates the calibration parameters of the device to be calibrated from the original data of the device to be calibrated, and returns the device extension number and the calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, so that the device to be calibrated obtains the corresponding target calibration parameters based on the device extension number and completes its own calibration based on the target calibration parameters.
[0084] The method of using a CAN bus batch calibration device in this application connects multiple devices to be calibrated to the same CAN channel simultaneously to achieve multi-channel CAN calibration. By switching to the CAN extended ID as the communication ID to identify different products correspondingly, multiple devices to be calibrated can be calibrated simultaneously in one time. It can achieve multi-channel acquisition, calibration, and analysis and testing without changing the software of the existing products. Multiple devices to be calibrated can be processed simultaneously at one time, improving the efficiency of multi-device batch calibration and greatly reducing the overall required time. Moreover, each device to be calibrated generates its own unique device extension number. The host computer can identify different devices to be calibrated through the device extension number, and the device to be calibrated can also obtain the target calibration parameters required for its own calibration from multiple calibration parameters sent by the host computer through the device extension number, improving the accuracy and reliability of device calibration.
[0085] Please refer to Figure 3 , Figure 3 which is a flowchart of a multi-device calibration method provided by an embodiment of this application. The multi-device calibration method is applied to a multi-device calibration system, as shown in Figure 3 . The multi-device calibration method includes:
[0086] S301. When the host computer obtains the device information sent by each device to be calibrated through the CAN bus, it sends a device unlocking instruction to each device to be calibrated through the CAN bus to make each device to be calibrated enter a specific mode, and sends a switching instruction to each device to be calibrated;
[0087] S302. When the device to be calibrated receives the switching instruction, it switches to the device calibration mode and generates a device extension number, generates calibration data using a preset data protocol and original data, and sends the device extension number and the calibration data to the host computer through the CAN bus;
[0088] S303. The host computer decodes the calibration data of the device to be calibrated using the preset data protocol to obtain the original data corresponding to the device to be calibrated, calculates the calibration parameters of the device to be calibrated from the original data of the device to be calibrated, and returns the device extension number and the calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, so that the device to be calibrated obtains the corresponding target calibration parameters based on the device extension number and completes its own calibration based on the target calibration parameters.
[0089] Furthermore, when the host computer returns the device extension number and the calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, the multi-device calibration method further includes:
[0090] The host computer sends a specific instruction to the device to be calibrated through the CAN bus, so that the device to be calibrated feeds back response information to the host computer through the CAN bus when it obtains the target calibration parameter.
[0091] Further, after the host computer is used to send a specific instruction to the device to be calibrated through the CAN bus, the multi-device calibration method further includes:
[0092] When the host computer does not receive the response information fed back by the device to be calibrated, the device to be calibrated is marked as an abnormal device.
[0093] Further, when the host computer is used to calculate the calibration parameter of the device to be calibrated from the original data, the multi-device calibration method further includes:
[0094] When the host computer detects an abnormal state of the device to be calibrated based on the original data, the device to be calibrated is marked as an abnormal device.
[0095] Further, the device to be calibrated generates the device extension number through the following steps:
[0096] Determine the preset number of digits of the device extension number to be generated;
[0097] Generate the device extension number according to the device serial number and the preset number of digits.
[0098] Further, the generation of the calibration data using the preset data protocol and the original data includes:
[0099] Compress the original data to a preset length to obtain compressed data bytes;
[0100] Read the message sequence number of the message counter, and generate specific data bytes based on the message sequence number, device serial number, and data type identifier of the original data;
[0101] Concatenate the compressed data bytes, the specific data bytes, and the check value to obtain the calibration data.
[0102] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 4 shown in
[0103] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 440. When the machine-readable instructions are executed by the processor 410, the steps of the multi-device calibration method in the method embodiments as described above can be executed. For the specific implementation manners, reference can be made to the method embodiments and will not be elaborated herein. Figure 2 or Figure 3 shown in the method embodiments. For the specific implementation manners, reference can be made to the method embodiments and will not be elaborated herein.
[0104] An embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the multi-device calibration method in the method embodiments as described above can be executed. Figure 2 or Figure 3 shown in the method embodiments. For the specific implementation manners, reference can be made to the method embodiments and will not be elaborated herein.
[0105] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0106] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings, direct couplings, or communication connections shown or discussed with each other can be through some communication interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0107] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0108] In addition, in each embodiment of the present application, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0109] When the above-mentioned functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or part of this 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 for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs that can store program codes.
[0110] Finally, it should be noted that the above-mentioned embodiments are only specific implementation manners of the present application, used to illustrate the technical solutions of the present application, rather than limiting them. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present application can still modify the technical solutions described in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes, or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A multi-device calibration system, characterized in that: The multi-device calibration system comprises a host computer and a plurality of devices to be calibrated, wherein the plurality of devices to be calibrated are connected to the host computer via the same CAN bus; The host computer is used to send a device unlocking instruction to each device to be calibrated through the CAN bus to make each device to be calibrated enter a specific mode, and send a switching instruction to each device to be calibrated when the device information sent by each device to be calibrated is obtained through the CAN bus; The device to be calibrated is used to switch to the device calibration mode and generate a device extension number when receiving the switching instruction, generate calibration data using a preset data protocol and original data, and send the device extension number and the calibration data to the host computer through the CAN bus; The host computer is also used to decode the calibration data of the device to be calibrated using the preset data protocol to obtain the original data corresponding to the device to be calibrated, calculate the original data of the device to be calibrated to obtain the calibration parameters of the device to be calibrated, and return the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, so that the device to be calibrated obtains the corresponding target calibration parameters based on the device extension number and completes its own calibration based on the target calibration parameters.
2. The multi-device calibration system according to claim 1, characterized in that: When the host computer is used to return the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated via the CAN bus, the host computer is also used to: A specific instruction is sent to the device to be calibrated via the CAN bus, so that the device to be calibrated feeds back response information to the host computer via the CAN bus when the target calibration parameters are acquired.
3. The multi-device calibration system according to claim 2, characterized in that: After the host computer is used to send a specific instruction to the device to be calibrated via the CAN bus, the host computer is also used to: When no response information fed back by the device to be calibrated is received, the device to be calibrated is marked as an abnormal device.
4. The multi-device calibration system according to claim 1, characterized in that: When the host computer is used to calculate the original data of the device to be calibrated to obtain the calibration parameters of the device to be calibrated, the host computer is also used to: When it is detected based on the original data that the device to be calibrated is in an abnormal state, the device to be calibrated is marked as an abnormal device.
5. The multi-device calibration system according to claim 1, characterized in that: The device to be calibrated is also used to generate the device extension number through the following steps: Determine the preset number of digits of the device extension number to be generated; The device extension number is generated according to the device serial number and the preset number of digits.
6. The multi-device calibration system according to claim 1, characterized in that: When the device to be calibrated is used to generate calibration data using a preset data protocol and original data, it is used to: Compressing the original data to a preset length to obtain compressed data bytes; Reading a message sequence number of a message counter, and generating a specific data byte based on the message sequence number, a device sequence number, and a data type identifier of the original data; The compressed data bytes, the specific data bytes and the check value are concatenated to obtain the calibration data.
7. A multi-device calibration method, characterized in that: The multi-device calibration system according to any one of claims 1 to 6 is applied, wherein the multi-device calibration method comprises: When the host computer obtains the device information sent by each device to be calibrated through the CAN bus, it sends a device unlocking instruction to each device to be calibrated through the CAN bus to make each device to be calibrated enter a specific mode, and sends a switching instruction to each device to be calibrated; The device to be calibrated switches to the device calibration mode and generates a device extension number when receiving the switching instruction, generates calibration data using a preset data protocol and original data, and sends the device extension number and the calibration data to the host computer via the CAN bus; The host computer uses the preset data protocol to decode the calibration data of the device to be calibrated to obtain the original data corresponding to the device to be calibrated, calculates the original data of the device to be calibrated to obtain the calibration parameters of the device to be calibrated, and returns the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated through the CAN bus, so that the device to be calibrated obtains the corresponding target calibration parameters based on the device extension number and completes its own calibration based on the target calibration parameters.
8. The multi-device calibration method according to claim 7, characterized in that: When the host computer returns the device extension number and calibration parameters of the device to be calibrated to the device to be calibrated via the CAN bus, the multi-device calibration method further includes: The host computer sends a specific instruction to the device to be calibrated via the CAN bus, so that the device to be calibrated feeds back response information to the host computer via the CAN bus when the target calibration parameters are acquired.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the multi-device calibration method as described in any one of claims 7 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the multi-device calibration method as described in any one of claims 7 to 8 are executed.