Signal matrix generation method, apparatus, device and storage medium
By generating random numbers based on timestamps and location information, and dynamically generating a signal matrix using the AES encryption algorithm, the problem of easy leakage of vehicle signal matrices is solved, thereby improving the security and privacy of the signal matrix.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, vehicle signal matrices are fixed and easily leaked, leading to high risks of commercial secret data security issues and leakage of commercial secrets.
By generating random numbers based on timestamps and vehicle location information, combined with the AES encryption algorithm and key, a signal matrix is dynamically generated, and the signal identifiers are encrypted to ensure the randomness and unpredictability of the signal matrix.
Even if a single signal identifier is leaked, it is impossible to infer other signal identifiers, thus improving data security and privacy and preventing data leakage and unauthorized access.
Smart Images

Figure CN116707794B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and in particular to a signal matrix generation method, apparatus, device, and storage medium. Background Technology
[0002] In related technologies, many brands of vehicles use fixed signal matrices, and multiple models use the same signal matrices. The IDs of the signal matrices are relatively regular combinations of numbers and letters, such as simple three-digit IDs: A1A, A2A. If an employee leaks the complete signal matrix or just a single signal, it can easily lead to the leakage of the entire vehicle factory's signal matrix.
[0003] However, the signal matrix is the most confidential business information of the vehicle manufacturer. Once leaked, if the vehicle matrix is fixed, it means that this data will continue to circulate in the market in plain text, and there is no way to remedy this, which may lead to data security issues and business secret leakage issues. Summary of the Invention
[0004] To address the above issues, embodiments of this application provide a signal matrix generation method, apparatus, device, and storage medium.
[0005] The technical solution provided in this application is as follows:
[0006] This application first provides a signal matrix generation method, the method comprising:
[0007] A random number is generated based on a timestamp and the vehicle's location information. Based on the random number and the vehicle's original signal matrix, a first signal matrix is generated. The first signal matrix contains multiple signal identifiers, each of which corresponds to a signal of the vehicle. Each signal identifier in the first signal matrix is encrypted using the Advanced Encryption Standard (AES) algorithm and a first key to obtain a second signal matrix.
[0008] This application embodiment also provides a signal matrix generation apparatus, the apparatus comprising:
[0009] A first acquisition module is used to acquire a generated random number, which is generated based on a timestamp and the vehicle's location information; a first generation module is used to generate a first signal matrix based on the random number and the vehicle's original signal matrix, the first signal matrix containing multiple signal identifiers, each of which corresponds to a signal of the vehicle; an encryption module is used to encrypt each of the signal identifiers in the first signal matrix using the Advanced Encryption Standard (AES) algorithm and a first key to obtain a second signal matrix.
[0010] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the steps in the signal matrix generation method described in this application.
[0011] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the signal matrix generation method described in this application.
[0012] In this embodiment, a random dynamic signal matrix is generated based on time and location information. In this way, even if the signal identifier of a single signal is leaked, it is impossible to deduce the signal identifiers of other signals. The generation of the signal identifier requires the use of a specific encryption algorithm, which can ensure the randomness and unpredictability of the ID. The dynamic signal matrix based on encryption and decryption algorithms can improve the security and privacy of data and effectively prevent data leakage and illegal acquisition. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating a signal matrix generation method according to an embodiment of this application;
[0014] Figure 2 This is a flowchart illustrating another signal matrix generation method according to an embodiment of this application;
[0015] Figure 3 This is a flowchart illustrating another signal matrix generation method according to an embodiment of this application;
[0016] Figure 4 This is a flowchart illustrating another signal matrix generation method according to an embodiment of this application;
[0017] Figure 5 A flowchart illustrating a signal matrix generation method is also provided as an embodiment of this application.
[0018] Figure 6 A flowchart illustrating a signal matrix generation method is also provided as an embodiment of this application.
[0019] Figure 7 This is a schematic diagram of the composition structure of a signal matrix generation device according to an embodiment of this application;
[0020] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0021] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0022] Figure 1This is a flowchart illustrating a signal matrix generation method according to an embodiment of this application, as shown below. Figure 1 As shown, the method includes the following steps:
[0023] Step 102: Obtain the generated random number, which is generated based on the timestamp and the vehicle's location information;
[0024] Step 104: Based on the random number and the original signal matrix of the vehicle, generate a first signal matrix. The first signal matrix contains multiple signal identifiers, and each signal identifier corresponds to a signal of the vehicle.
[0025] Since the random number is generated based on the timestamp and the vehicle's location information, and the first signal matrix is generated based on the random number and the vehicle's original signal matrix, the first signal matrix is a dynamic signal matrix. The element values (i.e., signal identifiers) in the first signal matrix will change at different times or locations. Thus, even if the previously generated random number is known, the next generated random number cannot be predicted. The signals may include turn signals, hazard warning signals, braking signals, reversing signals, window opening signals, and window closing signals, etc. The signal identifiers can be used to distinguish different signals, and each signal can correspond to a function of the vehicle. The signal identifiers may be A1A, A2A, etc.
[0026] Step 106: Using the Advanced Encryption Standard (AES) algorithm and the first key, encrypt each signal identifier in the first signal matrix to obtain the second signal matrix.
[0027] Among them, AES (Advanced Encryption Standard) is a symmetric encryption algorithm that can encrypt data with high strength while ensuring the correctness of decryption. The AES algorithm can support three key lengths: 128 bits, 192 bits, and 256 bits, that is, the AES algorithm can include AES128, AES192, and AES256 algorithms. The data in the first signal matrix can be encoded first, and then the encoded data can be encrypted using the AES algorithm and the first key to protect the security of the data.
[0028] In this embodiment, a random dynamic signal matrix is generated based on time and location information. In this way, even if the signal identifier of a single signal is leaked, it is impossible to deduce the signal identifiers of other signals. The generation of the signal identifier requires the use of a specific encryption algorithm, which can ensure the randomness and unpredictability of the ID. The dynamic signal matrix based on encryption and decryption algorithms can improve the security and privacy of data and effectively prevent data leakage and illegal acquisition.
[0029] In some embodiments, such as Figure 2As shown, prior to step 102, the method further includes:
[0030] Step 1011: Obtain the timestamp and the vehicle's location information;
[0031] This includes obtaining the current Unix timestamp and the vehicle's current geographical location information, which can be represented by latitude and longitude and obtained through sensor data inside the vehicle. The following Python statement can be used to obtain the Unix timestamp and the vehicle's latitude and longitude information:
[0032] _time = lambda:int(round(time.time()*1000)) / / Get Unix timestamp
[0033] _position = Longitude * 1000 + latitude * 1000 / / Get latitude and longitude
[0034] Step 1012: Concatenate the timestamp and the location information to obtain a random number seed;
[0035] This can be achieved by concatenating latitude and longitude values with a timestamp as a random number seed. The combination of timestamp and location information ensures randomness. The random number seed can be generated using the following Python statement:
[0036] seed = (_time + _position) / 100 / / Generate random number seed
[0037] Step 1013: Generate the random number based on the random number seed.
[0038] Random numbers can be generated using the following Python statement:
[0039] import random
[0040] random.seed(_seed)
[0041] singnal = random.random()
[0042] In this embodiment, a random number seed is generated based on time and location information, and then a random dynamic signal matrix is generated based on the random number seed. In this way, even if the signal identifier of a single signal is leaked, it is impossible to deduce the signal identifiers of other signals. The generation of the signal identifier requires the use of a specific encryption algorithm, which can ensure the randomness and unpredictability of the ID. The dynamic signal matrix based on the encryption and decryption algorithm can improve the security and privacy of data and effectively prevent data leakage and illegal acquisition.
[0043] In some embodiments, the first key is a pre-set static key or a dynamically generated dynamic key; the first key is pre-loaded into the controller of each of the signals.
[0044] The first key can be a static key agreed upon in advance by the two parties who need to communicate securely, or it can be a dynamically generated key. The first key can be determined according to the actual performance of the product.
[0045] The encryption and decryption keys can be pre-loaded into the controllers of each transceiver signal and stored using an HSM (Hardware Security Module) chip.
[0046] The first key can be represented as: key = '1234567890123456'#.
[0047] In this embodiment of the application, the first key can be either a pre-set static key or a dynamically generated key. By pre-loading the first key into the controller of each of the signals, it can be accessed at any time, thus achieving more efficient access to the first key.
[0048] In some embodiments, such as Figure 3 As shown, after step 104, the method further includes:
[0049] Step 105a: Convert each of the signal identifiers in the first signal matrix into hexadecimal to obtain the third signal matrix;
[0050] Each element (i.e., each signal identifier) in the first signal matrix to be encrypted can be converted from a decimal number to a hexadecimal number and stored in a new matrix (i.e., the third signal matrix).
[0051] Correspondingly, step 106, "encrypting each signal identifier in the first signal matrix to obtain the second signal matrix," includes:
[0052] Step 1061a: Encrypt each of the signal identifiers in the third signal matrix to obtain the second signal matrix.
[0053] Each of the signal identifiers in the third signal matrix can be encrypted using the AES algorithm (e.g., AES128).
[0054] In this embodiment of the application, the signal identifier is converted into a shorter hexadecimal form, which makes the processing of the signal identifier easier.
[0055] In some embodiments, such as Figure 4 As shown, after step 104, the method further includes:
[0056] Step 105b: Convert each signal identifier in the first signal matrix into binary to obtain the fourth signal matrix;
[0057] In addition, each element (i.e. each signal identifier) in the first signal matrix to be encrypted can be converted from a decimal number to a binary number and stored in a new matrix (i.e., the fourth signal matrix).
[0058] In one embodiment, the A1A signal identifier can be binary encoded. In Python, the 'bytes' function can be used to perform binary encoding: data = b'A1A'.
[0059] Correspondingly, step 106, "encrypting each signal identifier in the first signal matrix to obtain the second signal matrix," includes:
[0060] Step 1061b: Encrypt each of the signal identifiers in the fourth signal matrix to obtain the second signal matrix.
[0061] Each binary-encoded signal identifier in the fourth signal matrix can be encrypted using the AES algorithm (e.g., AES128). It should be noted that padding is required during encryption. In Python, AES encryption can be implemented using the AES128 algorithm from the 'pycryptodome' library using the following statement:
[0062] from Crypto.Cipher import AES
[0063] from Crypto.Util.Padding import pad,unpad
[0064] cipher=AES.new(key.encode('utf-8'),AES.MODE_CBC)
[0065] encrypted_data=cipher.encrypt(pad(data,AES.block_size))
[0066] The encrypted_data stores the encrypted binary data, which also includes an initial vector that needs to be stored and transmitted together with the encrypted data.
[0067] In this embodiment of the application, converting the signal identifier into simple binary makes it easier to process the signal identifier.
[0068] In some embodiments, such as Figure 5 As shown, the method further includes:
[0069] Step 107: Encode each signal identifier in the second signal matrix using Base64 to obtain the fifth signal matrix;
[0070] Step 108: Store and transmit the fifth signal matrix.
[0071] Base64 encoding is a method of representing binary data using 64 printable characters. In Python, the following statement can be used to Base64 encode encrypted data:
[0072] import base64
[0073] encrypted_data_b64=base64.b64encode(encrypted_data).decode('utf-8')
[0074] encrypted_data_b64 stores encrypted and Base64 encoded data, which can be used for storage and transmission.
[0075] In this embodiment of the application, Base64 encoding of the signal identifier facilitates the storage and transmission of the signal identifier.
[0076] In some embodiments, such as Figure 6 As shown, the method further includes:
[0077] Step 109: Using the AES algorithm and the first key, decrypt each signal identifier in the second signal matrix to obtain the first signal matrix.
[0078] Since AES is a symmetric encryption algorithm, the same first key is used for both encryption and decryption. In Python, the AES decryption method from the 'pycryptodome' library can be used to complete the decryption operation using the following statement:
[0079] cipher=AES.new(key.encode('utf-8'),AES.MODE_CBC)
[0080] decrypted_data=unpad(cipher.decrypt(base64.b64decode(encrypted_data_b64)),AES.block_size)
[0081] print(decrypted_data.decode('utf-8'))
[0082] The decrypted element values can be converted from hexadecimal back to decimal to obtain the first signal matrix.
[0083] In this embodiment of the application, the AES algorithm and the first key can be used to efficiently and conveniently decrypt the signal matrix.
[0084] The dynamic signal matrix generation method based on the AES algorithm provided in this application can ensure timely emergency response in the event of a signal matrix leak, preventing losses to the enterprise due to the leak. The encryption and decryption algorithm can effectively guarantee the confidentiality of the data, while the integrity and availability of the data can also be guaranteed to a certain extent. The security of the signal matrix is protected by a double layer of random dynamic matrix and matrix encryption.
[0085] It should be noted that, in the embodiments of this application, if the above-described signal matrix generation method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a mobile phone, tablet computer, desktop computer, personal digital assistant, navigator, digital phone, video phone, television, sensing device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0086] Figure 7 This is a schematic diagram of the composition structure of a signal matrix generation device according to an embodiment of this application, as shown below. Figure 7 As shown, the device 700 includes: a first acquisition module 701, a first generation module 702, and an encryption module 703, wherein:
[0087] The first acquisition module 701 is used to acquire a generated random number, which is generated based on a timestamp and the vehicle's location information.
[0088] The first generation module 702 is used to generate a first signal matrix based on the random number and the original signal matrix of the vehicle. The first signal matrix contains a plurality of signal identifiers, and each signal identifier corresponds to a signal of the vehicle.
[0089] The encryption module 703 is used to encrypt each of the signal identifiers in the first signal matrix using the Advanced Encryption Standard (AES) algorithm and the first key to obtain the second signal matrix.
[0090] In some embodiments, the apparatus further includes:
[0091] The second acquisition module is used to acquire the timestamp and the vehicle's location information;
[0092] The splicing module is used to splice the timestamp and the location information to obtain a random number seed;
[0093] The second generation module is used to generate the random number based on the random number seed.
[0094] In some embodiments, the first key is a pre-set static key or a dynamically generated dynamic key; the first key is pre-loaded into the controller of each of the signals.
[0095] In some embodiments, the apparatus further includes: a first conversion module, configured to convert each of the signal identifiers in the first signal matrix into hexadecimal to obtain a third signal matrix; and an encryption module 703, configured to encrypt each of the signal identifiers in the third signal matrix using the Advanced Encryption Standard (AES) algorithm and a first key to obtain a second signal matrix.
[0096] In some embodiments, the apparatus further includes: a second conversion module, configured to convert each of the signal identifiers in the first signal matrix into binary to obtain a fourth signal matrix; and an encryption module 703, configured to encrypt each of the signal identifiers in the fourth signal matrix using the Advanced Encryption Standard (AES) algorithm and a first key to obtain a second signal matrix.
[0097] In some embodiments, the apparatus further includes: an encoding module for Base 64 encoding each signal identifier in the second signal matrix to obtain a fifth signal matrix; and a transmission module for storing and transmitting the fifth signal matrix.
[0098] In some embodiments, the apparatus further includes a decryption module, configured to decrypt each signal identifier in the second signal matrix using the AES algorithm and the first key to obtain the first signal matrix.
[0099] The description of the above device embodiments is similar to that of the above method embodiments, and has similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0100] Based on the foregoing embodiments, this application also provides an electronic device. Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application, such as... Figure 8 As shown, the hardware entity of the device 800 includes a memory 801 and a processor 802. The memory 801 stores a computer program that can run on the processor 802. When the processor 802 executes the program, it implements the steps in the signal matrix generation method in the above embodiments.
[0101] The memory 801 is configured to store instructions and applications executable by the processor 802, and can also cache data to be processed or already processed by the processor 802 and the various modules in the device 800 (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).
[0102] Based on the foregoing embodiments, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor of an electronic device, can implement the signal matrix generation method provided in any of the preceding embodiments.
[0103] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0104] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict.
[0105] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0106] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0107] It should be noted that the aforementioned computer-readable storage media can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various electronic devices that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0108] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0109] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware nodes. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0111] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0112] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0113] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0114] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for generating a signal matrix, characterized in that, The method includes: Obtain a generated random number, which is generated based on a timestamp and the vehicle's location information; Based on the random number and the vehicle's original signal matrix, a first signal matrix is generated. The first signal matrix contains multiple signal identifiers, and each signal identifier corresponds to a signal of the vehicle. Using the Advanced Encryption Standard (AES) algorithm and a first key, each of the signal identifiers in the first signal matrix is encrypted to obtain a second signal matrix. The method further includes: Obtain the timestamp and the vehicle's location information; The timestamp and the location information are concatenated to obtain a random number seed; The random number is generated based on the random number seed.
2. The method according to claim 1, characterized in that, The first key is either a pre-set static key or a dynamically generated key; The first key is pre-loaded into the controller of each of the signals.
3. The method according to claim 1, characterized in that, The method further includes: Convert each signal identifier in the first signal matrix to hexadecimal to obtain the third signal matrix; The step of encrypting each signal identifier in the first signal matrix to obtain the second signal matrix includes: Each signal identifier in the third signal matrix is encrypted to obtain the second signal matrix.
4. The method according to claim 1, further comprising: Each signal identifier in the first signal matrix is converted into binary to obtain the fourth signal matrix; The step of encrypting each signal identifier in the first signal matrix to obtain the second signal matrix includes: Each signal identifier in the fourth signal matrix is encrypted to obtain the second signal matrix.
5. The method according to claim 1, characterized in that, The method further includes: Each signal identifier in the second signal matrix is Base 64 encoded to obtain the fifth signal matrix; The fifth signal matrix is stored and transmitted.
6. The method according to claim 1, characterized in that, The method further includes: Using the AES algorithm and the first key, each signal identifier in the second signal matrix is decrypted to obtain the first signal matrix.
7. A signal matrix generation device, characterized in that, The device includes: The first acquisition module is used to acquire a generated random number, which is generated based on a timestamp and the vehicle's location information; The first generation module is used to generate a first signal matrix based on the random number and the original signal matrix of the vehicle. The first signal matrix contains multiple signal identifiers, and each signal identifier corresponds to a signal of the vehicle. An encryption module is used to encrypt each signal identifier in the first signal matrix using the Advanced Encryption Standard (AES) algorithm and a first key to obtain a second signal matrix. The second acquisition module is used to acquire the timestamp and the location information of the vehicle; The splicing module is used to splice the timestamp and the location information to obtain a random number seed; The second generation module is used to generate the random number based on the random number seed.
8. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the signal matrix generation method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps in the signal matrix generation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Automobile bus based message encryption method, vehicle controller and vehicle
CN108011708A
Vehicle communication protocol changing method, server and readable storage medium
CN113472759A