A method, terminal and storage medium for storing electronic vouchers of digital services

By analyzing the type identification, attack level, and regularity of electronic voucher data, and dynamically adjusting the number of encryption attempts, the problems of data security and privacy protection in electronic voucher storage are solved, the amount of encryption computation is reduced, and storage efficiency is improved.

CN118503953BActive Publication Date: 2024-11-01JIANGSU WAFA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410633427.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-11-01
Estimated Expiration
2044-05-21

AI Technical Summary

Technical Problem

Existing technologies are insufficient to effectively protect data security and privacy in electronic credential storage, and the computational complexity of encryption is too high, resulting in low efficiency.

Method used

By analyzing the type identifier, attack level, and regularity of electronic voucher data, the security risk probability of each data segment is calculated, the number of encryption times is dynamically adjusted, and binarization is performed to generate encrypted voucher data.

Benefits of technology

This approach achieves a reduction in encrypted computation while ensuring data security, thereby improving data storage efficiency and privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118503953B_ABST
    Figure CN118503953B_ABST
Patent Text Reader

Abstract

The present invention provides an electronic credential storage method, terminal and storage medium for digital services, which relates to the field of electronic data processing technology, including obtaining target credential data for digital services; determining the attack level and attack resistance failure rate of the target credential data based on data type identification; obtaining multiple risk probability values; determining the number of encryptions of the target data segment based on the risk probability value, and performing encryption processing accordingly to obtain first data; obtaining second data; generating and storing encrypted credential data based on the first data and the second data. The present invention determines the corresponding number of encryptions respectively by the risk probability values ​​of different data segments of the same credential data, and performs encryption operations accordingly. The number of encryptions for data segments with relatively regular data distribution is relatively large, and the number of encryptions for data segments with irregular data distribution is relatively small. It can avoid multiple encryptions for all data segments while ensuring data security, greatly reducing the amount of encryption calculations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic data processing, and in particular to an electronic credential storage method, a terminal and a storage medium for digital services. Background Art

[0002] Electronic credential data in digital business refers to certification documents or information stored in electronic form, which is usually used to verify the identity, qualifications, rights or other relevant information of an entity. The use of electronic credential data can simplify the verification process, improve efficiency, and in many cases can be integrated with digital systems to achieve a higher level of automation and convenience; but at the same time, in order to protect the security and privacy of data, corresponding security measures are usually required for the storage, transmission and processing of electronic credentials, thereby improving the security and privacy protection of data and reducing the risk of data leakage and tampering. Summary of the invention

[0003] The purpose of the present invention is to provide a method, terminal and storage medium for storing electronic credentials of digital services to improve the above problems. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0004] In a first aspect, the present application provides a method for storing an electronic credential of a digital service, comprising:

[0005] Acquire target credential data of a digital service, wherein the target credential data carries a data type identifier;

[0006] Determining the attack level and attack resistance failure rate of the target credential data based on the data type identifier;

[0007] Dividing the target credential data into a plurality of data segments to obtain a plurality of target data segments;

[0008] Calculating a regularity based on the data in each target data segment to obtain a plurality of target regularities, wherein the target regularities are used to characterize the degree of data repetition in the data segment;

[0009] Calculate the security risk probability of each target data segment based on the attack level, the attack resistance failure rate and the target regularity to obtain multiple risk probability values;

[0010] Determine the number of encryption times for each target data segment based on the risk probability value, and perform encryption processing accordingly to obtain first data;

[0011] Binarizing the target voucher data to obtain second data;

[0012] Encrypted credential data is generated based on the first data and the second data and stored.

[0013] In a second aspect, the present application also provides an electronic credential storage terminal for digital services, including:

[0014] A first acquisition unit, configured to acquire target credential data of a digital service, wherein the target credential data carries a data type identifier;

[0015] A first determining unit, configured to determine the attack level and attack resistance failure rate of the target credential data based on the data type identifier;

[0016] A first division unit, configured to divide the target credential data into a plurality of data segments to obtain a plurality of target data segments;

[0017] A first obtaining unit is used to calculate a regularity based on the data in each target data segment to obtain a plurality of target regularities, wherein the target regularities are used to characterize the degree of data repetition in the data segment;

[0018] A second obtaining unit is used to calculate the security risk probability of each target data segment based on the attack level, the attack resistance failure rate and the target regularity to obtain a plurality of risk probability values;

[0019] an encryption unit, used to determine the number of encryption times of each target data segment based on the risk probability value, and perform encryption processing accordingly to obtain first data;

[0020] A third obtaining unit is used to perform binarization processing on the target voucher data to obtain second data;

[0021] A storage unit is used to generate and store encrypted credential data based on the first data and the second data.

[0022] In a third aspect, the present application further provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned electronic credential storage method based on digital business are implemented.

[0023] The beneficial effects of the present invention are:

[0024] The present invention determines the corresponding number of encryptions for different data segments of the same credential data through the risk probability values, and performs encryption operations accordingly. The number of encryptions for data segments with relatively regular data distribution is relatively large, while the number of encryptions for data segments with irregular data distribution is relatively small. This can avoid multiple encryptions of all data segments while ensuring data security, thereby greatly reducing the amount of encryption calculations.

[0025] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 It is a schematic diagram of the process of the electronic certificate storage method of the digital service described in the embodiment of the present invention;

[0028] Figure 2 is a schematic diagram of an initial image described in an embodiment of the present invention;

[0029] Figure 3 is a schematic diagram of a target image described in an embodiment of the present invention;

[0030] Figure 4 It is a schematic diagram of the structure of an electronic credential storage terminal for digital services described in an embodiment of the present invention.

[0031] Markings in the figure: 10, first acquisition unit; 20, first determination unit; 30, first division unit; 40, first obtaining unit; 50, second obtaining unit; 60, encryption unit; 70, third obtaining unit; 80, storage unit. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0033] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0034] Embodiment 1:

[0035] This embodiment provides a method for storing electronic credentials for digital services.

[0036] See also Figure 1 , the figure shows that the method includes step S10, step S20, step S30, step S40, step S50, step S60, step S70 and step S80.

[0037] Step S10. Obtain target voucher data of the digital service, where the target voucher data carries a data type identifier;

[0038] Step S20. Determine the attack level and attack resistance failure rate of the target credential data based on the data type identification;

[0039] Specifically, in digital business, electronic credential data is crucial to ensuring system security, protecting user privacy and ensuring transaction authenticity. Electronic credential data can be personal identity information, digital signatures, access rights, transaction records, etc. The data type identifier is used to characterize the category of the electronic credential data, such as identity proof data, financial data, and access permission data, etc.

[0040] The attack level refers to the level of attack that electronic credential data of this category usually suffers, which is assessed based on the magnitude of the damage caused by the attack; the attack resistance failure rate refers to the ratio of the number of times the electronic credential data of this category has been leaked to the number of times it has suffered attacks; the attack levels and attack resistance failure rates corresponding to different credential data categories are not the same.

[0041] Step S30. Divide the target credential data into multiple data segments to obtain multiple target data segments;

[0042] Step S40. Calculate the regularity based on the data in each target data segment to obtain multiple target regularities, where the target regularities are used to characterize the degree of data repetition in the data segment;

[0043] Specifically, the credential data is divided into multiple data segments, and the degree of data order repetition in each data segment is different. It is believed that the data segments with a higher degree of data order repetition have a higher probability of being attacked and cracked, while the data segments with a lower degree of data order repetition have a lower probability of being attacked and cracked. Therefore, the encryption levels corresponding to data segments with different degrees of data repetition are also different.

[0044] Specifically, step S40 specifically includes step S41, step S42, step S43 and step S44:

[0045] Step S41. Obtain independent fields in the target data segment to obtain multiple target fields;

[0046] Specifically, an independent field is a basic unit for storing data.

[0047] Step S42. compressing and converting multiple target fields into integers to obtain multiple target integers;

[0048] Step S43. construct a linear regression equation based on multiple target integers, determine the error term in the linear regression equation, and obtain the target error term;

[0049] Step S44. Calculate the product of the target error term and the first set threshold value to obtain the target regularity of the target data segment;

[0050] Specifically, each field is compressed and converted into an integer, with the sorting order of the fields as the horizontal axis and the integer value after the field compression and conversion as the vertical axis, so as to construct a linear regression equation for each data segment. The error term of the linear regression equation can characterize the degree of linear correlation between the integers corresponding to multiple fields. The error term corresponding to each target data segment is multiplied by the set threshold to obtain the target regularity of each target data segment.

[0051] Step S50. Calculate the security risk probability of each target data segment based on the attack level, the failure rate of resisting attacks and the target regularity to obtain multiple risk probability values;

[0052] Specifically, the security risk probability value of each data segment is determined by the attack level, attack resistance failure rate and regularity suffered by the data of this category. The risk probability value is used to characterize the difficulty of the data segment being attacked and cracked.

[0053] Specifically, step S50 specifically includes step S51, step S52, step S53 and step S54:

[0054] Step S51. Obtain the number of protection resources invested and the number of attack resources suffered corresponding to the data type identifier in the historical time period;

[0055] Step S52. Calculate the ratio of the number of protected resources to the number of attacked resources to obtain a resistance coefficient;

[0056] Specifically, the resistance coefficient calculation formula is:

[0057]

[0058] Among them, ε is the resistance coefficient; T is the number of protected resources; D is the number of attack resources.

[0059] Step S53: multiply the attack level, the attack resistance failure rate and the target regularity by the preset weight coefficients respectively, and sum the multiplication results to obtain a first result;

[0060] Step S54. Calculate the product of the first result and the resistance coefficient to obtain a risk probability value;

[0061] Specifically, the calculation formula for the risk probability value is:

[0062] V=(W1S1+W2S2+W3S3)*ε

[0063] Among them, V is the risk probability value; W1 is the weight value of the attack level; W2 is the weight value of the failure rate of resisting attack; W3 is the weight value of the target regularity; S1 is the attack level; S2 is the failure rate of resisting attack; S3 is the target regularity; ε is the resistance coefficient.

[0064] Step S60. Determine the number of encryption times for each target data segment based on the risk probability value, and perform encryption processing accordingly to obtain first data;

[0065] Specifically, it is believed that the data segment corresponding to a higher security risk probability value is more susceptible to attack and cracking, and the data segment corresponding to a lower security risk probability value is less likely to be attacked and cracked. Therefore, the number of encryption times corresponding to data segments with different security risk probability values ​​are not the same.

[0066] Specifically, step S60 specifically includes step S61, step S62, step S63, step S64, step S65, step S66, step S67, step S68 and step S69:

[0067] Step S61. Obtain the historical average number of encryption times of the credential data corresponding to the data type identifier;

[0068] Step S62. Obtain the number of target data segments to obtain the target number;

[0069] Step S63. Calculate the product of the historical average number of encryption times and the second set threshold to obtain a first product;

[0070] Step S64. Calculate the difference between the preset maximum number of encryption times and the average number of encryption times as the first difference;

[0071] Step S65. Calculate the product of the first difference and the second set threshold value to obtain a second product;

[0072] Step S66. Calculate the difference between the target quantity and the second product to obtain a second difference;

[0073] Step S67. Randomly generate a pseudo-random number within a numerical range between the first product and the second difference based on a random function;

[0074] Step S68. Calculate the product of the pseudo-random number and the risk probability value and perform integer operation to obtain the number of encryption times for each data segment;

[0075] Specifically, the encryption times calculation formula is:

[0076] J i =P i *radmon([(n*q), t-(mn)*q])

[0077] Among them, J i is the number of encryptions of the i-th target data segment; n is the historical average number of encryptions; q is the second set threshold; t is the number of target data segments; m is the maximum number of encryptions; P i is the risk probability value of the i-th target data segment; radmon() is a random function;

[0078] Determining the number of encryptions corresponding to different risk probability values ​​according to the pseudo-random number calculation formula can effectively improve the encryption security of electronic credential data.

[0079] Step S69: Perform encryption processing based on the number of encryption times of each target data segment to obtain first data;

[0080] Specifically, step S69 specifically includes step S691, step S692, step S693, step S694, step S695, step S696 and step S697:

[0081] Step S691. Calculate the average number of encryption times of multiple target data segments to obtain an average encryption number;

[0082] Step S692. Determine the maximum encryption number and the minimum encryption number from multiple encryption times;

[0083] Step S693. Calculate the difference between the maximum number of encryption times and the average number of encryption times to obtain a third difference;

[0084] Step S694. Calculate the difference between the average encryption number and the minimum encryption number to obtain a fourth difference;

[0085] Step S695. Calculate the sum of the third difference and the fourth difference to obtain the characteristic value of the number of encryption times;

[0086] Step S696. Based on the encryption times and characteristic values ​​corresponding to each target data segment, encryption processing is performed to obtain multiple encrypted data segments;

[0087] Step S697. Combine multiple encrypted data segments to obtain first data;

[0088] Specifically, the AES algorithm is used in this application to encrypt the credential data, and an encryption feature value is determined according to the number of encryption times of all data segments, and is used together with a key to encrypt the data, thereby increasing the difficulty and security of encryption.

[0089] Step S70: Binarize the target voucher data to obtain second data;

[0090] Specifically, step S70 specifically includes step S71, step S72, step S73, step S74, step S75 and step S76:

[0091] Step S71. Map the target voucher data based on pixel coding to obtain an initial image;

[0092] Step S72: Divide the initial image into multiple modules to obtain multiple target modules;

[0093] Step S73. Sum all pixel values ​​in each target module to obtain multiple pixel sums;

[0094] Step S74. Determine a minimum pixel sum and a maximum pixel sum from the multiple pixel sums, and calculate the difference between the maximum pixel sum and the minimum pixel sum to obtain a target difference;

[0095] Step S75. Binarize the initial image based on the target difference to obtain the target image;

[0096] Step S76: Convert the target image based on the image coding to obtain second data;

[0097] Specifically, in this application, the target voucher data is mapped by pixel coding to obtain an initial image, and the initial image is a pixel value obtained by mapping the voucher data. The initial image is divided into multiple modules, such as Figure 2 As shown, it includes a first module, a second module, and a third module, and calculates the sum of pixel values ​​in each module, determines the maximum pixel value sum and the minimum pixel value sum, and calculates the difference between the two to obtain a target difference. According to the target difference, each pixel value on the initial image is binarized, as shown in FIG. Figure 3 As shown, the pixel values ​​greater than the target difference are set to 265, and the pixel values ​​less than the target difference are set to 0, so as to obtain the target image, and the target image is encoded and converted into the second data.

[0098] Step S80. Generate encrypted credential data based on the first data and the second data and store it;

[0099] Specifically, step S80 specifically includes step S81, step S82 and step S83:

[0100] Step S81. Divide the second data into a plurality of data segments to obtain a plurality of processed data segments, wherein the number of the processed data segments is exactly the same as the number of the target data segments;

[0101] Step S82: inserting the plurality of processed data segments after each encrypted data segment, thereby obtaining encrypted credential data;

[0102] Step S83. Determine the storage location based on the data type identifier corresponding to the encrypted credential data, and store it;

[0103] Specifically, the second data is divided into multiple processed data segments, and the processed data segments are inserted in sequence after the encrypted target data segments in the first data, thereby generating encrypted credential data. Encrypting the credential data using multiple encryption methods and splicing them can improve data security, privacy protection level and system flexibility, reduce system risks, and meet security standards and compliance requirements.

[0104] Embodiment 2:

[0105] like Figure 4 As shown, this embodiment provides an electronic credential storage terminal for digital services, and the terminal includes:

[0106] A first acquisition unit 10 is used to acquire target credential data of a digital service, where the target credential data carries a data type identifier;

[0107] A first determination unit 20, configured to determine the attack level and the attack resistance failure rate of the target credential data based on the data type identifier;

[0108] A first dividing unit 30 is used to divide the target voucher data into a plurality of data segments to obtain a plurality of target data segments;

[0109] A first obtaining unit 40 is used to calculate a regularity based on the data in each target data segment to obtain a plurality of target regularities, wherein the target regularity is used to characterize the degree of data repetition in the data segment;

[0110] The second obtaining unit 50 is used to calculate the security risk probability of each target data segment based on the attack level, the failure rate of resisting the attack and the target regularity, and obtain multiple risk probability values;

[0111] The encryption unit 60 is used to determine the number of encryption times of each target data segment based on the risk probability value, and perform encryption processing accordingly to obtain the first data;

[0112] A third obtaining unit 70 is used to perform binarization processing on the target voucher data to obtain second data;

[0113] The storage unit 80 is used to generate and store encrypted credential data based on the first data and the second data.

[0114] In a specific implementation disclosed in the present application, the first obtaining unit 40 includes:

[0115] A second acquisition unit is used to acquire independent fields in the target data segment to obtain multiple target fields;

[0116] A compression unit, used for compressing a plurality of target fields and converting them into integers to obtain a plurality of target integers;

[0117] A second determining unit is used to construct a linear regression equation based on multiple target integers, determine an error term in the linear regression equation, and obtain a target error term;

[0118] The first calculation unit is used to calculate the product of the target error term and the first set threshold value to obtain the target regularity of the target data segment.

[0119] In a specific implementation manner disclosed in the present application, the second obtaining unit 50 includes:

[0120] A third acquisition unit is used to acquire the number of protection resources invested and the number of attack resources suffered corresponding to the data type identifier in a historical time period;

[0121] The second calculation unit is used to calculate the ratio of the number of protection resources to the number of attack resources to obtain a resistance coefficient;

[0122] The fourth obtaining unit is used to multiply the attack level, the failure rate of resisting the attack and the target regularity by the preset weight coefficient respectively, and sum the product results to obtain the first result;

[0123] The third calculation unit is used to calculate the product of the first result and the resistance coefficient to obtain a risk probability value.

[0124] In a specific implementation manner disclosed in the present application, the third obtaining unit 70 includes:

[0125] A mapping unit, used for mapping the target voucher data based on the pixel encoding to obtain an initial image;

[0126] A second dividing unit is used to divide the initial image into a plurality of modules to obtain a plurality of target modules;

[0127] A fifth obtaining unit is used to calculate the sum of all pixel values ​​in each target module to obtain a plurality of pixel sums;

[0128] a sixth obtaining unit, configured to determine a minimum pixel sum and a maximum pixel sum from the plurality of pixel sums, and calculate a difference between the maximum pixel sum and the minimum pixel sum to obtain a target difference;

[0129] A seventh obtaining unit is used to perform binarization processing on the initial image based on the target difference to obtain a target image;

[0130] The conversion unit is used to convert the target image based on the image coding to obtain the second data.

[0131] In a specific implementation disclosed in the present application, the encryption unit 60 includes:

[0132] A fourth acquisition unit, used to acquire a historical average number of encryption times of the credential data corresponding to the data type identifier;

[0133] A fifth acquisition unit, used to acquire the target data segment quantity to obtain the target quantity;

[0134] A fourth calculation unit, used to calculate the product of the historical average number of encryption times and the second set threshold value to obtain a first product;

[0135] A fifth calculation unit, used for calculating a difference between a preset maximum number of encryption times and an average number of encryption times as a first difference;

[0136] a sixth calculation unit, configured to calculate a product of the first difference and a second set threshold value to obtain a second product;

[0137] a seventh calculation unit, configured to calculate a difference between the target quantity and the second product to obtain a second difference;

[0138] A generating unit, configured to randomly generate a pseudo-random number within a numerical range between the first product and the second difference based on a random function;

[0139] an eighth calculation unit, used for calculating the product of the pseudo-random number and the risk probability value and performing integer operation to obtain the number of encryption times of each data segment;

[0140] The first processing unit is used to perform encryption processing based on the number of encryption times of each target data segment to obtain first data.

[0141] In a specific implementation disclosed in the present application, the first processing unit includes:

[0142] A ninth calculation unit, used for calculating an average of the number of encryption times of the plurality of target data segments to obtain an average encryption number;

[0143] A third determining unit, used to determine a maximum encryption number and a minimum encryption number from a plurality of encryption times;

[0144] a tenth calculation unit, configured to calculate a difference between a maximum number of encryption times and an average number of encryption times to obtain a third difference;

[0145] The eleventh and twelfth calculation units are used to calculate the difference between the average encryption number and the minimum encryption number to obtain a fourth difference;

[0146] A twelfth calculation unit, used for calculating the sum of the third difference and the fourth difference to obtain a characteristic value of the number of encryption times;

[0147] A second processing unit is used to perform encryption processing based on the encryption times and characteristic values ​​corresponding to each target data segment to obtain multiple encrypted data segments;

[0148] The combining unit is used to combine multiple encrypted data segments to obtain first data.

[0149] In a specific implementation disclosed in the present application, the storage unit 80 includes:

[0150] A third dividing unit is used to divide the second data into a plurality of data segments to obtain a plurality of processed data segments, wherein the number of the processed data segments is exactly the same as the number of the target data segments;

[0151] An inserting unit, used for inserting the plurality of processed data segments after each encrypted data segment, respectively, so as to obtain encrypted credential data;

[0152] The fourth determining unit is used to determine a storage location based on a data type identifier corresponding to the encrypted credential data, and store the data.

[0153] It should be noted that, regarding the terminal in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0154] Embodiment 3:

[0155] Corresponding to the above method embodiment, a readable storage medium is also provided in this embodiment. The readable storage medium described below and the electronic credential storage method for a digital service described above can refer to each other.

[0156] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for storing electronic credentials of digital services in the above method embodiment.

[0157] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.

[0158] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0159] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for storing electronic vouchers for digital services, characterized in that: include: Acquire target credential data of a digital service, wherein the target credential data carries a data type identifier; Determining the attack level and attack resistance failure rate of the target credential data based on the data type identifier; Dividing the target credential data into a plurality of data segments to obtain a plurality of target data segments; Calculating a regularity based on the data in each target data segment to obtain a plurality of target regularities, wherein the target regularities are used to characterize the degree of data repetition in the data segment; Calculate the security risk probability of each target data segment based on the attack level, the attack resistance failure rate and the target regularity to obtain multiple risk probability values; Determine the number of encryption times for each target data segment based on the risk probability value, and perform encryption processing accordingly to obtain first data; Binarizing the target voucher data to obtain second data; Generate and store encrypted credential data based on the first data and the second data; The security risk probability of each target data segment is calculated based on the attack level, the attack resistance failure rate and the target regularity, and multiple risk probability values ​​are obtained, including: Obtaining the number of protection resources invested and the number of attack resources suffered corresponding to the data type identifier in a historical time period; Calculate the ratio of the number of protection resources to the number of attack resources to obtain a resistance coefficient; The attack level, the attack resistance failure rate and the target regularity are respectively multiplied by a preset weight coefficient, and the product results are summed to obtain a first result; Calculate the product of the first result and the resistance coefficient to obtain the risk probability value; Wherein, determining the number of encryption times of each target data segment based on the risk probability value, and performing encryption processing accordingly to obtain first data, includes: Obtain the historical average number of encryption times of the credential data corresponding to the data type identifier; Obtaining the target data segment quantity to obtain a target quantity; Calculate the product of the historical average number of encryption times and a second set threshold to obtain a first product; Calculate the difference between the preset maximum number of encryption times and the average number of encryption times as the first difference; Calculating the product of the first difference and the second set threshold to obtain a second product; Calculating a difference between the target quantity and the second product to obtain a second difference; Randomly generate a pseudo-random number within a numerical range between the first product and the second difference based on a random function; Calculating the product of the pseudo-random number and the risk probability value and performing an integer operation to obtain the number of encryption times for each data segment; Perform encryption processing based on the number of encryption times of each target data segment to obtain the first data; The calculation formula for the number of encryption times is: ; in, For the The number of encryptions of a target data segment; is the historical average number of encryption times; Setting a threshold for the second; is the number of target data segments; is the maximum number of encryption times; For the The risk probability value of each target data segment; is a random function.

2. The electronic credential storage method for digital services according to claim 1, characterized in that , performing encryption processing based on the number of encryption times of each data segment to obtain the first data, including: Calculate the average number of encryption times of multiple target data segments to obtain an average encryption number; Determine a maximum encryption number and a minimum encryption number from multiple encryption numbers; Calculate the difference between the maximum number of encryption times and the average number of encryption times to obtain a third difference; Calculating a difference between the average encryption number and the minimum encryption number to obtain a fourth difference; Calculate the sum of the third difference and the fourth difference to obtain a characteristic value of the number of encryption times; Based on the encryption times and the characteristic value corresponding to each target data segment, encryption processing is performed to obtain multiple encrypted data segments; The first data is obtained by combining multiple encrypted data segments.

3. The electronic credential storage method for digital services according to claim 2, characterized in that , generating and storing encrypted credential data based on the first data and the second data, including: Dividing the second data into a plurality of data segments to obtain a plurality of processed data segments, wherein the number of the processed data segments is exactly the same as the number of the target data segments; Inserting a plurality of processed data segments after each encrypted data segment, respectively, thereby obtaining the encrypted credential data; A storage location is determined based on the data type identifier corresponding to the encrypted credential data, and the data is stored.

4. The electronic credential storage method for digital services according to claim 1, characterized in that , the resistance coefficient calculation formula is: ; in, is the resistance coefficient, To protect the quantity of resources, The number of attack resources.

5. An electronic certificate storage terminal for digital services, characterized in that: include: A first acquisition unit, configured to acquire target credential data of a digital service, wherein the target credential data carries a data type identifier; A first determining unit, configured to determine the attack level and attack resistance failure rate of the target credential data based on the data type identifier; A first division unit, configured to divide the target credential data into a plurality of data segments to obtain a plurality of target data segments; A first obtaining unit is used to calculate a regularity based on the data in each target data segment to obtain a plurality of target regularities, wherein the target regularities are used to characterize the degree of data repetition in the data segment; A second obtaining unit is used to calculate the security risk probability of each target data segment based on the attack level, the attack resistance failure rate and the target regularity to obtain a plurality of risk probability values; an encryption unit, used to determine the number of encryption times of each target data segment based on the risk probability value, and perform encryption processing accordingly to obtain first data; A third obtaining unit is used to perform binarization processing on the target voucher data to obtain second data; a storage unit, configured to generate and store encrypted credential data based on the first data and the second data; Wherein, the second obtaining unit comprises: A third acquisition unit is used to acquire the number of protection resources invested and the number of attack resources suffered corresponding to the data type identifier in a historical time period; The second calculation unit is used to calculate the ratio of the number of protection resources to the number of attack resources to obtain a resistance coefficient; The fourth obtaining unit is used to multiply the attack level, the failure rate of resisting the attack and the target regularity by the preset weight coefficient respectively, and sum the product results to obtain the first result; A third calculation unit is used to calculate the product of the first result and the resistance coefficient to obtain a risk probability value; Wherein, the encryption unit comprises: A fourth acquisition unit, used to acquire a historical average number of encryption times of the credential data corresponding to the data type identifier; A fifth acquiring unit, configured to acquire the target data segment quantity to obtain a target quantity; a fourth calculation unit, configured to calculate a product of the historical average number of encryption times and a second set threshold value to obtain a first product; a fifth calculation unit, configured to calculate a difference between a preset maximum number of encryption times and the average number of encryption times as a first difference; a sixth calculation unit, configured to calculate a product of the first difference and the second set threshold value to obtain a second product; a seventh calculation unit, configured to calculate a difference between the target quantity and the second product to obtain a second difference; a generating unit, configured to randomly generate a pseudo-random number within a numerical range between the first product and the second difference based on a random function; an eighth calculation unit, configured to calculate the product of the pseudo-random number and the risk probability value and perform an integer operation to obtain the number of encryption times of each data segment; A first processing unit, configured to perform encryption processing based on the number of encryption times of each target data segment to obtain the first data; The calculation formula for the number of encryption times is: ; in, For the The number of encryptions of a target data segment; is the historical average number of encryption times; Setting a threshold for the second; is the number of target data segments; is the maximum number of encryption times; For the The risk probability value of each target data segment; is a random function.

6. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for storing electronic credentials for digital services as claimed in any one of claims 1 to 4.