Battery charging and discharging test method and system based on SCPI protocol
Through the battery charging and discharging test method and system based on the SCPI protocol, the problem that traditional battery testing equipment is difficult to achieve remote control is solved, and the remote charging and discharging test of the battery is realized, which improves the testing efficiency and enhances data security.
Patent Information
- Application Number
- CN202411711621.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-15
AI Technical Summary
Traditional battery testing equipment is difficult to achieve remote control, which limits battery testing scenarios and cannot meet the automation and remote testing requirements of modern battery testing requirements.
Using the battery charge and discharge test method and system based on the SCPI protocol, a command set including channel control subsystem commands and work-step settings subsystem commands are generated through the server, and a charging and discharge test command is generated and remotely issued to the test equipment to realize remote charge and discharge test of the battery.
Remote charging and discharging test of the battery is realized, which significantly improves the battery test efficiency, and ensures the security of the test data through security measures such as encryption and distributed backup.
Smart Images

Figure CN119828013A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery testing, and in particular to a battery charging and discharging testing method and system based on SCPI protocol. Background Art
[0002] Batteries need to undergo a series of tests during production and use to ensure the quality of the batteries or to locate faults. For battery testing, traditional test equipment is mostly used through supporting host computer software, which is difficult to achieve remote control, limiting battery testing scenarios.
[0003] As the automation requirements for battery testing become higher and higher, the demand for remote battery testing is also increasing. Traditional methods can no longer meet the current testing needs. Therefore, how to provide a battery charge and discharge test method and system based on the SCPI protocol to achieve remote charge and discharge testing of batteries to improve battery testing efficiency has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a battery charge and discharge test method and system based on the SCPI protocol, so as to realize remote charge and discharge test of the battery and improve the battery test efficiency.
[0005] In a first aspect, the present invention provides a battery charge and discharge test method based on the SCPI protocol, comprising the following steps:
[0006] Step S1, the server generates a command set including a channel control subsystem command and a work step setting subsystem command based on the SCPI protocol;
[0007] Step S2: the server generates a charge-discharge test instruction based on the command set, and remotely sends the charge-discharge test instruction to the test device;
[0008] Step S3: the test device parses the received charge and discharge test instruction to obtain the corresponding channel control subsystem command and the step setting subsystem command, and selects the test channel corresponding to the battery to execute the corresponding test step based on the channel control subsystem command and the step setting subsystem command, so as to perform charge and discharge test on the battery;
[0009] Step S4: During the test, the test device executes a pause test, a continue test, a stop test, or a new test based on the test adjustment instruction sent by the server;
[0010] Step S5: The server obtains the test data of the test device and stores and backs up the test data.
[0011] Furthermore, the step S2 is specifically as follows:
[0012] The server generates a charge and discharge test instruction of the battery based on the command set, and remotely sends the charge and discharge test instruction to the test device through the UDP / IP protocol and the SCPI service port.
[0013] Furthermore, the step S3 is specifically as follows:
[0014] The test device receives the charge and discharge test instructions sent by the server in real time, parses the charge and discharge test instructions based on the SCPI protocol to obtain the carried channel control subsystem commands and step setting subsystem commands, selects the test channel corresponding to the battery based on the channel control subsystem command, and executes the corresponding test step based on the step setting subsystem command to perform charge and discharge tests on the battery.
[0015] Furthermore, in step S5, the server obtains the test data of the test device specifically as follows:
[0016] The server sends a test data reporting instruction carrying a data receiving IP address, a data receiving port, and a data reporting period to the test device, and the test device periodically uploads the test data based on the received test data reporting instruction;
[0017] Alternatively, the server sends a channel data query instruction to the test device to actively obtain the test data, and detects the operating status of the test device based on whether the test data is received within a preset time threshold.
[0018] Furthermore, in step S5, storing and backing up the test data is specifically as follows:
[0019] The server creates a pair of public keys and private keys based on the RSA algorithm, encrypts the public key through the 3DES algorithm to obtain a secret key, performs MAC calculation on the test data to obtain a MAC value, obtains the current timestamp, encrypts the test data, MAC value and timestamp through the private key to obtain primary encrypted data, maps the primary encrypted data through a preset mapping rule to obtain secondary encrypted data, encrypts the secondary encrypted data and the secret key through the ECDSA algorithm to obtain an encrypted test data packet, stores the encrypted test data packet to a specified path, and performs distributed backup of the encrypted test data packet.
[0020] In a second aspect, the present invention provides a battery charge and discharge test system based on the SCPI protocol, comprising the following modules:
[0021] A command set generation module, used for the server to generate a command set including channel control subsystem commands and work step setting subsystem commands based on the SCPI protocol;
[0022] A charge and discharge test instruction sending module, used for the server to generate a charge and discharge test instruction based on the command set, and remotely send the charge and discharge test instruction to the test equipment;
[0023] A charge and discharge test module, configured to test the device to parse the received charge and discharge test instruction, obtain the corresponding channel control subsystem command and the step setting subsystem command, and select the test channel corresponding to the battery to execute the corresponding test step based on the channel control subsystem command and the step setting subsystem command, so as to perform charge and discharge test on the battery;
[0024] The test adjustment module is used to test the device during the test process, based on the test adjustment instruction sent by the server, to execute the pause test, continue the test, stop the test or start a new test;
[0025] The test data management module is used for the server to obtain the test data of the test equipment and store and back up the test data.
[0026] Furthermore, the charge and discharge test instruction issuing module is specifically used for:
[0027] The server generates a charge and discharge test instruction of the battery based on the command set, and remotely sends the charge and discharge test instruction to the test device through the UDP / IP protocol and the SCPI service port.
[0028] Furthermore, the charge and discharge test module is specifically used for:
[0029] The test device receives the charge and discharge test instructions sent by the server in real time, parses the charge and discharge test instructions based on the SCPI protocol to obtain the carried channel control subsystem commands and step setting subsystem commands, selects the test channel corresponding to the battery based on the channel control subsystem command, and executes the corresponding test step based on the step setting subsystem command to perform charge and discharge tests on the battery.
[0030] Furthermore, in the test data management module, the server obtains the test data of the test device specifically as follows:
[0031] The server sends a test data reporting instruction carrying a data receiving IP address, a data receiving port, and a data reporting period to the test device, and the test device periodically uploads the test data based on the received test data reporting instruction;
[0032] Alternatively, the server sends a channel data query instruction to the test device to actively obtain the test data, and detects the operating status of the test device based on whether the test data is received within a preset time threshold.
[0033] Furthermore, in the test data management module, storing and backing up the test data is specifically as follows:
[0034] The server creates a pair of public keys and private keys based on the RSA algorithm, encrypts the public key through the 3DES algorithm to obtain a secret key, performs MAC calculation on the test data to obtain a MAC value, obtains the current timestamp, encrypts the test data, MAC value and timestamp through the private key to obtain primary encrypted data, maps the primary encrypted data through a preset mapping rule to obtain secondary encrypted data, encrypts the secondary encrypted data and the secret key through the ECDSA algorithm to obtain an encrypted test data packet, stores the encrypted test data packet to a specified path, and performs distributed backup of the encrypted test data packet.
[0035] The advantages of the present invention are:
[0036] 1. Generate a command set including channel control subsystem commands and step setting subsystem commands based on the SCPI protocol through the server, generate charge and discharge test instructions based on the command set and send them remotely to the test equipment; then the test equipment parses the charge and discharge test instructions to obtain the corresponding channel control subsystem commands and step setting subsystem commands, selects the test channel corresponding to the battery to execute the corresponding test step based on the channel control subsystem commands and step setting subsystem commands, so as to perform charge and discharge test on the battery; during the test, the test equipment executes pause test, continues test, stops test or starts new test based on the test adjustment instructions sent by the server, and finally the server obtains the test data of the test equipment and stores and backs it up; that is, generate a command set based on the SCPI protocol, and then generate charge and discharge test instructions based on the command set and send them remotely to the test equipment for execution, and remotely obtain the test data of the test equipment, so as to realize remote charge and discharge test on the battery, which greatly improves the battery test efficiency.
[0037] 2. Create a pair of public and private keys through the RSA algorithm, encrypt the public key through the 3DES algorithm to obtain the secret key, perform MAC calculation on the test to obtain the MAC value, obtain the current timestamp, encrypt the test data, MAC value and timestamp through the private key to obtain the first-level encrypted data, map the first-level encrypted data through the preset mapping rule to obtain the second-level encrypted data, encrypt the second-level encrypted data and the key through the ECDSA algorithm to obtain an encrypted test data packet, store the encrypted test data packet to the specified path, and perform distributed backup of the encrypted test data packet; subsequently, the MAC value can be used for integrity verification, and the timestamp can be used for time validity verification. The data encrypted by the private key can only be decrypted by the public key. The public key is encrypted multiple times. If the corresponding encryption algorithm or data transformation rule is not known, the encrypted test data packet cannot be cracked. At least 8 security measures (RSA algorithm, public and private keys, 3DES algorithm, MAC calculation, timestamp, mapping rule, ECDSA algorithm, distributed backup) are taken to prevent the test data from being stolen and tampered with in plain text, which greatly improves the security of test data storage.
[0038] 3. The operating status of the test equipment is detected by whether the test data is received within the preset time threshold. When the operating status of the test equipment is abnormal, an emergency stop can be performed, which greatly improves the safety of battery charging and discharging tests. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0040] Figure 1 The present invention is a flow chart of a battery charging and discharging test method based on the SCPI protocol.
[0041] Figure 2 It is a structural schematic diagram of a battery charge and discharge test system based on SCPI protocol of the present invention. DETAILED DESCRIPTION
[0042] The overall idea of the technical solution in the embodiment of the present application is as follows: a command set is generated based on the SCPI protocol, and then a charge and discharge test instruction is generated based on the command set and sent remotely to the test equipment for execution, and the test data of the test equipment is obtained remotely to realize remote charge and discharge testing of the battery, thereby improving the battery testing efficiency.
[0043] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of a battery charge and discharge test method based on the SCPI protocol of the present invention comprises the following steps:
[0044] Step S1, the server generates a command set including a channel control subsystem command and a work step setting subsystem command based on the SCPI protocol;
[0045] Step S2: the server generates a charge-discharge test instruction based on the command set, and remotely sends the charge-discharge test instruction to the test device;
[0046] Step S3: the test device parses the received charge and discharge test instruction to obtain the corresponding channel control subsystem command and the step setting subsystem command, and selects the test channel corresponding to the battery to execute the corresponding test step based on the channel control subsystem command and the step setting subsystem command, so as to perform charge and discharge test on the battery;
[0047] Step S4: During the test, the test device executes a pause test, a continue test, a stop test, or a new test based on the test adjustment instruction sent by the server;
[0048] Step S5: The server obtains the test data of the test device and stores and backs up the test data.
[0049] In step S1, SCPI (Standard Commands for Programmable Instruments) is a general instrument command based on an ASCII character string format, which is composed of a series of keywords in a hierarchical structure (tree structure), and there are two types of commands: common commands and subsystem commands.
[0050] Common commands are basically unrelated to specific operations and mainly control the overall functions of the test equipment, such as reset, status and synchronization. All common commands are represented by three letters marked with asterisks, such as: *RST, *IDN, etc. Subsystem commands are mainly used to perform settings or query operations. Each subsystem is composed of the same type of commands in a tree structure.
[0051] SCPI commands consist of three parts: keywords, separators, and parameters. The format is as follows:
[0052] SYSTem:DATE 2023,03,08This command is used to set the system date;
[0053] SYSTem:DATE? This command is used to query the system date;
[0054] Keywords are written in a mixture of uppercase and lowercase letters. Uppercase letters represent the abbreviation of the keyword. Both forms are supported and are not case-sensitive. Colons are used to separate keywords at different levels. Spaces are used to separate keywords and parameters. Commas are used to separate parameters. Question marks are used for query commands and can be followed by parameters.
[0055] The parsing of SCPI commands only supports ASCII character parsing and response;
[0056] Parsing starts only after receiving the end character ('\n', corresponding to the hexadecimal value 0x0A). It supports sending multiple SCPI commands in a combined manner, using semicolons to separate each command. However, the following two points should be noted:
[0057] Each time the command is parsed, the header path of the first instruction (the content before the last colon of the command is the header path) will be saved, and each subsequent command will automatically combine the previously saved header path to become a complete command, for example:
[0058] BATTery:CHARge:VOLTage 20;CURRent 2
[0059] It will eventually be parsed into the following two commands:
[0060] BATTery:CHARge:VOLTage 20
[0061] BATTery:CHARge:CURRent 20
[0062] If the header path for each command is different, you can reset the header path by adding a colon before the corresponding command, for example:
[0063] BATTery:CHARge:VOLTage 20; :BATTery:DISCharge:VOLTage 30
[0064] It will eventually be parsed into the following two instructions:
[0065] BATTery:CHARge:VOLTage 20
[0066] BATTery:DISCharge:VOLTage 30
[0067] Command parsing is not case-sensitive and supports abbreviations. If a command parsing error occurs, the parsing will be terminated immediately and an error message will be returned in the format of error code, "error message".
[0068] Examples of the channel control subsystem commands are as follows:
[0069]
[0070] Examples of the step setting subsystem commands are as follows:
[0071]
[0072]
[0073] During specific implementation, the charge and discharge test instruction may be a global protection condition command (all work steps of the current test are effective, among which the voltage upper limit, voltage lower limit, current upper limit, and temperature upper limit must be set); : work step 1 protection condition command (can be omitted, if the configuration will cover the corresponding global protection condition); : work step 1 cutoff condition command; : work step 1 parameter command; : work step 2 protection condition command (can be omitted, if the configuration will cover the corresponding global protection condition); : work step 2 cutoff condition command; : work step 2 parameter command; : ......; : channel start test command.
[0074] The step S2 is specifically as follows:
[0075] The server generates a battery charge and discharge test instruction based on the command set, and remotely sends the charge and discharge test instruction to the test device via the UDP / IP protocol and the SCPI service port. The SCPI service port can be 5025.
[0076] The step S3 is specifically as follows:
[0077] The test device receives the charge and discharge test instructions sent by the server in real time, parses the charge and discharge test instructions based on the SCPI protocol to obtain the carried channel control subsystem commands and step setting subsystem commands, selects the test channel corresponding to the battery based on the channel control subsystem command, and executes the corresponding test step based on the step setting subsystem command to perform charge and discharge tests on the battery.
[0078] In step S5, the server obtains the test data of the test device specifically as follows:
[0079] The server sends a test data reporting instruction (CHANnel:DATA:UPLOad) carrying a data receiving IP address, a data receiving port, and a data reporting period to the test device, and the test device periodically uploads the test data based on the received test data reporting instruction;
[0080] Or the server sends a channel data query command (CHANnel:DATA:QUERy?) to the test device to actively obtain the test data, and detects the operating status of the test device based on whether the test data is received within a preset time threshold, and performs an emergency stop operation when the operating status of the test device is abnormal.
[0081] The operating status of the test equipment is detected by whether the test data is received within a preset time threshold. When the operating status of the test equipment is abnormal, an emergency stop can be performed, thereby greatly improving the safety of the battery charge and discharge test. For example, an emergency stop will be performed if the test data is not received within 30 seconds.
[0082] In step S5, storing and backing up the test data is specifically as follows:
[0083] The server creates a pair of public keys and private keys based on the RSA algorithm, encrypts the public key through the 3DES algorithm to obtain a secret key, performs MAC calculation on the test data to obtain a MAC value, obtains the current timestamp, encrypts the test data, MAC value and timestamp through the private key to obtain primary encrypted data, maps the primary encrypted data through a preset mapping rule to obtain secondary encrypted data, encrypts the secondary encrypted data and the secret key through the ECDSA algorithm to obtain an encrypted test data packet, stores the encrypted test data packet to a specified path, and performs distributed backup of the encrypted test data packet.
[0084] A pair of public and private keys are created through the RSA algorithm, the public key is encrypted through the 3DES algorithm to obtain the secret key, the test is MAC calculated to obtain the MAC value, the current timestamp is obtained, the test data, MAC value and timestamp are encrypted through the private key to obtain the first-level encrypted data, the first-level encrypted data is mapped through the preset mapping rule to obtain the second-level encrypted data, the second-level encrypted data and the key are encrypted through the ECDSA algorithm to obtain an encrypted test data packet, the encrypted test data packet is stored in the specified path, and the encrypted test data packet is distributedly backed up; subsequently, the integrity check can be performed through the MAC value, and the timeliness check can be performed through the timestamp, and the data encrypted by the private key can only be decrypted by the public key. The public key is encrypted multiple times, and if the corresponding encryption algorithm or data transformation rule is not known, the encrypted test data packet cannot be cracked. At least 8 security measures (RSA algorithm, public and private keys, 3DES algorithm, MAC calculation, timestamp, mapping rule, ECDSA algorithm, distributed backup) are taken to prevent the test data from being stolen and tampered with in plain text, which greatly improves the security of test data storage.
[0085] The decryption process of the encrypted test data packet is as follows: decrypting the encrypted test data packet through the ECDSA algorithm to obtain secondary encrypted data and a key, mapping the secondary encrypted data through a preset mapping rule to obtain primary encrypted data, decrypting the key through the 3DES algorithm to obtain a public key, decrypting the primary encrypted data through the public key to obtain test data, MAC value and timestamp, performing a time validity check through the timestamp, and then performing an integrity check on the test data through the MAC value.
[0086] A preferred embodiment of a battery charge and discharge test system based on the SCPI protocol of the present invention includes the following modules:
[0087] A command set generation module, used for the server to generate a command set including channel control subsystem commands and work step setting subsystem commands based on the SCPI protocol;
[0088] A charge and discharge test instruction sending module, used for the server to generate a charge and discharge test instruction based on the command set, and remotely send the charge and discharge test instruction to the test equipment;
[0089] A charge and discharge test module, configured to test the device to parse the received charge and discharge test instruction, obtain the corresponding channel control subsystem command and the step setting subsystem command, and select the test channel corresponding to the battery to execute the corresponding test step based on the channel control subsystem command and the step setting subsystem command, so as to perform charge and discharge test on the battery;
[0090] The test adjustment module is used to test the device during the test process, based on the test adjustment instruction sent by the server, to execute the pause test, continue the test, stop the test or start a new test;
[0091] The test data management module is used for the server to obtain the test data of the test equipment and store and back up the test data.
[0092] In the command set generation module, SCPI (Standard Commands for Programmable Instruments) is a general instrument command based on an ASCII string format, consisting of a series of keywords in a hierarchical structure (tree structure), and there are two command types: common commands and subsystem commands.
[0093] Common commands are basically unrelated to specific operations and mainly control the overall functions of the test equipment, such as reset, status and synchronization. All common commands are represented by three letters marked with asterisks, such as: *RST, *IDN, etc. Subsystem commands are mainly used to perform settings or query operations. Each subsystem is composed of the same type of commands in a tree structure.
[0094] SCPI commands consist of three parts: keywords, separators, and parameters. The format is as follows:
[0095] SYSTem:DATE 2023,03,08This command is used to set the system date;
[0096] SYSTem:DATE? This command is used to query the system date;
[0097] Keywords are written in a mixture of uppercase and lowercase letters. Uppercase letters represent the abbreviation of the keyword. Both forms are supported and are not case-sensitive. Colons are used to separate keywords at different levels. Spaces are used to separate keywords and parameters. Commas are used to separate parameters. Question marks are used for query commands and can be followed by parameters.
[0098] The parsing of SCPI commands only supports ASCII character parsing and response;
[0099] Parsing starts only after receiving the end character ('\n', corresponding to the hexadecimal value 0x0A). It supports sending multiple SCPI commands in a combined manner, using semicolons to separate each command. However, the following two points should be noted:
[0100] Each time the command is parsed, the header path of the first instruction (the content before the last colon of the command is the header path) will be saved, and each subsequent command will automatically combine the previously saved header path to become a complete command, for example:
[0101] BATTery:CHARge:VOLTage 20;CURRent 2
[0102] It will eventually be parsed into the following two commands:
[0103] BATTery:CHARge:VOLTage 20
[0104] BATTery:CHARge:CURRent 20
[0105] If the header path for each command is different, you can reset the header path by adding a colon before the corresponding command, for example:
[0106] BATTery:CHARge:VOLTage 20; :BATTery:DISCharge:VOLTage 30
[0107] It will eventually be parsed into the following two instructions:
[0108] BATTery:CHARge:VOLTage 20
[0109] BATTery:DISCharge:VOLTage 30
[0110] Command parsing is not case-sensitive and supports abbreviations. If a command parsing error occurs, the parsing will be terminated immediately and an error message will be returned in the format of error code, "error message".
[0111] Examples of the channel control subsystem commands are as follows:
[0112]
[0113]
[0114] Examples of the step setting subsystem commands are as follows:
[0115]
[0116]
[0117] During specific implementation, the charge and discharge test instruction may be a global protection condition command (all work steps of the current test are effective, among which the voltage upper limit, voltage lower limit, current upper limit, and temperature upper limit must be set); : work step 1 protection condition command (can be omitted, if the configuration will cover the corresponding global protection condition); : work step 1 cutoff condition command; : work step 1 parameter command; : work step 2 protection condition command (can be omitted, if the configuration will cover the corresponding global protection condition); : work step 2 cutoff condition command; : work step 2 parameter command; : ......; : channel start test command.
[0118] The charge and discharge test instruction issuing module is specifically used for:
[0119] The server generates a battery charge and discharge test instruction based on the command set, and remotely sends the charge and discharge test instruction to the test device via the UDP / IP protocol and the SCPI service port. The SCPI service port can be 5025.
[0120] The charge and discharge test module is specifically used for:
[0121] The test device receives the charge and discharge test instructions sent by the server in real time, parses the charge and discharge test instructions based on the SCPI protocol to obtain the carried channel control subsystem commands and step setting subsystem commands, selects the test channel corresponding to the battery based on the channel control subsystem command, and executes the corresponding test step based on the step setting subsystem command to perform charge and discharge tests on the battery.
[0122] In the test data management module, the server obtains the test data of the test device specifically as follows:
[0123] The server sends a test data reporting instruction (CHANnel:DATA:UPLOad) carrying a data receiving IP address, a data receiving port, and a data reporting period to the test device, and the test device periodically uploads the test data based on the received test data reporting instruction;
[0124] Or the server sends a channel data query command (CHANnel:DATA:QUERy?) to the test device to actively obtain the test data, and detects the operating status of the test device based on whether the test data is received within a preset time threshold, and performs an emergency stop operation when the operating status of the test device is abnormal.
[0125] The operating status of the test equipment is detected by whether the test data is received within a preset time threshold. When the operating status of the test equipment is abnormal, an emergency stop can be performed, thereby greatly improving the safety of the battery charge and discharge test. For example, an emergency stop will be performed if the test data is not received within 30 seconds.
[0126] In the test data management module, the storage and backup of the test data is specifically as follows:
[0127] The server creates a pair of public keys and private keys based on the RSA algorithm, encrypts the public key through the 3DES algorithm to obtain a secret key, performs MAC calculation on the test data to obtain a MAC value, obtains the current timestamp, encrypts the test data, MAC value and timestamp through the private key to obtain primary encrypted data, maps the primary encrypted data through a preset mapping rule to obtain secondary encrypted data, encrypts the secondary encrypted data and the secret key through the ECDSA algorithm to obtain an encrypted test data packet, stores the encrypted test data packet to a specified path, and performs distributed backup of the encrypted test data packet.
[0128] A pair of public and private keys are created through the RSA algorithm, the public key is encrypted through the 3DES algorithm to obtain the secret key, the test is MAC calculated to obtain the MAC value, the current timestamp is obtained, the test data, MAC value and timestamp are encrypted through the private key to obtain the first-level encrypted data, the first-level encrypted data is mapped through the preset mapping rule to obtain the second-level encrypted data, the second-level encrypted data and the key are encrypted through the ECDSA algorithm to obtain an encrypted test data packet, the encrypted test data packet is stored in the specified path, and the encrypted test data packet is distributedly backed up; subsequently, the integrity check can be performed through the MAC value, and the timeliness check can be performed through the timestamp, and the data encrypted by the private key can only be decrypted by the public key. The public key is encrypted multiple times, and if the corresponding encryption algorithm or data transformation rule is not known, the encrypted test data packet cannot be cracked. At least 8 security measures (RSA algorithm, public and private keys, 3DES algorithm, MAC calculation, timestamp, mapping rule, ECDSA algorithm, distributed backup) are taken to prevent the test data from being stolen and tampered with in plain text, which greatly improves the security of test data storage.
[0129] The decryption process of the encrypted test data packet is as follows: decrypting the encrypted test data packet through the ECDSA algorithm to obtain secondary encrypted data and a key, mapping the secondary encrypted data through a preset mapping rule to obtain primary encrypted data, decrypting the key through the 3DES algorithm to obtain a public key, decrypting the primary encrypted data through the public key to obtain test data, MAC value and timestamp, performing a time validity check through the timestamp, and then performing an integrity check on the test data through the MAC value.
[0130] In summary, the advantages of the present invention are:
[0131] 1. Generate a command set including channel control subsystem commands and step setting subsystem commands based on the SCPI protocol through the server, generate charge and discharge test instructions based on the command set and send them remotely to the test equipment; then the test equipment parses the charge and discharge test instructions to obtain the corresponding channel control subsystem commands and step setting subsystem commands, selects the test channel corresponding to the battery to execute the corresponding test step based on the channel control subsystem commands and step setting subsystem commands, so as to perform charge and discharge test on the battery; during the test, the test equipment executes pause test, continues test, stops test or starts new test based on the test adjustment instructions sent by the server, and finally the server obtains the test data of the test equipment and stores and backs it up; that is, generate a command set based on the SCPI protocol, and then generate charge and discharge test instructions based on the command set and send them remotely to the test equipment for execution, and remotely obtain the test data of the test equipment, so as to realize remote charge and discharge test on the battery, which greatly improves the battery test efficiency.
[0132] 2. Create a pair of public and private keys through the RSA algorithm, encrypt the public key through the 3DES algorithm to obtain the secret key, perform MAC calculation on the test to obtain the MAC value, obtain the current timestamp, encrypt the test data, MAC value and timestamp through the private key to obtain the first-level encrypted data, map the first-level encrypted data through the preset mapping rule to obtain the second-level encrypted data, encrypt the second-level encrypted data and the key through the ECDSA algorithm to obtain an encrypted test data packet, store the encrypted test data packet to the specified path, and perform distributed backup of the encrypted test data packet; subsequently, the MAC value can be used for integrity verification, and the timestamp can be used for time validity verification. The data encrypted by the private key can only be decrypted by the public key. The public key is encrypted multiple times. If the corresponding encryption algorithm or data transformation rule is not known, the encrypted test data packet cannot be cracked. At least 8 security measures (RSA algorithm, public and private keys, 3DES algorithm, MAC calculation, timestamp, mapping rule, ECDSA algorithm, distributed backup) are taken to prevent the test data from being stolen and tampered with in plain text, which greatly improves the security of test data storage.
[0133] 3. The operating status of the test equipment is detected by whether the test data is received within the preset time threshold. When the operating status of the test equipment is abnormal, an emergency stop can be performed, which greatly improves the safety of battery charging and discharging tests.
[0134] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A battery charge and discharge test method based on SCPI protocol, characterized in that: The steps include: Step S1, the server generates a command set including a channel control subsystem command and a work step setting subsystem command based on the SCPI protocol; Step S2: the server generates a charge-discharge test instruction based on the command set, and remotely sends the charge-discharge test instruction to the test device; Step S3: the test device parses the received charge and discharge test instruction to obtain the corresponding channel control subsystem command and the step setting subsystem command, and selects the test channel corresponding to the battery to execute the corresponding test step based on the channel control subsystem command and the step setting subsystem command, so as to perform charge and discharge test on the battery; Step S4: During the test, the test device executes a pause test, a continue test, a stop test, or a new test based on the test adjustment instruction sent by the server; Step S5: The server obtains the test data of the test device and stores and backs up the test data.
2. A battery charge and discharge test method based on SCPI protocol as claimed in claim 1, characterized in that: The step S2 is specifically as follows: The server generates a charge and discharge test instruction of the battery based on the command set, and remotely sends the charge and discharge test instruction to the test device through the UDP / IP protocol and the SCPI service port.
3. A battery charge and discharge test method based on SCPI protocol as claimed in claim 1, characterized in that: The step S3 is specifically as follows: The test device receives the charge and discharge test instructions sent by the server in real time, parses the charge and discharge test instructions based on the SCPI protocol to obtain the carried channel control subsystem commands and step setting subsystem commands, selects the test channel corresponding to the battery based on the channel control subsystem command, and executes the corresponding test step based on the step setting subsystem command to perform charge and discharge tests on the battery.
4. A battery charge and discharge test method based on SCPI protocol as claimed in claim 1, characterized in that: In step S5, the server obtains the test data of the test device specifically as follows: The server sends a test data reporting instruction carrying a data receiving IP address, a data receiving port, and a data reporting period to the test device, and the test device periodically uploads the test data based on the received test data reporting instruction; Alternatively, the server sends a channel data query instruction to the test device to actively obtain the test data, and detects the operating status of the test device based on whether the test data is received within a preset time threshold.
5. A battery charge and discharge test method based on SCPI protocol as claimed in claim 1, characterized in that: In step S5, storing and backing up the test data is specifically as follows: The server creates a pair of public keys and private keys based on the RSA algorithm, encrypts the public key through the 3DES algorithm to obtain a secret key, performs MAC calculation on the test data to obtain a MAC value, obtains the current timestamp, encrypts the test data, MAC value and timestamp through the private key to obtain primary encrypted data, maps the primary encrypted data through a preset mapping rule to obtain secondary encrypted data, encrypts the secondary encrypted data and the secret key through the ECDSA algorithm to obtain an encrypted test data packet, stores the encrypted test data packet to a specified path, and performs distributed backup of the encrypted test data packet.
6. A battery charge and discharge test system based on SCPI protocol, characterized in that: Includes the following modules: A command set generation module, used for the server to generate a command set including channel control subsystem commands and work step setting subsystem commands based on the SCPI protocol; A charge and discharge test instruction sending module, used for the server to generate a charge and discharge test instruction based on the command set, and remotely send the charge and discharge test instruction to the test equipment; A charge and discharge test module, configured to test the device to parse the received charge and discharge test instruction, obtain the corresponding channel control subsystem command and the step setting subsystem command, and select the test channel corresponding to the battery to execute the corresponding test step based on the channel control subsystem command and the step setting subsystem command, so as to perform charge and discharge test on the battery; The test adjustment module is used to test the device during the test process, based on the test adjustment instruction sent by the server, to execute the pause test, continue the test, stop the test or start a new test; The test data management module is used for the server to obtain the test data of the test equipment and store and back up the test data.
7. A battery charge and discharge test system based on SCPI protocol as claimed in claim 6, characterized in that: The charge and discharge test instruction issuing module is specifically used for: The server generates a charge and discharge test instruction of the battery based on the command set, and remotely sends the charge and discharge test instruction to the test device through the UDP / IP protocol and the SCPI service port.
8. A battery charge and discharge test system based on SCPI protocol as claimed in claim 6, characterized in that: The charge and discharge test module is specifically used for: The test device receives the charge and discharge test instructions sent by the server in real time, parses the charge and discharge test instructions based on the SCPI protocol to obtain the carried channel control subsystem commands and step setting subsystem commands, selects the test channel corresponding to the battery based on the channel control subsystem command, and executes the corresponding test step based on the step setting subsystem command to perform charge and discharge tests on the battery.
9. A battery charge and discharge test system based on SCPI protocol as claimed in claim 6, characterized in that: In the test data management module, the server obtains the test data of the test device specifically as follows: The server sends a test data reporting instruction carrying a data receiving IP address, a data receiving port, and a data reporting period to the test device, and the test device periodically uploads the test data based on the received test data reporting instruction; Alternatively, the server sends a channel data query instruction to the test device to actively obtain the test data, and detects the operating status of the test device based on whether the test data is received within a preset time threshold.
10. A battery charge and discharge test system based on SCPI protocol as claimed in claim 6, characterized in that: In the test data management module, the storage and backup of the test data is specifically as follows: The server creates a pair of public keys and private keys based on the RSA algorithm, encrypts the public key through the 3DES algorithm to obtain a secret key, performs MAC calculation on the test data to obtain a MAC value, obtains the current timestamp, encrypts the test data, MAC value and timestamp through the private key to obtain primary encrypted data, maps the primary encrypted data through a preset mapping rule to obtain secondary encrypted data, encrypts the secondary encrypted data and the secret key through the ECDSA algorithm to obtain an encrypted test data packet, stores the encrypted test data packet to a specified path, and performs distributed backup of the encrypted test data packet.