CN-121598435-B - Benefit delivery-oriented short-link suffix high-strength random generation method and system
Abstract
The invention provides a method and a system for high-strength random generation of a short link suffix facing benefit delivery, which relate to the technical field of intersection of data processing and benefit delivery, and the method comprises the steps of obtaining a true random number sequence through a hardware physical entropy source, and generating a random character string as a short link suffix according to a mapping rule of the true random number sequence and a preset character set; the method comprises the steps of carrying out hash calculation on short link suffixes to obtain corresponding first hash values, converting the first hash values into integer values, obtaining a currently available database fragment identification set based on a preset fragment configuration strategy, and further respectively calculating corresponding combined weight values based on the integer values and each database fragment identification in the database fragment identification set. The invention can solve the security defect of pseudo-random generation of the short link suffix software, realize storage load balance and intelligent resource distribution, and ensure the real-time property of rights and benefits verification.
Inventors
- Dou Yuandian
- CHEN YONG
- LIU LIQIANG
- LAI JIANZHANG
- CHEN MINXING
Assignees
- 上海荣数信息技术有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260127
Claims (8)
- 1. A method for high-strength random generation of short-link suffix for rights delivery, the method comprising: Acquiring a true random number sequence through a hardware physical entropy source, and generating a random character string as a short link suffix according to a mapping rule of the true random number sequence and a preset character set; carrying out hash calculation on the short link suffix to obtain a corresponding first hash value; Converting the first hash value to an integer value; Acquiring a currently available database fragmentation identification set based on a preset fragmentation configuration strategy, and further respectively calculating corresponding combined weight values based on integer values and each database fragmentation identification in the database fragmentation identification set, wherein the method comprises periodically acquiring performance index data from monitoring agents deployed in each database fragmentation; the performance index data comprises real-time response delay, CPU load rate and memory use rate, the acquired performance index data is cleaned and normalized to obtain standardized index vectors, the standardized index vectors are input into a pre-trained health degree prediction model, the health degree score corresponding to each database fragment is obtained through calculation, database fragments with the health degree score higher than a preset health degree threshold value are screened out according to the preset health degree threshold value, the identifications of the database fragments are added into a candidate fragment set, the integer value is obtained as calculation input, each database fragment identification in the candidate fragment set is traversed, the calculation process of combining weights is executed for the target fragment identification traversed at present, namely the integer value used as calculation input is spliced with the target fragment identification to form a combined input character string, the preset weight hash calculation is executed for the combined input character string to generate an intermediate hash result, the intermediate hash result is converted into a numerical value to serve as a combined weight value corresponding to the target fragment identification, and the combined hash value corresponding to all the fragment identifications in the candidate fragment set is obtained through calculation, and the combined hash value corresponding to the target fragment identification in the candidate fragment set is output; comparing all the calculated combined weight values, and determining the database fragment identifier corresponding to the maximum value and the associated data table fragment identifier as a storage position identifier of the short link suffix; According to the storage position identification, a mapping relation between the short link suffix and the corresponding rights and interests information is established in the distributed database and stored; And synchronously storing the short link suffix and the established mapping relation between the short link suffix and the corresponding rights information into a multi-level cache architecture so as to support efficient inquiry and access during rights verification.
- 2. The method for high-strength random generation of short-link suffix for benefit delivery according to claim 1, wherein the method for high-strength random generation of short-link suffix for benefit delivery comprises obtaining a true random number sequence by a hardware physical entropy source, and generating a random character string as a short-link suffix according to a mapping rule of the true random number sequence and a preset character set, and comprises the following steps: collecting an original random signal from a hardware physical entropy source; Entropy estimation and mixing are carried out on the original random signals, and mixed random data are obtained; post-processing the mixed random data to generate a true random number sequence meeting the cryptographic security intensity; converting the true random number sequence into corresponding integer values; Performing modular operation on the integer numerical value according to the total number of the preset character sets to obtain a target character index, and selecting corresponding characters from the preset character sets according to the target character index; Adding the selected corresponding character into the temporary character sequence; Judging whether the length of the temporary character sequence reaches a preset length, if not, continuously acquiring the next group of original random signals from a hardware physical entropy source, sequentially performing operations of entropy estimation and mixing, post-processing, conversion into integer values, modular operation and character selection on the next group of original random signals, adding the obtained new characters into the temporary character sequence until the length of the temporary character sequence reaches the preset length, and if so, outputting the temporary character sequence as a final short link suffix.
- 3. The method for high-strength random generation of short-link postfix for benefit delivery according to claim 2, wherein the hash calculation is performed on the short-link postfix to obtain a corresponding first hash value, and the method comprises the following steps: Receiving a final short link suffix as input data of hash calculation; encoding the input data into a unified byte sequence format; Selecting a preset secure hash algorithm, and executing one-way hash calculation on the byte sequence; Obtaining an original hash value output by one-way hash calculation; and converting the obtained original hash value into a hexadecimal character string with a fixed length as a first hash value.
- 4. The method for high strength random generation of short link postfix for benefit-oriented delivery of claim 3 wherein converting the first hash value to an integer value comprises: Receiving a first hash value as an input string; dividing an input character string into a plurality of equal-length substrings, and converting each equal-length substring into a corresponding integer component; combining the plurality of integer components into one coordinate point in the multidimensional space; Mapping the coordinate points to a space filling curve based on a preset geometric mapping function, and acquiring curve parameters of the coordinate points on the space filling curve; the curve parameters are converted into an integer value as said integer value.
- 5. The method for randomly generating the short link suffix high strength for benefit-oriented delivery according to claim 4, wherein comparing all the calculated combined weight values, and determining the database fragment identifier corresponding to the maximum value and the associated data table fragment identifier as the storage location identifier of the short link suffix, comprising: receiving the output complete combined weight value set; traversing the combination weight value set, and sequentially comparing the sizes of the combination weight values; determining and recording a combined weight value with the largest numerical value as a target weight value; reversely checking and acquiring a corresponding target database fragment identifier in the combined weight value set according to the target weight value; Inquiring a data table fragment identifier associated with the target database fragment identifier based on a preset fragment identifier mapping relation; and jointly combining the target database fragment identifier and the data table fragment identifier to generate and output the storage position identifier of the short link suffix.
- 6. The method for high-strength random generation of short-link suffix for benefit-oriented delivery according to claim 5, wherein the method for establishing and storing a mapping relationship between short-link suffix and corresponding benefit information in a distributed database according to a storage location identifier comprises: positioning a corresponding target database table according to the target database fragment identifier and the data table fragment identifier contained in the storage position identifier; Inquiring a real-time health score obtained by calculating a target database fragment identifier by using a pre-trained health prediction model; Inputting the real-time health score into a preset data persistence optimization model, and determining a storage strategy parameter for the current writing operation by the preset data persistence optimization model; carrying out structured encapsulation on the short link suffix and the corresponding rights and interests information to generate a mapping record to be stored; Writing the mapping record to be stored into a target database table according to the storage strategy parameters, and acquiring a successful confirmation of writing returned by the database; based on the write-in successful confirmation and storage strategy parameters, corresponding index items are established for the mapping records in a target database table so as to support quick query based on short link suffixes.
- 7. The method for high-strength random generation of short link suffix for benefit delivery according to claim 6, wherein the step of synchronously storing the short link suffix and the mapping relationship between the established short link suffix and the corresponding benefit information in a multi-level cache architecture to support efficient query and access in the process of benefit verification comprises the steps of: acquiring a mapping relation between the established short link suffix and the corresponding rights and interests information; based on the obtained mapping relation, constructing a cache key value pair taking a short link suffix as a key and structured rights and interests information as a value; writing the constructed cache key value pair into a local application cache, and setting a first-stage life cycle; triggering an asynchronous synchronous task after the local application cache is successfully written, pushing the cache key value pair to a distributed cache cluster for storage, and setting a second-level life cycle; Receiving a storage confirmation response returned by the distributed cache cluster; and updating the state of the short link suffix in the cache metadata to be a ready state according to the storage confirmation response so as to indicate that the corresponding rights mapping relation can be used for verifying and inquiring.
- 8. A benefit delivery oriented short link suffix high strength random generation system implementing the method of any of claims 1 to 7, comprising: The sequence acquisition and suffix generation module is used for acquiring a true random number sequence through a hardware physical entropy source and generating a random character string as a short link suffix according to the mapping rule of the true random number sequence and a preset character set; The hash value calculation and integer value conversion module is used for carrying out hash calculation on the short link suffix to obtain a corresponding first hash value; the weight value operation module is used for acquiring a currently available database fragment identification set according to a preset fragment configuration strategy, and further respectively calculating corresponding combined weight values based on integer values and each database fragment identification in the database fragment identification set; The weight value comparison and position identification determination module is used for comparing all the calculated combined weight values, and determining the database fragment identification corresponding to the maximum value and the associated data table fragment identification as the storage position identification of the short link suffix; the mapping relation establishing module is used for establishing and storing the mapping relation between the short link suffix and the corresponding rights and interests information in the distributed database according to the storage position identification; and the synchronous storage module is used for synchronously storing the short link suffix and the established mapping relation between the short link suffix and the corresponding rights information into a multi-level cache architecture so as to support efficient inquiry and access during rights verification.
Description
Benefit delivery-oriented short-link suffix high-strength random generation method and system Technical Field The invention relates to the technical field of data processing and rights delivery intersection, in particular to a short-link suffix high-strength random generation method and system for rights delivery. Background With the popularization of mobile internet and the penetration of digital transformation, digital rights and interests are widely applied to various fields such as e-commerce, finance, life service and the like by virtue of the convenient acquisition and use characteristics of the mobile internet. The short link gradually becomes a core carrier for digital rights delivery due to the advantages of easy propagation and easy storage, and the user experience and the rights delivery efficiency are effectively improved by simplifying the rights access path. However, existing short link technologies for rights delivery generally suffer from the technical disadvantage that the short link suffix generation mechanism is not secure enough. For example, the current mainstream scheme generates a short link suffix by a multi-dependence software pseudo-random algorithm, and a random sequence generated by the algorithm has the problems of low security entropy and strong regularity, so that an attacker can easily predict the short link suffix by brute force cracking or pattern recognition means, thereby acquiring associated rights and interests information. The defects can cause the following association consequences that rights and interests are at risk of being illegally stolen due to predictability of short link suffixes, an attacker can unauthorized get or use rights and interests after cracking the short links, direct economic losses are caused for rights and interests issuers and legal users, and part of schemes are used for reducing cracking risks, excessively simple storage architecture designs are adopted, query characteristics of the short links are not optimized, mapping query response delay of the short links and rights and interests information is increased, real-time performance of rights and interests verification scenes is seriously influenced, and rights and interests use experience of users is reduced. Disclosure of Invention The invention aims to solve the technical problem of providing a short-link suffix high-strength random generation method and a short-link suffix high-strength random generation system for rights delivery, which can solve the security defect of pseudo-random generation of short-link suffix software, realize storage load balance and resource intelligent allocation and ensure real-time rights verification and marketing. In order to solve the technical problems, the technical scheme of the invention is as follows: in a first aspect, a method for high-strength random generation of a short-link suffix for benefit delivery, the method comprising: step 1, acquiring a true random number sequence through a hardware physical entropy source, and generating a random character string as a short link suffix according to a mapping rule of the true random number sequence and a preset character set; Step 2, carrying out hash calculation on the short link suffix to obtain a corresponding first hash value; step 3, converting the first hash value into an integer value; Step 4, based on a preset partitioning configuration strategy, acquiring a currently available database partitioning identification set, and further respectively calculating corresponding combined weight values based on integer values and each database partitioning identification in the database partitioning identification set; step 5, comparing all the calculated combined weight values, and determining the database fragmentation identifications corresponding to the maximum value and the associated data table fragmentation identifications as storage position identifications of the short link suffixes; Step 6, according to the storage position identification, a mapping relation between the short link suffix and the corresponding rights and interests information is established in the distributed database and stored; And 7, synchronously storing the short link suffix and the established mapping relation between the short link suffix and the corresponding rights information into a multi-level cache architecture so as to support efficient inquiry and access during rights verification. In a second aspect, a benefit delivery oriented short link suffix high strength random generation system includes: The sequence acquisition and suffix generation module is used for acquiring a true random number sequence through a hardware physical entropy source and generating a random character string as a short link suffix according to the mapping rule of the true random number sequence and a preset character set; The hash value calculation and integer value conversion module is used for carrying out hash calculation on the short link suffi