A diagnostic data security protection method and system based on an asymmetric encryption algorithm
By storing the private key of the asymmetric encryption algorithm on a cloud server and using the public key in the vehicle controller for data encryption and signing, the problem of data tampering and illegal writing in the UDS diagnostic interface is solved, and the secure writing and integrity verification of diagnostic data are achieved.
Patent Information
- Application Number
- CN202511254570.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-09-04
AI Technical Summary
In existing technologies, writing data through the UDS diagnostic interface carries the risk of unauthorized data tampering and unauthorized user writing, and the security of using symmetric encryption algorithms is insufficient.
An asymmetric encryption algorithm is used, with the private key stored on a cloud server and the public key in the vehicle controller. The diagnostic instrument encrypts and digitally signs the diagnostic data through the cloud server, and the vehicle controller decrypts and verifies the data to ensure its security and integrity.
By combining asymmetric encryption algorithms and SHA256 algorithms, secure writing of diagnostic data is achieved, maximizing data security and integrity, and adapting to complex terminal scenarios involving multi-role interaction and multi-scenario switching.
Smart Images

Figure CN120768676B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of diagnosing vehicle controllers safely, in particular to a diagnosis data security protection method and system based on an asymmetric encryption algorithm. BACKGROUND
[0002] In recent years, the intelligent and networked development of automobiles has accelerated, and in order to quickly adapt to user and scene needs, the situation of changing vehicle configurations and vehicle parameters through a UDS diagnosis interface (Unified Diagnostic Services, UDS) is becoming more and more common. However, writing data through the UDS diagnosis interface faces the situation of data being illegally tampered with or written by illegal users, and in order to ensure the authenticity and integrity of the data, the source of the data needs to be checked, and the integrity of the data also needs to be checked.
[0003] The relatively simple offline checking method (diagnostic instrument-vehicle-cloud) commonly used in the current industry uses a symmetric encryption algorithm, and once the symmetric encryption Key used by the diagnostic instrument is obtained, the vehicle will face the risk of illegal writing. SUMMARY
[0004] In order to solve the above diagnosis data security protection problem, the present application stores the private key of the asymmetric encryption algorithm in a cloud server with a high security level, and each time diagnosis data is written to the vehicle, the diagnostic instrument sends the diagnosis data to the cloud server for encryption and digital signature calculation, then returns the data to the diagnostic instrument, sends the data to the vehicle through the diagnostic instrument, and writes the data to the vehicle after decryption and verification at the vehicle end, thereby ensuring the security, authenticity and integrity of the data writing.
[0005] The present application provides a diagnosis data security protection system based on an asymmetric encryption algorithm, comprising a vehicle end controller, a remote server and a diagnostic instrument; wherein the vehicle end controller is provided with a unique identity code;
[0006] The cloud server stores the identity code of the vehicle end controller and the associated information of the vehicle end controller; based on the identity code and the associated information of the vehicle end controller, a pair of public key and private key based on the asymmetric encryption algorithm is generated for each vehicle end controller; the private key is stored in the cloud server, and the public key is integrated in the vehicle end controller;
[0007] The diagnostic instrument is used to read the identity code and state information of the vehicle end controller from the vehicle end controller, and generate diagnosis data for the vehicle end controller according to the state information; when writing diagnosis data to the vehicle end controller, the identity code, state information and diagnosis data of the vehicle end controller are sent to the cloud server;
[0008] The cloud server verifies the identification code and state information of the vehicle-side controller, and screens the diagnostic data according to the state information; the vehicle-side controller uses a private key to calculate the Hash value of the diagnostic data by using the SHA256 algorithm, calculates the digital signature of the encrypted data by using an asymmetric encryption algorithm, and sends the encrypted data, the Hash value, the digital signature, the identification code of the controller, a time stamp and the like to the diagnostic instrument together;
[0009] The diagnostic instrument sends the encrypted data, the Hash value, the digital signature, the identification code of the controller and the time stamp to the vehicle-side controller;
[0010] The vehicle-side controller uses a preset public key to decrypt the encrypted data, verifies the identity and the digital signature, and writes the data again after the result is qualified.
[0011] The application further provides another diagnostic data security protection method based on an asymmetric encryption algorithm, and the technical scheme adopted to solve the above technical problems is:
[0012] Each vehicle-side controller (Engine Control Unit, abbreviated as ECU) is provided with a unique identification code Identification;
[0013] The cloud server stores the identification code of each vehicle-side controller, and the associated information of each vehicle-side controller;
[0014] The cloud server generates a pair of public key and private key based on an asymmetric encryption algorithm for each ECU based on the identification code and the associated information of the vehicle-side controller;
[0015] The private key is stored in the cloud server, and the public key is integrated in the vehicle-side controller;
[0016] The diagnostic instrument is used to read the identification code and state information of the vehicle-side controller from the vehicle-side controller, and generate diagnostic data for the vehicle-side controller according to the state information;
[0017] When the diagnostic instrument writes the diagnostic data to the vehicle-side controller, the identification code, the state information and the diagnostic data of the vehicle-side controller are sent to the cloud server,
[0018] The cloud server verifies the identification code and state information of the vehicle-side controller, and screens the diagnostic data according to the state information;
[0019] The cloud server encrypts the diagnostic data by using the private key of the vehicle-side controller to generate encrypted data:
[0020] The cloud server calculates the Hash value of the diagnostic data by using the private key of the vehicle-side controller and the SHA256 algorithm, calculates the digital signature of the encrypted data by using the asymmetric encryption algorithm, and sends the encrypted data, the Hash value, the digital signature, the Identification of the controller, the time stamp, etc. to the diagnostic instrument;
[0021] The diagnostic instrument sends the encrypted data, the Hash value, the digital signature, the Identification of the controller, the time stamp, etc. to the vehicle-side controller;
[0022] The vehicle-side controller decrypts the encrypted data, verifies the identity, and verifies the digital signature by using the preset public key, and writes the data again after the result is qualified.
[0023] Preferably, the association information includes diagnostic address, controller name, supplier, model, etc.
[0024] Preferably, the state information includes battery power, accident mode, first activation, etc.
[0025] Preferably, the asymmetric encryption algorithm is the ECDSA algorithm, the public-private key pair is generated by using the ECDSA elliptic curve algorithm, and the ECDSA elliptic curve algorithm is used for encryption and digital signature algorithm; the SHA256 algorithm is used as the Hash value algorithm.
[0026] Preferably, when the diagnostic instrument writes diagnostic data to the vehicle-side controller, the state information sent by the diagnostic instrument to the cloud server includes the role type, and the cloud server stores the role permission matrix;
[0027] The cloud server finds the corresponding role permission from the role permission matrix according to the role type, and filters the diagnostic data according to the role permission;
[0028] The cloud server encrypts the diagnostic data filtered by the role permission by using the private key of the vehicle-side controller to generate encrypted data.
[0029] More preferably, the cloud server feeds back the role permission prompt information to the diagnostic instrument for the diagnostic data that does not pass the role permission filtering.
[0030] Preferably, the cloud server stores a dynamic scene set, and each dynamic scene in the dynamic scene set is provided with corresponding scene operation permission;
[0031] The cloud server filters the diagnostic data according to the scene operation permission;
[0032] When the cloud server determines that the state information belongs to the dynamic scene set, the cloud server selects the scene operation permission corresponding to the dynamic scene, and encrypts the diagnostic data filtered by the scene operation permission by using the private key of the vehicle-side controller to generate encrypted data.
[0033] More preferably, when the cloud server determines that the state information belongs to the dynamic scene set, the cloud server feeds back scene operation permission prompt information to the diagnostic instrument.
[0034] Preferably, the cloud server stores a risk policy set, and each risk factor in the risk policy set is provided with a corresponding permission adjustment method.
[0035] When the cloud server determines that the state information belongs to a risk factor of the dynamic scene set, the cloud server selects the operation permission adjustment method corresponding to the risk factor, and encrypts the diagnostic data filtered by the operation permission by using the private key of the vehicle-side controller to generate encrypted data.
[0036] More preferably, when the cloud server determines that the state information belongs to a risk factor of the risk factor set, the cloud server feeds back scene operation permission prompt information to the diagnostic instrument.
[0037] The improvement points of the present application are:
[0038] (1) A pair of public key and private key based on asymmetric encryption algorithm is generated for each ECU, the public key is stored in the vehicle-side controller, and the method of using the private key for encryption + signature + identity recognition in the cloud server is used to maximize the security of the diagnostic data.
[0039] (2) The asymmetric encryption algorithm (ECDSA) and 256-bit encryption hash algorithm (SHA256) encryption and signature method are used, and a complete implementation process is proposed.
[0040] (3) Combined with dynamic permission, different permission controls are adopted for different users or states of the vehicle-side controller, further improving the security.
[0041] The beneficial effects of the present application are:
[0042] 1. The asymmetric encryption is used to encrypt and digitally sign the diagnostic flashing data, and the encryption key is stored in the background, which maximizes the security of the encryption and signature process, and provides an effective and regulatory-compliant method for the security protection of the diagnostic data.
[0043] 2. Through the three-layer mechanism of "baseline permission boundary, dynamic adjustment and adaptation to the scene, and risk linkage and risk control", the contradiction of "either too loose and easy to be abused, or too strict and affecting efficiency" of the traditional static permission is solved, and the goal of "accurate blocking of illegal writing and efficient passing of legal operation" is achieved, which is especially suitable for the complex terminal scene of vehicles such as "multi-role interaction, multi-scene switching, and high safety demand". BRIEF DESCRIPTION OF DRAWINGS
[0044] For a better understanding of the above and other objects, features, advantages and functions of the present application, reference should be made to the embodiments illustrated in the drawings. The same reference numerals in the drawings refer to the same components. Those skilled in the art should understand that the drawings are intended to illustrate the preferred embodiments of the present application, and have no limiting effect on the scope of the present application, and the various components in the drawings are not drawn to scale.
[0045] Figure 1 A schematic diagram of a diagnostic data security protection system based on an asymmetric encryption algorithm is shown.
[0046] Figure 2 A flowchart of a diagnostic data security protection method based on an asymmetric encryption algorithm is shown.
[0047] Figure 3 Another flowchart of a diagnostic data security protection method based on an asymmetric encryption algorithm is shown.
[0048] Figure 4 The cloud server pre-stores a role permission matrix. DETAILED DESCRIPTION
[0049] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding, and should be considered as merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0050] The term "comprising" and its variations as used herein mean "including but not limited to". Unless specifically stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "one example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", and the like can refer to different or the same objects. Other explicit and implicit definitions can also be included below.
[0051] To at least partially address one or more of the above-mentioned problems and other potential problems, embodiments of the present disclosure propose a diagnostic data security protection method based on an asymmetric encryption algorithm.
[0052] Example one
[0053] As Figure 1 shown in the schematic diagram of a diagnostic data security protection system based on an asymmetric encryption algorithm of the present application, comprising a vehicle-side controller, a remote server, and a diagnostic instrument.
[0054] The technical solution of the diagnostic data security protection method based on an asymmetric encryption algorithm applied to the system is:
[0055] Each vehicle-side controller (Engine Control Unit, abbreviated as ECU) is provided with a unique identification code Identification, and the identification code of the vehicle-side controller is composed of 3 Bytes, such as (0x01 0x01 0x08);
[0056] The cloud server stores the identification code of each vehicle-side controller, and the associated information of each vehicle-side controller.
[0057] The cloud server generates a pair of public key and private key based on an asymmetric encryption algorithm (for example: ECDSA algorithm) for each ECU based on the identification code and associated information of the vehicle-side controller; diagnostic address, controller name, supplier, model, etc. Information can be used as associated information.
[0058] The private key is stored in the cloud server, and the public key is integrated in the vehicle-side controller.
[0059] The diagnostic instrument is used to read the identification code and state information of the vehicle-side controller from the vehicle-side controller, and to generate diagnostic data for the vehicle-side controller according to the state information.
[0060] As Figure 2 shown, based on the preset information of the above-mentioned vehicle-side controller and cloud server, after connecting the diagnostic instrument with the vehicle-side controller, the flow of the diagnostic data security protection method based on an asymmetric encryption algorithm of the present application is:
[0061] When the diagnostic instrument writes diagnostic data to the vehicle-side controller, the identification code, state information, and diagnostic data of the vehicle-side controller are sent to the cloud server,
[0062] The cloud server verifies the identification code and state information of the vehicle-side controller, and filters the diagnostic data according to the state information; battery capacity, accident mode, first activation, etc. Information can be used as state information.
[0063] The cloud server encrypts the diagnostic data by using the private key of the vehicle-side controller, and generates encrypted data:
[0064] The cloud server calculates the Hash value of the diagnostic data by using the 256-bit encryption Hash algorithm (SHA256) through the private key of the vehicle-side controller, calculates the digital signature of the encrypted data by using an asymmetric encryption algorithm such as the ECDSA algorithm, and sends the encrypted data, the Hash value, the digital signature, the Identification of the controller, the time stamp, etc. to the diagnostic instrument.
[0065] The diagnostic instrument sends the encrypted data, the Hash value, the digital signature, the Identification of the controller, the time stamp, etc. to the vehicle-side controller.
[0066] The vehicle-side controller decrypts the encrypted data, verifies the identity, and verifies the digital signature by using the preset public key, and writes the data into the vehicle-side controller after the result is qualified.
[0067] The above embodiment applies the method of the present application, and by generating a pair of public key and private key based on an asymmetric encryption algorithm for each ECU respectively, storing the public key in the vehicle-side controller, and using the private key for encryption + signature + identity recognition in the cloud server, the safety of the diagnostic data is maximally guaranteed. The non-symmetric encryption algorithm (ECDSA) and the 256-bit encryption Hash algorithm (SHA256) are used for encryption and signature, and the key used for encryption is stored in the remote server, which maximally guarantees the safety of the encryption and signature process, and provides an effective and regulatory requirement meeting method for the safety protection of the diagnostic data, and further improves the safety of the diagnostic data.
[0068] Example two
[0069] The diagnostic data safety protection method based on the asymmetric encryption algorithm described in the present application can be applied to various operation and maintenance related devices, terminals, and servers. When the method needs to be used in various operation and maintenance scenarios, in order to improve the safety, the role permission strategy can be further increased.
[0070] On the basis of the framework and flow shown in Figure 1 , Figure 2 As shown in Figure 3 , the improvement point of the role permission is:
[0071] The role permission matrix is pre-stored in the cloud server.
[0072] For example, the role types include: car owner R1, main driver user R2, authorized maintenance technician R3, manufacturer engineer R4, emergency rescue personnel R5, fleet administrator R6, OTA server R7, diagnostic device R8, … Rx, … Rm, etc. Rx is the xth role type, and m is the number of role types.
[0073] The role permissions include: firmware update O1, ECU parameter modification O2, fault code clearing O3, sensor calibration O4…Ox…On, etc., Ox is the xth role permission, and n is the number of role permissions.
[0074] As shown in FIG. 1, the role permission matrix is pre-stored in the cloud server, and “0” indicates that the role does not have the permission for the corresponding operation by default, and “1” indicates that the role has the permission for the corresponding operation, but there may be additional restrictions. Figure 4 As shown in FIG. 1, the role permission matrix is pre-stored in the cloud server, and “0” indicates that the role does not have the permission for the corresponding operation by default, and “1” indicates that the role has the permission for the corresponding operation, but there may be additional restrictions.
[0075] In this example, the car owner R1 is “0” at the firmware update O1, meaning that the car owner cannot perform the firmware update operation on the vehicle; the authorized repairer R3 is “1 (authorized vehicle model)” at the firmware update O1, indicating that the repairer can only perform the firmware update on the specific vehicle model for which the repairer is authorized.
[0076] When the diagnostic instrument writes the diagnostic data to the vehicle-side controller, the identity recognition code, state information, and diagnostic data of the vehicle-side controller are sent to the cloud server, and the state information includes the role type of the diagnostic instrument as the authorized repairer R3.
[0077] The role type can be obtained in the following two ways: after the diagnostic instrument is connected to the vehicle-side controller, the vehicle-side controller obtains the role type of the diagnostic instrument as one of the state information, or after the diagnostic instrument receives the identity recognition code, state information, and diagnostic data of the vehicle-side controller, the role type is appended to the state information.
[0078] The cloud server verifies the identity recognition code and the state information of the vehicle-side controller, and according to the role type R3 of the state information, the corresponding role permission is found from the role permission matrix, and only the firmware update O1 is “1 (authorized vehicle model)”, and the diagnostic data that meets the firmware update is filtered according to the role permission;
[0079] The cloud server encrypts the diagnostic data that meets the firmware update, i.e., the diagnostic data filtered by the role permission, using the private key of the vehicle-side controller to generate encrypted data: the cloud server calculates the Hash value of the diagnostic data using a 256-bit encryption hash algorithm (SHA256) using the private key of the vehicle-side controller, calculates the digital signature of the encrypted data using an asymmetric encryption algorithm such as the ECDSA algorithm, and sends the encrypted data, Hash value, digital signature, Identification of the controller, timestamp, etc. to the diagnostic instrument;
[0080] The diagnostic instrument sends the encrypted data, Hash value, digital signature, Identification of the controller, timestamp, etc. to the vehicle-side controller;
[0081] The vehicle end controller decrypts the encrypted data, checks the identity, and verifies the digital signature using a preset public key, and after the result is qualified, writes the data again.
[0082] The cloud server feeds back role permission prompt information to the diagnostic instrument for diagnostic data that does not pass the role permission screening, i.e., diagnostic data that does not belong to the diagnostic data under firmware update.
[0083] After the role permission is added, whether the method is applied can be known by judging whether the control permissions of different users for the vehicle are consistent.
[0084] After the role permission strategy is adopted, in addition to obtaining the role permission from the role permission matrix as described above, a role permission inheritance formula can also be added to adjust the role permission. For example, the emergency rescue personnel R5 inherits the emergency operation permission of R1-R4, i.e., P(R5, O X )=1 when and only when O X ∈{emergency start, fault data reading}. That is, only when the operation O X is an emergency operation such as emergency start or fault data reading, does the emergency rescue personnel R5 have the operation permission, such as reading the fault data of the vehicle during emergency rescue, at which time R5 has the permission.
[0085] Example Three
[0086] The diagnostic data security protection method based on the asymmetric encryption algorithm can be applied to various operation and maintenance devices and various operation and maintenance scenes, and in order to improve security, a dynamic scene strategy and / or a risk linkage strategy can be further added.
[0087] On the basis of the framework and flow shown in Figure 1 , Figure 2 , Figure 3 The improvement point of adding a dynamic scene strategy and / or a risk linkage strategy lies in:
[0088] The cloud server pre-stores a dynamic scene set and a risk strategy set.
[0089] Each dynamic scene in the dynamic scene set is provided with corresponding scene operation permission; each risk factor in the risk strategy set is provided with a corresponding permission adjustment method.
[0090] The cloud server screens the diagnostic data according to the scene operation permission and / or the risk factor.
[0091] When the cloud server judges that the state information belongs to the dynamic scene set, the scene operation permission corresponding to the dynamic scene is selected; when the cloud server judges that the state information belongs to the risk factor of the dynamic scene set, the operation permission adjustment method corresponding to the risk factor is selected.
[0092] The cloud server encrypts the diagnostic data screened by the scene operation permission and / or the risk factor through the private key of the vehicle-side controller, and generates encrypted data.
[0093] When the cloud server determines that the state information belongs to the risk factor of the dynamic scene set and / or the risk factor set, the cloud server feeds back scene operation permission prompt information to the diagnostic instrument.
[0094] For example, the dynamic scenes of the dynamic scene strategy include: a battery low power scene, an accident mode scene, and a factory offline scene.
[0095] The coefficients and operation permissions corresponding to each dynamic scene are as follows:
[0096] The accident mode scene K_1=1.5, and the operation permission w1=temporary promotion of rescue-related permissions, including emergency start and fault data reading;
[0097] The battery low power scene K_2=0.5, and the operation permission w2=limit high power consumption write operation, including firmware update O1;
[0098] The factory offline scene K_3=2.0, and the operation permission w3=opens all write permissions, which is only valid for the first activation.
[0099] When the state information of the vehicle-side controller meets multiple dynamic scene conditions at the same time, a composite scene is formed, and the maximum weighted value is taken for the permission of the composite scene.
[0100] The composite scene coefficient K_scene is calculated as follows: K_scene=max(w1K1,w2K2,...,w n K n )
[0101] Where wᵢ is the scene priority weight, such as accident scene w1=0.8, low power w2=0.2, and the weight can be pre-set or dynamically adjusted.
[0102] For example, when the risk factors of the risk linkage strategy include role credibility, authorized duration, network factors, behavior factors, and device factors, the risk linkage strategy can set risk dynamic adjustment. For example, according to the role credibility adjustment α value, the formula is α=α0×(1-C), where any pre-set α0=0.02 / h is the adjustment coefficient, and C is the role credibility (value range 0-1). The pre-set roles include the vehicle owner, the stranger device, and the authorized repairer. Among them, the vehicle owner C=0.8, α=0.004 / h, the stranger device C=0.2, α=0.016 / h, and the role credibility C=0.7 of the authorized repairer R3 is medium trust, α=0.02×(1−0.7)=0.006 / h.
[0103] The risk linkage strategy can further set the permission recovery condition: when the user's active identity verification (such as facial feature recognition passing) is detected, trigger P_final reset to P_scene, the formula is:
[0104] P_final'=P_scene×I;
[0105] Where I is the identity verification result, 1=pass, 0=fail.
[0106] The dynamic adjustment process of the method described in the application is further introduced below in combination with specific data, taking the vehicle in the "accident mode scene" K1 as an example, and the authorized repairer R3 performing ECU parameter modification O2, to completely show the dynamic adjustment process of the permission from the initial value to the final effective value.
[0107] S201 determine the baseline permission Pbase.
[0108] As shown in the permission matrix, the baseline permission of R3 to O2 is Pbase=1 (allowed within the repair range). Figure 4
[0109] S202 scene coefficient intervention, adjust scene permission
[0110] The state parameters of the vehicle show that the current is in the "accident mode scene" K1=1.5, the weight w1=0.8 and the "battery low power scene" K2=0.5, the weight w2=0.2:
[0111] Composite scene coefficient calculation: Kscene=max(0.8×1.5, 0.2×0.5)=max(1.2, 0.1)=1.2
[0112] After adjustment, the scene permission value is: Pscene=Pbase×Kscene=1×1.2=1.2
[0113] S203 risk factors cause adjustment permission
[0114] The role credibility C of R3 is 0.7, which is medium trust, the adjustment coefficient is α=0.02×(1−0.7)=0.006 / h, assuming that the permission has been granted t=30 minutes (0.5h), the risk factor causes the adjustment of the scene permission value, and the risk permission Pdecay=Pscene×e−αt=1.2×e−0.006×0.5≈1.2×0.997=1.196
[0115] S204 other risk factors linkage, calculate risk permission threshold
[0116] Other risk factors include network factors, behavioral factors, device factors, and the corresponding preset weights are allocated as network > behavior > device, network factor Rnetwork=0.3, behavioral factor Rbehavior=0.2, device factor Rdevice=0.1, and the proportion in the risk factors is preset as 0.3, 0.3, and 0.4, respectively.
[0117] The total risk Rtotal caused by the risk factors = 0.3x0.3 + 0.3x0.2 + 0.4x0.1 = 0.19.
[0118] The risk permission threshold Tperm based on the negative correlation of risk is Tperm=0.8−0.5×Rtotal=0.8−0.095=0.705
[0119] Where 0.8 is the basic permission threshold base, which is a system preset parameter. When the risk Rtotal = 0 (completely risk-free), the minimum threshold that the permission needs to reach. It is determined by combining factors such as vehicle safety requirements, historical legal operation permission distribution, etc., through empirical calibration or statistical analysis. 0.5 is the influence coefficient of risk on permission threshold, which is a system preset parameter. Quantifies the "total risk increases by 1 unit, the permission threshold decreases by the magnitude", embodies the negative correlation logic of "the higher the risk, the more stringent the permission verification". This coefficient can be calibrated through the correlation analysis of historical risk events and permission abuse.
[0120] S205 permission takes effect
[0121] Since the risk permission Pdecay calculated in step S203 is Pdecay=1.196≥Tperm=0.705, Pfinal=1.196 (rounded to two decimal places), it meets the write-in condition and allows R3 to perform O2 operation.
[0122] Dynamic adjustment in abnormal scenarios:
[0123] In order to adjust the timing of triggering risk, the risk permission threshold is set.
[0124] If the total risk rises to Rtotal=0.8 after 10 minutes, the risk permission threshold will be updated to Tperm=0.8−0.5×0.8=0.4, at this time the risk permission permission decays to Pdecay=1.2×e−0.006×(0.5+10 / 60)≈1.18 (still satisfies ≥0.4) due to time decay; it meets the write-in condition and allows R3 to perform O2 operation.
[0125] If the risk suddenly rises to Rtotal=1.0, the risk permission threshold is updated to Tperm=0.3, and the behavior risk formula Rbehavior=|fcurrent-favg| / favg=1.2>1 is triggered, forcing Pfinal to be reduced to 0.2, rejecting writing and alarming.
[0126] Wherein, Fcurrent is the write frequency in the current time window (for example, "the number of write operations in 10 minutes"); Favg is the average write frequency in the same scenario (which is based on the historical operation data statistics of the vehicle in the same scenario, such as "parking maintenance mode" and "remote OTA mode").
[0127] The above formula is used to measure the deviation of "current write behavior from historical normal behavior", the higher the deviation, the greater Rbehavior, the more abnormal the behavior, and the higher the risk of suspected illegal writing.
[0128] Pfinal: represents the final value of Pdecay, and when Rbehavior is greater than 1, it is considered that there is abnormal behavior, at which time the final value of Pdecay, i.e. Pfinal=0.2, is forced to be lower than the threshold.
[0129] The improvement points of the present example are:
[0130] (1) A pair of public key and private key based on asymmetric encryption algorithm is generated for each ECU, the public key is stored in the vehicle-side controller, and the private key is used for encryption+signature+identity recognition in the cloud server, which maximizes the security of the diagnostic data.
[0131] (2) The asymmetric encryption algorithm (ECDSA) and 256-bit encryption hash algorithm (SHA256) encryption and signature method are used, and a complete implementation process is proposed.
[0132] (3) Combined with dynamic permissions, different permission controls are adopted for different users or states of the vehicle-side controller, further improving security.
[0133] The beneficial effects of the present example are:
[0134] 1. The diagnostic flashing data is encrypted and digitally signed using asymmetric encryption, and the encryption key is stored in the background, maximizing the security of the encryption and signature process, providing an effective and regulatory-compliant method for diagnostic data security protection.
[0135] 2. Through a three-tiered mechanism of “baseline permissions defining boundaries, dynamic adjustment to adapt to scenarios, and risk linkage to control risks,” it not only solves the contradiction of traditional static permissions being “either too lenient and easily abused, or too strict and affecting efficiency,” but also achieves the goal of “accurately blocking illegal writes and efficiently allowing legitimate operations,” especially suitable for complex terminal scenarios such as vehicles with “multi-role interaction, multi-scenario switching, and high security requirements.”
Claims
1. A diagnostic data security protection method based on an asymmetric encryption algorithm, characterized in that, each vehicle-side controller is provided with a unique identity code; the cloud server stores the identity code of each vehicle-side controller and the associated information of each vehicle-side controller; the cloud server generates a pair of public key and private key based on the asymmetric encryption algorithm for each vehicle-side controller based on the identity code and the associated information of the vehicle-side controller; the private key is stored in the cloud server, and the public key is integrated in the vehicle-side controller; the diagnostic instrument is used to read the identity code and state information of the vehicle-side controller from the vehicle-side controller, and generate diagnostic data for the vehicle-side controller according to the state information; when the diagnostic instrument writes diagnostic data to the vehicle-side controller, the identity code, state information and diagnostic data of the vehicle-side controller are sent to the cloud server; the cloud server verifies the identity code and state information of the vehicle-side controller, and filters the diagnostic data according to the state information; the cloud server calculates the Hash value of the diagnostic data using the SHA256 algorithm through the private key of the vehicle-side controller, calculates the digital signature of the encrypted data using the asymmetric encryption algorithm, and sends the encrypted data, Hash value, digital signature, identity code of the controller and timestamp to the diagnostic instrument; the diagnostic instrument sends the encrypted data, Hash value, digital signature, identity code of the controller and timestamp to the vehicle-side controller; the vehicle-side controller decrypts the encrypted data, verifies the identity and verifies the digital signature using the preset public key, and writes the data after the result is qualified; the cloud server stores a risk policy set, and each risk factor in the risk policy set is provided with a corresponding permission adjustment method; when the cloud server determines that the state information belongs to a risk factor in a dynamic scenario set, the cloud server selects the operation permission adjustment method corresponding to the risk factor, encrypts the diagnostic data filtered by the operation permission through the private key of the vehicle-side controller, and generates encrypted data; when the risk factor includes role credibility and authorized duration, a risk dynamic adjustment coefficient a is set for the risk linkage strategy, a = a0 × (1-C), wherein a0 is an initial preset risk dynamic adjustment coefficient, and C is the role credibility, and the value range is 0-1; when it is detected that the user of the diagnostic instrument actively performs identity verification, the operation permission is reset.
2. The diagnostic data security protection method based on asymmetric encryption algorithm according to claim 1, characterized in that, when the cloud server determines that the state information belongs to a risk factor in a risk factor set, the cloud server feeds back scenario operation permission prompt information to the diagnostic instrument. 3.A diagnostic data security protection method based on an asymmetric encryption algorithm, characterized in that, each vehicle-side controller is provided with a unique identity code; the cloud server stores the identity code of each vehicle-side controller and the associated information of each vehicle-side controller; the cloud server generates a pair of public key and private key based on the asymmetric encryption algorithm for each vehicle-side controller based on the identity code and the associated information of the vehicle-side controller; the private key is stored in the cloud server, and the public key is integrated in the vehicle-side controller; the diagnostic instrument is used to read the identity code and state information of the vehicle-side controller from the vehicle-side controller, and generate diagnostic data for the vehicle-side controller according to the state information; The diagnostic instrument sends the identity recognition code, state information and diagnostic data of the vehicle end controller to the cloud server when writing the diagnostic data to the vehicle end controller; The cloud server verifies the identity recognition code and state information of the vehicle end controller, and filters the diagnostic data according to the state information; The cloud server calculates the Hash value of the diagnostic data by using the private key of the vehicle end controller through the SHA256 algorithm, calculates the digital signature of the encrypted data by using the asymmetric encryption algorithm, and sends the encrypted data, Hash value, digital signature, identity recognition code of the controller and time stamp to the diagnostic instrument; The diagnostic instrument sends the encrypted data, Hash value, digital signature, identity recognition code of the controller and time stamp to the vehicle end controller; The vehicle end controller decrypts the encrypted data, verifies the identity and verifies the digital signature by using the preset public key, and writes the data after the result is qualified; The cloud server stores a dynamic scene set, and each dynamic scene in the dynamic scene set is provided with corresponding scene operation permission; The cloud server filters the diagnostic data according to the scene operation permission; When the cloud server judges that the state information belongs to the dynamic scene set, the cloud server selects the scene operation permission corresponding to the dynamic scene, and encrypts the diagnostic data filtered through the scene operation permission by using the private key of the vehicle end controller to generate encrypted data; The dynamic scene includes: accident mode scene K1, operation permission w1, low battery scene K2, operation permission w2, factory offline scene K3, operation permission w3; When the state information of the vehicle end controller meets multiple dynamic scene conditions at the same time, a composite scene is formed, and the maximum permission is taken for the operation permission of the composite scene.
4. The diagnostic data security protection method based on an asymmetric encryption algorithm according to claim 3, characterized in that, When the cloud server judges that the state information belongs to the dynamic scene set, the cloud server feeds back the scene operation permission prompt information to the diagnostic instrument.
5. A diagnostic data security protection method based on asymmetric encryption algorithm according to any one of claims 1 to 4, characterized in that, The association information includes: diagnostic address, controller name, supplier, model information.
6. A diagnostic data security protection method based on asymmetric encryption algorithm according to any one of claims 1 to 4, characterized in that, The state information includes: battery capacity, accident mode, first activation information.
7. A diagnostic data security protection method based on asymmetric encryption algorithm according to any one of claims 1 to 4, characterized in that, The asymmetric encryption algorithm is the ECDSA algorithm, which generates a public-private key pair by using the ECDSA elliptic curve algorithm and is used for encryption and digital signature algorithm; SHA256 algorithm is used as the Hash value algorithm.
8. A diagnostic data security protection method based on an asymmetric encryption algorithm according to any one of claims 1 to 4, characterized in that, When the diagnostic instrument writes diagnostic data to the vehicle end controller, the state information sent by the diagnostic instrument to the cloud server includes the role type, and the cloud server stores a role permission matrix; The cloud server looks up the corresponding role permission from the role permission matrix according to the role type, and filters the diagnostic data according to the role permission; The cloud server encrypts the diagnostic data filtered through the role permission by using the private key of the vehicle end controller to generate encrypted data.
9. The diagnostic data security protection method based on an asymmetric encryption algorithm according to claim 8, characterized in that, The cloud server feeds back the role permission prompt information to the diagnostic instrument for the diagnostic data that does not pass the role permission filtering.
10. A diagnostic data security protection system based on asymmetric encryption algorithms, applying the method according to any one of claims 1 to 9, characterized in that, It includes a vehicle end controller, a remote server and a diagnostic instrument; The vehicle end controller is provided with a unique identity recognition code; The cloud server stores the identity code of the vehicle-side controller and the associated information of the vehicle-side controller; based on the identity code and the associated information of the vehicle-side controller, a pair of public key and private key based on an asymmetric encryption algorithm is generated for each vehicle-side controller; the private key is stored in the cloud server, and the public key is integrated in the vehicle-side controller; The diagnostic instrument is used to read the identity code and the state information of the vehicle-side controller from the vehicle-side controller, and to generate diagnostic data for the vehicle-side controller according to the state information; when writing the diagnostic data to the vehicle-side controller, the identity code, the state information and the diagnostic data of the vehicle-side controller are sent to the cloud server; The cloud server verifies the identity code and the state information of the vehicle-side controller, and screens the diagnostic data according to the state information; the private key of the vehicle-side controller is used to calculate the Hash value of the diagnostic data by using the SHA256 algorithm, the digital signature of the encrypted data is calculated by using the asymmetric encryption algorithm, and the encrypted data, the Hash value, the digital signature, the identity code of the controller and the time stamp are sent to the diagnostic instrument; The diagnostic instrument sends the encrypted data, the Hash value, the digital signature, the identity code of the controller and the time stamp to the vehicle-side controller; The vehicle-side controller uses the preset public key to decrypt the encrypted data, to verify the identity and to verify the digital signature, and after the result is qualified, the data is written again.
Citation Information
Patent Citations
Securely providing diagnostic data from a vehicle to a remote server using a diagnostic tool
CN105320034A
Heavy diesel vehicle remote emission monitoring system and method
CN113741245A
Authority safety control method and device for artificial intelligence automobile
CN120308156A
Human resource management method and system based on data security
CN120338736A