Method and device for realizing unique mark of distributed system
Through sliding window algorithm and concurrent prediction model, the historical business data of the distributed system is analyzed, and the business time encoding, mark encoding and sequence encoding are generated, which solves the resource occupation problem caused by the long number of unique identification bits in the prior art, and achieves more efficient and flexible unique identification management.
Patent Information
- Application Number
- CN202510437360.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-04-09
AI Technical Summary
The unique identifiers (such as snowflake algorithm and UUID) in existing distributed systems are too long, which occupies more resources during storage and transmission, affects system performance, and is difficult to effectively manage in high concurrency scenarios.
Through the sliding window algorithm, a concurrent prediction model is constructed, and the real-time business concurrency is predicted, and a distributed system unique mark is generated based on business time coding, business mark coding and business sequence coding.
It improves the efficiency and flexibility of unique tags in distributed systems, reduces the overhead of storage and transmission, and avoids ID conflicts in high concurrency scenarios.
Smart Images

Figure CN119961358A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method and device for implementing unique identification of a distributed system. Background Art
[0002] Currently, the mainstream distributed system unique identification is achieved through the snowflake algorithm or the ID generated by the UUID. The snowflake algorithm generates a 64-bit integer of the Long type, while the UUID generates a 128-bit String type. These two technologies have been widely used in software development projects and are quite mature. However, they also have certain limitations.
[0003] In some business scenarios, such a long number of digits may not be needed to represent a unique identifier. Although the IDs generated by the snowflake algorithm and UUID are unique, too long a number of digits will take up more resources during storage and transmission, which may become a disadvantage for some distributed systems with high performance requirements. In addition, as the business develops and the amount of data increases, how to manage these unique identifiers more effectively has also become a problem that needs to be solved.
[0004] In order to solve these problems, a more flexible and efficient data unique identification implementation method is urgently needed to meet the needs of different business scenarios. Summary of the invention
[0005] In response to the problems in the prior art, the present application provides a method and device for implementing unique marking of a distributed system, which can improve the efficiency and flexibility of using unique marking of a distributed system.
[0006] In order to solve at least one of the above problems, the present application provides the following technical solutions: In a first aspect, the present application provides a method for implementing a unique mark in a distributed system, comprising: Collect historical business data, perform feature extraction operations on the historical business data within a preset time step according to a sliding window algorithm, determine corresponding time features and concurrency features, perform feature matrix and target variable construction operations according to the time features and the concurrency features, determine corresponding historical business features, input the historical business features into a preset time series model for model training, determine a corresponding concurrency prediction model, predict the preset business properties according to the concurrency prediction model, and determine the corresponding real-time business concurrency, wherein the historical business data includes a timestamp, business type, and concurrency; Performing a time analysis operation on the service nature to determine a corresponding service time span and service time granularity, performing a time code generation operation according to the service time span and the service time granularity to determine a corresponding service time code, performing a type and quantity analysis operation on the service nature, performing service numbering according to the number of service types obtained after the type and quantity analysis operation to determine a corresponding service tag code, and determining a corresponding service sequence code according to the concurrent volume of real-time services and a preset global auto-increment algorithm, wherein the service time code includes a time series or a timestamp; A string concatenation operation is performed according to the service time code, the service tag code and the service sequence code to determine a corresponding distributed system unique tag.
[0007] Furthermore, before performing a feature extraction operation on the historical business data within a preset time step according to a sliding window algorithm to determine corresponding time features and concurrency features, the method includes: Performing a time granularity unification operation on the timestamps in the historical business data to determine corresponding time data of the same magnitude, and performing a normalization operation on the concurrency in the historical business data to determine corresponding unified concurrency data; The historical business data is standardized according to the same magnitude time data and the unified concurrent volume data to determine corresponding standardized historical business data.
[0008] Furthermore, performing a feature extraction operation on the historical business data within a preset time step according to a sliding window algorithm to determine corresponding time features and concurrency features includes: Classify and count the concurrent traffic in the historical service data according to the preset service types, and respectively determine the service concurrent traffic data corresponding to the service types; A feature extraction operation is performed on the business concurrency data within a preset time step according to a sliding window algorithm to determine corresponding time features and concurrency features.
[0009] Further, performing a time code generation operation according to the service time span and the service time granularity to determine a corresponding service time code includes: Performing a time series generation operation according to the business time span and the business time granularity to determine a corresponding time series, and performing a timestamp conversion operation according to the time series to determine a corresponding timestamp; A coding judgment operation is performed according to the time sequence and the timestamp to determine the corresponding service time code.
[0010] Further, the performing a coding judgment operation according to the time sequence and the timestamp to determine the corresponding service time code includes: Determining whether the number of occupied bits of the time series is shorter than the number of occupied bits of the time code; If it is short, the corresponding service time code is determined according to the time series; if it is long, the corresponding service time code is determined according to the timestamp.
[0011] Furthermore, the determining of the corresponding service sequence code according to the concurrent real-time service volume and a preset global auto-increment algorithm includes: Determine the corresponding globally unique serial number according to the preset global auto-increment algorithm; A modulo evaluation operation is performed on the concurrent real-time service volume according to the globally unique sequence number to determine a corresponding service sequence code.
[0012] Further, performing a string concatenation operation according to the service time code, the service tag code, and the service sequence code to determine a corresponding distributed system unique tag includes: Perform a string concatenation operation according to the service time code, the service mark code, and the service sequence code to determine a corresponding digital string; A corresponding distributed system unique mark is determined according to the length of the character string, wherein the distributed system unique mark is an integer or a long integer.
[0013] In a second aspect, the present application provides a device for implementing a unique mark in a distributed system, including: A concurrent prediction model construction module is used to perform feature extraction operations on the historical business data within a preset time step according to a sliding window algorithm, determine corresponding time features and concurrent volume features, perform feature matrix and target variable construction operations according to the time features and the concurrent volume features, determine corresponding historical business features, input the historical business features into a preset time series model for model training, determine the corresponding concurrent prediction model, predict the preset business properties according to the concurrent prediction model, and determine the corresponding real-time business concurrent volume, wherein the historical business data includes a timestamp, a business type, and a concurrent volume; A service code determination module is used to perform a time analysis operation on the service nature to determine the corresponding service time span and service time granularity, perform a time code generation operation according to the service time span and the service time granularity to determine the corresponding service time code, perform a type and quantity analysis operation on the service nature, perform service numbering according to the number of service types obtained after the type and quantity analysis operation to determine the corresponding service tag code, and determine the corresponding service sequence code according to the real-time service concurrency and a preset global auto-increment algorithm, wherein the service time code includes a time series or a timestamp; The unique tag generation module is used to perform a string concatenation operation according to the business time code, the business tag code and the business sequence code to determine the corresponding distributed system unique tag.
[0014] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for implementing the unique identification of a distributed system when executing the program.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for implementing the unique identification of a distributed system.
[0016] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method for implementing the unique identification of a distributed system.
[0017] It can be seen from the above technical scheme that the present application provides a method and device for implementing a unique mark of a distributed system, by performing feature extraction operations on historical business data within a preset time step according to a sliding window algorithm to obtain historical business features, inputting the historical business features into a preset time series model for model training to obtain a concurrency prediction model, predicting the nature of the business according to the concurrency prediction model, obtaining the real-time business concurrency, analyzing the time span of the business nature and the business time granularity to generate a business time code, analyzing the number of types of the business nature to generate a business tag code, obtaining a business sequence code according to the real-time business concurrency and a preset global auto-increment algorithm, performing a string concatenation operation according to the business time code, the business tag code and the business sequence code, and determining the unique mark of the distributed system, thereby improving the efficiency and flexibility of using the unique mark of the distributed system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 This is one of the flowcharts of the method for implementing the unique marking of the distributed system in the embodiment of the present application; Figure 2 The second flowchart of the method for implementing the unique marking of the distributed system in the embodiment of the present application; Figure 3The third flowchart of the method for implementing the unique marking of the distributed system in the embodiment of the present application; Figure 4 This is a fourth flow chart of a method for implementing a unique label in a distributed system in an embodiment of the present application; Figure 5 This is a flowchart of a method for implementing a unique label in a distributed system in an embodiment of the present application; Figure 6 This is a flowchart of a method for implementing a unique label in a distributed system in an embodiment of the present application; Figure 7 FIG7 is a flowchart of a method for implementing a unique label in a distributed system in an embodiment of the present application; Figure 8 A structural diagram of a device for implementing a unique mark for a distributed system in an embodiment of the present application; Fig. 9 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.
[0020] Reference numerals: Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0023] Considering the problem that the current mainstream distributed system unique tag will occupy more resources during storage and transmission due to the long number of bits, affecting the performance of the distributed system. The present application provides a method and device for implementing the unique tag of a distributed system, by performing feature extraction operations on historical business data within a preset time step according to a sliding window algorithm, obtaining historical business features, inputting the historical business features into a preset time series model for model training, obtaining a concurrency prediction model, predicting the nature of the business according to the concurrency prediction model, obtaining the real-time business concurrency, analyzing the time span of the business nature and the business time granularity to generate the business time code, analyzing the number of types of the business nature to generate the business tag code, obtaining the business sequence code according to the real-time business concurrency and the preset global auto-increment algorithm, performing string concatenation operations according to the business time code, the business tag code and the business sequence code, and determining the unique tag of the distributed system, thereby improving the efficiency and flexibility of the use of the unique tag of the distributed system.
[0024] In order to improve the efficiency and flexibility of using unique tags in distributed systems, the present application provides an embodiment of a method for implementing unique tags in distributed systems. Figure 1 The implementation method of the distributed system unique mark specifically includes the following contents: Step S101: collect historical business data, perform feature extraction operations on the historical business data within a preset time step according to a sliding window algorithm, determine corresponding time features and concurrency features, perform feature matrix and target variable construction operations according to the time features and the concurrency features, determine corresponding historical business features, input the historical business features into a preset time series model for model training, determine a corresponding concurrency prediction model, predict the preset business properties according to the concurrency prediction model, and determine the corresponding real-time business concurrency, wherein the historical business data includes a timestamp, business type, and concurrency; Optionally, in this embodiment, the current mainstream distributed system unique mark is implemented by an ID (unique mark) generated by a snowflake algorithm or UUID, but the ID generated by the UUID is a 128-bit string, while the snowflake algorithm generates a 64-bit long integer. In some business scenarios, these IDs may be too long and take up too many distributed system resources. This implementation method predicts the number of concurrent services in real time through a concurrent prediction model, dynamically adjusts the serial number generation rules of the Redis auto-increment sequence, and combines time coding, business tag coding, and auto-increment sequence coding to generate a unique mark.
[0025] Optionally, in this embodiment, the preceding element defines: Time series: normal string format of time value, such as: "2024-09-30 11:15:00"; Timestamp: The integer corresponding to the time series, divided into hours, seconds and milliseconds; Redis auto-increment sequence: a global persistent auto-increment sequence based on Redis, which is convenient for use in distributed systems; Business tag field: an integer field used to mark the type of each business in the system; Concurrency prediction model: A machine learning model based on historical concurrency data to predict future concurrency.
[0026] Optionally, in this embodiment, this step is a concurrent prediction model training and real-time concurrent volume prediction process.
[0027] Specifically, the model training process begins with data preprocessing, where historical business data from the past six months is collected from the system, including timestamps, business types, and concurrency information, to ensure that the model can capture seasonality, trends, and other characteristics. Timestamp: The time of each request (accurate to seconds or milliseconds).
[0028] Business Type: Mark different business types (such as order, payment, log, etc.).
[0029] Concurrency: records the number of concurrent requests at each time point.
[0030] Next, convert the timestamp to Unix timestamp so that the model can process time data. If the data granularity is inconsistent (some data is in seconds, some is in milliseconds), unify it to the same granularity. Normalize the concurrency and scale it to a fixed range (such as between 0 and 1) so that the model can learn better. If there are missing values in the data, use linear interpolation or filling method to handle them.
[0031] Secondly, in the feature extraction stage, the business data is classified by type, all business types are one-hot encoded (One-Hot Encoding), the concurrency of each business type is classified and counted separately, and the concurrency data of each business type is obtained separately.
[0032] Extract useful time features from the timestamp of business data. For example: hour: hour of the day (0-23); Day of week: day of the week (0-6); Month: Month of the year (1-12); Is it a holiday: Mark whether it is a holiday.
[0033] Then, based on the sliding window technology, the concurrency of the same business type in the past period of time (such as the past 1 hour, the past 24 hours) is extracted as a feature, and the corresponding feature matrix is constructed.
[0034] The following is an example of simple concurrent data, assuming the following historical concurrent data: Use the data from the past 5 minutes as the time step to predict the concurrency in the next minute, and use the sliding window technology to build the feature matrix.
[0035] Sliding window example: Window size: 5 minutes (time step); Sliding step length: 1 minute; Prediction target: concurrent volume in the next minute.
[0036] First window (timestamps 00:00 - 00:04), feature matrix: [ [00:00, 10, 0, 0], # Timestamp 00:00, concurrency 10, hour 0, minute 0 [00:01, 15, 0, 1], # Timestamp 00:01, concurrency 15, hour 0, minute 1 [00:02, 20, 0, 2], # Timestamp 00:02, concurrency 20, hours 0, minutes 2 [00:03, 25, 0, 3], # Timestamp 00:03, concurrency 25, hours 0, minutes 3 [00:04, 30, 0, 4] # Timestamp 00:04, concurrency 30, hours 0, minutes 4 ] Target variable: 35 (concurrency at timestamp 00:05).
[0037] Second window (timestamps 00:01 - 00:05), feature matrix: [ [00:01, 15, 0, 1], # Timestamp 00:01, concurrency 15, hour 0, minute 1 [00:02, 20, 0, 2], # Timestamp 00:02, concurrency 20, hours 0, minutes 2 [00:03, 25, 0, 3], # Timestamp 00:03, concurrency 25, hours 0, minutes 3 [00:04, 30, 0, 4], # Timestamp 00:04, concurrency 30, hours 0, minutes 4 [00:05, 35, 0, 5] # Timestamp 00:05, concurrency 35, hour 0, minute 5 ] Target variable: 40 (concurrency at timestamp 00:06) The third window (timestamps 00:02 - 00:06), feature matrix: [ [00:02, 20, 0, 2], # Timestamp 00:02, concurrency 20, hours 0, minutes 2 [00:03, 25, 0, 3], # Timestamp 00:03, concurrency 25, hours 0, minutes 3 [00:04, 30, 0, 4], # Timestamp 00:04, concurrency 30, hours 0, minutes 4 [00:05, 35, 0, 5], # Timestamp 00:05, concurrency 35, hours 0, minutes 5 [00:06, 40, 0, 6] # Timestamp 00:06, concurrency 40, hours 0, minutes 6 ] Target variable: 45 (concurrency at timestamp 00:07) It can be understood that the above is a simple process of constructing a concurrent data set based on the sliding window technology. In actual operations, different business scenarios are taken into consideration and the construction of the data set can be adjusted based on the R&D personnel's understanding of the business scenarios. In this embodiment, the time series data is converted into a feature matrix and target variables through the sliding window technology to construct a data set suitable for model training, which can be applied to various concurrent volume prediction tasks.
[0038] Finally, in the model training phase, a long short-term memory network is selected to capture long-term dependencies in time series. The constructed data set is input into the initial long short-term memory network model, including multiple LSTM layers and fully connected layers. The mean square error (MSE) is used as the loss function, and Adam is used as the optimizer for training. The performance of the model is evaluated using the validation set to ensure that the model is not overfitted. The trained concurrent prediction model is obtained, the model is integrated into the distributed system, and the model is called regularly for concurrent volume prediction.
[0039] Through the above steps, the concurrency prediction model can accurately predict the future concurrency volume, thereby dynamically adjusting the sequence number generation strategy, improving the flexibility of the system, and effectively avoiding sequence number conflicts in high-concurrency scenarios and optimizing resource usage.
[0040] Step S102: performing a time analysis operation on the service nature to determine a corresponding service time span and service time granularity, performing a time code generation operation according to the service time span and the service time granularity to determine a corresponding service time code, performing a type quantity analysis operation on the service nature, performing service numbering according to the number of service types obtained after the type quantity analysis operation to determine a corresponding service tag code, and determining a corresponding service sequence code according to the concurrent volume of the real-time service and a preset global auto-increment algorithm, wherein the service time code includes a time series or a timestamp; Optionally, in this embodiment, this step is a method for determining a uniquely labeled component structure.
[0041] Specifically, in this solution, the unique identifier of the distributed system consists of a time code, a service identifier code, and a service sequence code. The following is an explanation of the meaning of the three components: Time code: time series / timestamp, indicating the time when the ID was generated. It can be a timestamp or time series at the hour, second, or millisecond level.
[0042] Business identification code: used to distinguish different business types, such as orders, users, etc.
[0043] Business sequence coding: used to ensure that the generated ID is unique under the same timestamp and business tag.
[0044] In this way, the generated ID not only ensures uniqueness, but also allows the length and format to be flexibly adjusted according to business needs.
[0045] The following is a generation scheme for the three components: First, analyze the nature of the business to obtain the time span, time granularity, and concurrency.
[0046] The time span refers to the duration from the start time point to the end time point.
[0047] Time granularity, also known as time resolution, refers to the size of the time interval used when processing time-related data. For example, if statistics are collected by year, year is a time granularity; if statistics are collected by quarter, quarter is a time granularity; if statistics are collected by month, day, or hour, month, day, and hour are also different time granularities. Time granularity reflects the degree of subdivision of time, and different time granularities are suitable for different analysis scenarios and needs.
[0048] Concurrency, also called concurrency, refers to the number of requests sent to the server simultaneously per unit time.
[0049] Example 1: The running time is until the year 2099, at the hourly level, and the number of concurrent requests per hour does not exceed 30.
[0050] Example 2: The running time is until 2099, at the second level, and the number of concurrent messages per second does not exceed 10.
[0051] Based on the above analysis of the nature of the business, optional time code generation: Generate time code through time span and time granularity, taking Example 2 as an example: Time span: 2099 years; time granularity: seconds.
[0052] In time series, it is "20991231235959"; the timestamp corresponding to this time series is 4102331039. At this time, the number of bits occupied by the timestamp is short, so the timestamp in seconds is used.
[0053] It is understandable that shorter IDs can reduce storage and transmission overhead.
[0054] Optional, business tag encoding generation: Consider the types of services covered by this system, such as 10 or less, 100 or less, 1000 or less, etc. Taking 10 or less as an example, a single digit (0-9) can be used as a placeholder.
[0055] Optional, business sequence code generation: Determine the data serial number based on the predicted concurrency. The serial number here refers to the order under concurrency. Here, we take the real-time concurrent data of 5 per second as an example, and use the global self-incrementing redis sequence to find the modulus of 5 (global is to cope with the data consistency of the distributed system).
[0056] For example: Example 1: Assume that the concurrency is 5 per second, that is, at most 5 orders are generated per second. Use Redis's auto-increment sequence to generate a globally unique serial number. For example, the serial number generated by Redis is 11, then take the modulus of 5 and get 1, and its business sequence code is 1. This ensures that the serial numbers of the 5 orders generated within one second are unique. When the concurrency per second increases or decreases, the modulus of the increased or decreased value is taken to ensure that the sequence code is correct.
[0057] Example 2: Assume that there is a large social platform that needs to generate 1,000 message IDs per second. Through Redis's global auto-increment sequence, the system can generate a unique sequence number (such as 1 to 1,000) for each of the 1,000 messages within 1 second, and take the modulo 1,000 (0-999), ensuring that the 1,000 IDs generated per second are unique. Even if the system is deployed on multiple distributed nodes, Redis's global auto-increment sequence can ensure the uniqueness of the ID.
[0058] Through Redis's auto-increment sequence, this solution can ensure the uniqueness of IDs in a distributed system and avoid ID conflicts even in high-concurrency scenarios.
[0059] Taking the above situation as an example, assuming that the time code is determined to be timestamp 4102331039, the business tag code is determined to be 1, and the business sequence code is determined to be 1, then the timestamp, business tag and auto-increment sequence are concatenated together to form a digital string: "410233103911". This string can be converted into a long integer number as the unique ID of the order.
[0060] The ID generated in this way not only ensures uniqueness, but also allows the length and format to be flexibly adjusted according to business needs. For example, if there are more business types, we can increase the number of digits in the business tag; if the time span is longer or the time granularity is finer, we can increase the number of digits in the time code. This method is more flexible than UUID and snowflake algorithms and can better adapt to different business scenarios.
[0061] In addition, based on the introduction of the concurrency prediction model in step S101, in a specific business scenario, the system concurrency is not fixed. After the concurrency model is trained in step S101, the model is installed in a distributed system, and the time series prediction model is called regularly to predict the concurrency in the future. According to the prediction results, the sequence number generation strategy is dynamically adjusted.
[0062] Specifically, on the one hand, the method of using the concurrency prediction result is to take the modulus of the predicted concurrency value by the auto-increment sequence added by the global auto-increment algorithm to obtain a unique ID under the current concurrency at the current timestamp. Even for a distributed system, the global auto-increment algorithm first ensures the uniqueness of the auto-increment sequence within the system. Secondly, by taking the modulus of the evaluation of each distributed concurrency, the uniqueness of the business sequence encoding of each distributed node is also guaranteed.
[0063] On the other hand, for the concurrency prediction results, the step size of the Redis auto-increment sequence can be dynamically adjusted based on the predicted concurrency. For example, if the concurrency is predicted to be high in a certain period of time in the future, the step size can be increased to reduce the probability of sequence number conflicts. If the concurrency is predicted to be low, the step size can be reduced to save resources.
[0064] Step S103: Perform a string concatenation operation according to the service time code, the service tag code and the service sequence code to determine a corresponding distributed system unique tag.
[0065] Optionally, in this embodiment, this step is a uniquely marked combination process.
[0066] Specifically, assuming that the time code is determined to be timestamp 4102331039, the business tag code is determined to be 1, and the business sequence code is determined to be 1, the timestamp, business tag and auto-increment sequence are concatenated together to form a digital string: "410233103911". This string can be converted into a long integer number as the unique ID of the order.
[0067] It is understandable that in terms of resource utilization, the length of IDs generated by traditional UUID and snowflake algorithm is fixed (128 bits for UUID and 64 bits for snowflake algorithm), while this solution can flexibly adjust the length of ID according to business needs. For example, when the business time span is short and the business types are few, a shorter ID can be generated to reduce storage and transmission overhead.
[0068] In terms of ensuring ID uniqueness and consistency, this solution can predict future concurrency values through the concurrency prediction model combined with Redis's auto-increment sequence, ensure that IDs are not repeated based on the concurrency within a fixed time, ensure the uniqueness of IDs in distributed systems, avoid the problem of multiple nodes generating duplicate IDs, and avoid ID conflicts even in high-concurrency scenarios.
[0069] In terms of system management, this solution can generate different ID prefixes for different business types by introducing business tag fields, making it easier for the system to distinguish and manage data of different businesses. At the same time, the timestamp is embedded in the ID, so the time information can be directly extracted according to the ID, making it easier to query data by time range, and also supporting natural sorting of data.
[0070] This solution solves the limitations of traditional UUID and snowflake algorithms in certain business scenarios by flexibly configuring ID length, supporting high concurrency, distinguishing multiple business types, embedding timestamps, ensuring distributed consistency, and efficiently generating IDs. It is not only suitable for small systems, but also can meet the high concurrency and high consistency requirements of large distributed systems.
[0071] This example demonstrates how this embodiment can flexibly adjust the business time coding, business tag coding and business sequence coding of the unique tag according to business needs in combination with the concurrency model and the self-increment algorithm to generate a distributed system unique tag with high flexibility and high utilization efficiency.
[0072] From the above description, it can be seen that the implementation method of the unique mark of the distributed system provided in the embodiment of the present application can obtain historical business features by performing feature extraction operations on historical business data within a preset time step according to a sliding window algorithm, input the historical business features into a preset time series model for model training, and obtain a concurrency prediction model. The business nature is predicted according to the concurrency prediction model to obtain the real-time business concurrency, and the time span and business time granularity of the business nature are analyzed to generate a business time code, and the number of types of business nature is analyzed to generate a business tag code. The business sequence code is obtained according to the real-time business concurrency and a preset global auto-increment algorithm, and a string concatenation operation is performed according to the business time code, the business tag code and the business sequence code to determine the unique mark of the distributed system, thereby improving the efficiency and flexibility of the use of the unique mark of the distributed system.
[0073] In one embodiment of the implementation method of the distributed system unique marking of the present application, see Figure 2 , and can also include the following: Step S201: performing a time granularity unification operation on the timestamps in the historical business data to determine corresponding time data of the same magnitude, and performing a normalization operation on the concurrency in the historical business data to determine corresponding unified concurrency data; Step S202: performing a standardization operation on the historical business data according to the same magnitude time data and the unified concurrent volume data to determine corresponding standardized historical business data.
[0074] Optionally, in this embodiment, the timestamp is converted to a Unix timestamp so that the model can process time data. If the data granularity is inconsistent (some data is in seconds, some is in milliseconds), it is unified to the same granularity. The concurrency is normalized and scaled to a fixed range (such as between 0 and 1) so that the model can learn better. If there are missing values in the data, linear interpolation or filling method is used to process them.
[0075] Through step S202, this embodiment obtains the historical business data after standardization, laying a solid data support foundation for subsequent model training.
[0076] In one embodiment of the implementation method of the distributed system unique marking of the present application, see Figure 3 , and can also include the following: Step S301: classify and count the concurrent traffic in the historical service data according to the preset service type, and respectively determine the service concurrent traffic data corresponding to the service type; Step S302: performing feature extraction operations on the business concurrency data within a preset time step according to a sliding window algorithm to determine corresponding time features and concurrency features.
[0077] Optionally, in this embodiment, this step is performed in the feature extraction stage.
[0078] Specifically, the business data is classified by type, all business types are one-hot encoded (One-Hot Encoding), the concurrency of each business type is classified and counted separately, and the concurrency data of each business type is obtained respectively.
[0079] Extract useful time features from the timestamp of business data. For example: hour: hour of the day (0-23); Day of week: day of the week (0-6); Month: Month of the year (1-12); Is it a holiday: Mark whether it is a holiday.
[0080] Then, based on the sliding window technology, the concurrency of the same business type in the past period of time (such as the past 1 hour, the past 24 hours) is extracted as a feature, and the corresponding feature matrix is constructed.
[0081] The following is an example of simple concurrent data, assuming the following historical concurrent data: Use the data from the past 5 minutes as the time step to predict the concurrency in the next minute, and use the sliding window technology to build the feature matrix.
[0082] Sliding window example: Window size: 5 minutes (time step); Sliding step length: 1 minute; Prediction target: concurrent volume in the next minute.
[0083] First window (timestamps 00:00 - 00:04), feature matrix: [ [00:00, 10, 0, 0], # Timestamp 00:00, concurrency 10, hour 0, minute 0 [00:01, 15, 0, 1], # Timestamp 00:01, concurrency 15, hour 0, minute 1 [00:02, 20, 0, 2], # Timestamp 00:02, concurrency 20, hours 0, minutes 2 [00:03, 25, 0, 3], # Timestamp 00:03, concurrency 25, hours 0, minutes 3 [00:04, 30, 0, 4] # Timestamp 00:04, concurrency 30, hours 0, minutes 4 ] Target variable: 35 (concurrency at timestamp 00:05).
[0084] Second window (timestamps 00:01 - 00:05), feature matrix: [ [00:01, 15, 0, 1], # Timestamp 00:01, concurrency 15, hour 0, minute 1 [00:02, 20, 0, 2], # Timestamp 00:02, concurrency 20, hours 0, minutes 2 [00:03, 25, 0, 3], # Timestamp 00:03, concurrency 25, hours 0, minutes 3 [00:04, 30, 0, 4], # Timestamp 00:04, concurrency 30, hours 0, minutes 4 [00:05, 35, 0, 5] # Timestamp 00:05, concurrency 35, hour 0, minute 5 ] Target variable: 40 (concurrency at timestamp 00:06) The third window (timestamps 00:02 - 00:06), feature matrix: [ [00:02, 20, 0, 2], # Timestamp 00:02, concurrency 20, hours 0, minutes 2 [00:03, 25, 0, 3], # Timestamp 00:03, concurrency 25, hours 0, minutes 3 [00:04, 30, 0, 4], # Timestamp 00:04, concurrency 30, hours 0, minutes 4 [00:05, 35, 0, 5], # Timestamp 00:05, concurrency 35, hours 0, minutes 5 [00:06, 40, 0, 6] # Timestamp 00:06, concurrency 40, hours 0, minutes 6 ] Target variable: 45 (concurrency at timestamp 00:07) It can be understood that the above is a simple process of constructing a concurrent data set based on the sliding window technology. In actual operations, different business scenarios are taken into consideration and the construction of the data set can be adjusted based on the R&D personnel's understanding of the business scenarios. In this embodiment, the time series data is converted into a feature matrix and target variables through the sliding window technology to construct a data set suitable for model training, which can be applied to various concurrent volume prediction tasks.
[0085] Through step S302, this embodiment implements feature extraction based on sliding windows, laying a solid data foundation for the subsequent training of the concurrency model.
[0086] In one embodiment of the implementation method of the distributed system unique marking of the present application, see Figure 4 , and can also include the following: Step S401: performing a time series generation operation according to the business time span and the business time granularity to determine a corresponding time series, and performing a timestamp conversion operation according to the time series to determine a corresponding timestamp; Step S402: Perform a coding judgment operation according to the time sequence and the timestamp to determine the corresponding service time code.
[0087] Optionally, in this embodiment, this step is a time coding generation process.
[0088] Specifically, the time code includes a time series or a timestamp.
[0089] By analyzing the nature of the business, we can get the time span and time granularity of the business. For example, "running time until 2099, second level, no more than 10 concurrent transactions per second." Time span: 2099, time granularity: seconds, and concurrency: 10.
[0090] In time series, it is "20991231235959"; the timestamp corresponding to this time series is 4102331039. At this time, the number of code bits occupied by the time series and the number of code bits occupied by the timestamp are judged, and the one with the shorter code bits is used as the time code, so as to ensure that the coding resources occupied by the time code are small and reduce the storage and transmission overhead.
[0091] Through step S402, this embodiment successfully obtains the time code by comparing the number of coding bits of the time series and the timestamp, laying a foundation for the subsequent generation of a unique mark.
[0092] In one embodiment of the implementation method of the distributed system unique marking of the present application, see Figure 5 , and can also include the following: Step S501: determining whether the number of occupied bits of the time series is shorter than the number of occupied bits of the time code; Step S502: If it is short, determine the corresponding service time code according to the time sequence; if it is long, determine the corresponding service time code according to the timestamp.
[0093] Optionally, in this embodiment, this step is a process of comparing the number of bits of the time series code and the number of bits of the timestamp code.
[0094] If the time series encoding bit ratio is short, use the time series as the time encoding; If the timestamp encoding bit ratio is short, use the timestamp as the time encoding.
[0095] It is understandable that shorter IDs can reduce storage and transmission overhead.
[0096] Through step S502, this embodiment successfully determines the time code, laying a foundation for subsequent generation of a unique mark.
[0097] In one embodiment of the implementation method of the distributed system unique marking of the present application, see Figure 6 , and can also include the following: Step S601: Determine a corresponding globally unique sequence number according to a preset global auto-increment algorithm; Step S602: performing a modulus evaluation operation on the concurrent real-time service volume according to the globally unique sequence number to determine a corresponding service sequence code.
[0098] Optionally, the generation process of the business sequence code in this step is a combination of a global self-increment algorithm and a predicted business concurrency.
[0099] Specifically, the global auto-increment algorithm Redis itself provides an auto-increment atomic command, which can ensure that the generated ID is unique and orderly. At the same time, because it is a global auto-increment, it can also ensure the orderliness and uniqueness of the auto-increment when applied to a distributed system.
[0100] Specifically, the real-time business concurrency is the business concurrency predicted by the concurrency prediction model. The concurrency prediction model can effectively predict the business concurrency in the future period under the current time period, and determine the data sequence number based on the predicted concurrency situation. The sequence number here refers to the order under the concurrency situation.
[0101] For example: Example 1: Assume that the concurrency is 5 per second, that is, at most 5 orders are generated per second. Use Redis's auto-increment sequence to generate a globally unique serial number. For example, the serial number generated by Redis is 11, then take the modulus of 5 and get 1, and its business sequence code is 1. This ensures that the serial numbers of the 5 orders generated within one second are unique. When the concurrency per second increases or decreases, the modulus of the increased or decreased value is taken to ensure that the sequence code is correct.
[0102] Example 2: Assume that there is a large social platform that needs to generate 1,000 message IDs per second. Through Redis's global auto-increment sequence, the system can generate a unique sequence number (such as 1 to 1,000) for each of the 1,000 messages within 1 second, and take the modulo 1,000 (0-999), ensuring that the 1,000 IDs generated per second are unique. Even if the system is deployed on multiple distributed nodes, Redis's global auto-increment sequence can ensure the uniqueness of the ID.
[0103] Through Redis's auto-increment sequence, this solution can ensure the uniqueness of IDs in a distributed system and avoid ID conflicts even in high-concurrency scenarios.
[0104] Through step S602, this embodiment successfully generates business sequence codes based on real-time concurrency and a global auto-increment algorithm, laying the foundation for subsequent unique marking.
[0105] In one embodiment of the implementation method of the distributed system unique marking of the present application, see Figure 7 , and can also include the following: Step S701: performing a string concatenation operation according to the service time code, the service mark code and the service sequence code to determine a corresponding digital string; Step S702: Determine a corresponding distributed system unique tag according to the length of the string, wherein the distributed system unique tag is an integer or a long integer.
[0106] Optionally, the time code, business tag code, and business sequence code generated according to the above steps are concatenated into a digital string such as "410233103911" according to the rules we agreed upon, and then converted into a corresponding integer or long integer according to the length.
[0107] Among them, integer type is used to represent integers within a certain range and occupies relatively less memory space.
[0108] Long integers can represent a larger range of integers than integers and are used to handle larger integers that exceed the representation range of integers. However, they usually take up more memory than integers.
[0109] Through step S702, this embodiment successfully generates a unique tag for the distributed system based on time coding, business tag coding, and business sequence coding. On the one hand, the length of the unique tag can be flexibly adjusted according to business needs, which improves flexibility. On the other hand, the accuracy of the unique tag of the distributed system is guaranteed based on concurrent prediction and global auto-increment. At the same time, by introducing business tag fields and time information, data management is facilitated, which solves the limitations of traditional UUID and snowflake algorithms in certain business scenarios.
[0110] In order to improve the efficiency and flexibility of using the unique mark of the distributed system, the present application provides an embodiment of a distributed system unique mark implementation device for implementing all or part of the content of the distributed system unique mark implementation method, see Figure 8 The implementation device of the distributed system unique mark specifically includes the following contents: The concurrent prediction model building module 10 is used to collect historical business data, perform feature extraction operations on the historical business data within a preset time step according to a sliding window algorithm, determine corresponding time features and concurrent volume features, perform feature matrix and target variable construction operations according to the time features and the concurrent volume features, determine corresponding historical business features, input the historical business features into a preset time series model for model training, determine the corresponding concurrent prediction model, predict the preset business properties according to the concurrent prediction model, and determine the corresponding real-time business concurrent volume, wherein the historical business data includes a timestamp, a business type, and a concurrent volume; The service code determination module 20 is used to perform a time analysis operation on the service nature to determine the corresponding service time span and service time granularity, perform a time code generation operation according to the service time span and the service time granularity to determine the corresponding service time code, perform a type quantity analysis operation on the service nature, perform service numbering according to the number of service types obtained after the type quantity analysis operation, determine the corresponding service tag code, and determine the corresponding service sequence code according to the real-time service concurrency and a preset global auto-increment algorithm, wherein the service time code includes a time series or a timestamp; The unique tag generation module 30 is used to perform a string concatenation operation according to the service time code, the service tag code and the service sequence code to determine the corresponding distributed system unique tag.
[0111] From the above description, it can be seen that the implementation device of the unique mark of the distributed system provided by the embodiment of the present application can obtain historical business features by performing feature extraction operations on historical business data within a preset time step according to a sliding window algorithm, input the historical business features into a preset time series model for model training, and obtain a concurrency prediction model. The business nature is predicted according to the concurrency prediction model to obtain real-time business concurrency, and the time span and business time granularity of the business nature are analyzed to generate a business time code, and the number of types of business nature is analyzed to generate a business tag code. According to the real-time business concurrency and the preset global auto-increment algorithm, the business sequence code is obtained, and a string concatenation operation is performed according to the business time code, the business tag code and the business sequence code to determine the unique mark of the distributed system, thereby improving the efficiency and flexibility of the use of the unique mark of the distributed system.
[0112] From the hardware level, in order to improve the efficiency and flexibility of using the unique mark of the distributed system, the present application provides an embodiment of an electronic device for implementing all or part of the content of the implementation method of the unique mark of the distributed system, and the electronic device specifically includes the following content: Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to implement the information transmission between the method for implementing the unique mark of the distributed system and the core business system, user terminal and related database and other related devices; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the method for implementing the unique mark of the distributed system in the embodiment, and the embodiment of the method for implementing the unique mark of the distributed system, and the contents thereof are incorporated herein, and the repeated parts are not repeated.
[0113] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.
[0114] In practical applications, part of the implementation method of the unique mark of the distributed system can be executed on the electronic device side as described above, or all operations can be completed in the client device. The specific selection can be based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.
[0115] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.
[0116] Fig. 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig. 9 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig. 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0117] In one embodiment, the implementation method function of the distributed system unique mark can be integrated into the central processor 9100. The central processor 9100 can be configured to perform the following control: Step S101: collect historical business data, perform feature extraction operations on the historical business data within a preset time step according to a sliding window algorithm, determine corresponding time features and concurrency features, perform feature matrix and target variable construction operations according to the time features and the concurrency features, determine corresponding historical business features, input the historical business features into a preset time series model for model training, determine a corresponding concurrency prediction model, predict the preset business properties according to the concurrency prediction model, and determine the corresponding real-time business concurrency, wherein the historical business data includes a timestamp, business type, and concurrency; Step S102: performing a time analysis operation on the service nature to determine a corresponding service time span and service time granularity, performing a time code generation operation according to the service time span and the service time granularity to determine a corresponding service time code, performing a type quantity analysis operation on the service nature, performing service numbering according to the number of service types obtained after the type quantity analysis operation to determine a corresponding service tag code, and determining a corresponding service sequence code according to the concurrent volume of the real-time service and a preset global auto-increment algorithm, wherein the service time code includes a time series or a timestamp; Step S103: Perform a string concatenation operation according to the service time code, the service tag code and the service sequence code to determine a corresponding distributed system unique tag.
[0118] From the above description, it can be seen that the electronic device provided in the embodiment of the present application obtains historical business features by performing feature extraction operations on historical business data within a preset time step according to a sliding window algorithm, inputs the historical business features into a preset time series model for model training, obtains a concurrency prediction model, predicts the nature of the business according to the concurrency prediction model, obtains the real-time business concurrency, analyzes the time span and business time granularity of the nature of the business to generate a business time code, analyzes the number of types of the nature of the business to generate a business tag code, obtains a business sequence code according to the real-time business concurrency and a preset global auto-increment algorithm, performs string concatenation operations according to the business time code, the business tag code and the business sequence code, and determines the unique tag of the distributed system, thereby improving the efficiency and flexibility of using the unique tag of the distributed system.
[0119] In another embodiment, the implementation method of the unique mark of the distributed system can be configured separately from the central processing unit 9100. For example, the implementation method of the unique mark of the distributed system can be configured as a chip connected to the central processing unit 9100, and the function of the implementation method of the unique mark of the distributed system is realized through the control of the central processing unit.
[0120] like Fig. 9 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig. 9 In addition, the electronic device 9600 may also include Fig. 9 For components not shown, reference may be made to the prior art.
[0121] like Fig. 9 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.
[0122] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.
[0123] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0124] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.
[0125] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0126] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0127] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the machine through the microphone 9132, and the sound stored on the machine can be played through the speaker 9131.
[0128] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps in the implementation method of the unique mark of a distributed system in the above embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps of the implementation method of the unique mark of a distributed system in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented: Step S101: collect historical business data, perform feature extraction operations on the historical business data within a preset time step according to a sliding window algorithm, determine corresponding time features and concurrency features, perform feature matrix and target variable construction operations according to the time features and the concurrency features, determine corresponding historical business features, input the historical business features into a preset time series model for model training, determine a corresponding concurrency prediction model, predict the preset business properties according to the concurrency prediction model, and determine the corresponding real-time business concurrency, wherein the historical business data includes a timestamp, business type, and concurrency; Step S102: performing a time analysis operation on the service nature to determine a corresponding service time span and service time granularity, performing a time code generation operation according to the service time span and the service time granularity to determine a corresponding service time code, performing a type quantity analysis operation on the service nature, performing service numbering according to the number of service types obtained after the type quantity analysis operation to determine a corresponding service tag code, and determining a corresponding service sequence code according to the concurrent volume of the real-time service and a preset global auto-increment algorithm, wherein the service time code includes a time series or a timestamp; Step S103: Perform a string concatenation operation according to the service time code, the service tag code and the service sequence code to determine a corresponding distributed system unique tag.
[0129] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application obtains historical business features by performing feature extraction operations on historical business data within a preset time step according to a sliding window algorithm, inputs the historical business features into a preset time series model for model training, obtains a concurrency prediction model, predicts the nature of the business according to the concurrency prediction model, obtains the real-time business concurrency, analyzes the time span of the business nature and the business time granularity to generate a business time code, analyzes the number of types of the business nature to generate a business tag code, obtains a business sequence code according to the real-time business concurrency and a preset global auto-increment algorithm, performs string concatenation operations according to the business time code, the business tag code and the business sequence code, and determines the unique tag of the distributed system, thereby improving the efficiency and flexibility of using the unique tag of the distributed system.
[0130] The embodiments of the present application also provide a computer program product capable of implementing all steps of the method for implementing a unique mark in a distributed system in the above embodiments, where the execution subject is a server or a client. When the computer program / instruction is executed by a processor, the steps of the method for implementing a unique mark in a distributed system are implemented. For example, the computer program / instruction implements the following steps: Step S101: collect historical business data, perform feature extraction operations on the historical business data within a preset time step according to a sliding window algorithm, determine corresponding time features and concurrency features, perform feature matrix and target variable construction operations according to the time features and the concurrency features, determine corresponding historical business features, input the historical business features into a preset time series model for model training, determine a corresponding concurrency prediction model, predict the preset business properties according to the concurrency prediction model, and determine the corresponding real-time business concurrency, wherein the historical business data includes a timestamp, business type, and concurrency; Step S102: performing a time analysis operation on the service nature to determine a corresponding service time span and service time granularity, performing a time code generation operation according to the service time span and the service time granularity to determine a corresponding service time code, performing a type quantity analysis operation on the service nature, performing service numbering according to the number of service types obtained after the type quantity analysis operation to determine a corresponding service tag code, and determining a corresponding service sequence code according to the concurrent volume of the real-time service and a preset global auto-increment algorithm, wherein the service time code includes a time series or a timestamp; Step S103: Perform a string concatenation operation according to the service time code, the service tag code and the service sequence code to determine a corresponding distributed system unique tag.
[0131] From the above description, it can be seen that the computer program product provided by the embodiment of the present application obtains historical business features by performing feature extraction operations on historical business data within a preset time step according to a sliding window algorithm, inputs the historical business features into a preset time series model for model training, obtains a concurrency prediction model, predicts the nature of the business according to the concurrency prediction model, obtains the real-time business concurrency, analyzes the time span of the business nature and the business time granularity to generate a business time code, analyzes the number of types of the business nature to generate a business tag code, obtains a business sequence code according to the real-time business concurrency and a preset global auto-increment algorithm, performs string concatenation operations according to the business time code, the business tag code and the business sequence code, and determines the unique tag of the distributed system, thereby improving the efficiency and flexibility of using the unique tag of the distributed system.
[0132] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0133] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0134] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0136] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for implementing unique marking in a distributed system, characterized in that: The method comprises: Collect historical business data, perform feature extraction operations on the historical business data within a preset time step according to a sliding window algorithm, determine corresponding time features and concurrency features, perform feature matrix and target variable construction operations according to the time features and the concurrency features, determine corresponding historical business features, input the historical business features into a preset time series model for model training, determine a corresponding concurrency prediction model, predict the preset business properties according to the concurrency prediction model, and determine the corresponding real-time business concurrency, wherein the historical business data includes a timestamp, business type, and concurrency; Performing a time analysis operation on the service nature to determine a corresponding service time span and service time granularity, performing a time code generation operation according to the service time span and the service time granularity to determine a corresponding service time code, performing a type and quantity analysis operation on the service nature, performing service numbering according to the number of service types obtained after the type and quantity analysis operation to determine a corresponding service tag code, and determining a corresponding service sequence code according to the concurrent volume of real-time services and a preset global auto-increment algorithm, wherein the service time code includes a time series or a timestamp; A string concatenation operation is performed according to the service time code, the service tag code and the service sequence code to determine a corresponding distributed system unique tag.
2. The method for implementing a unique mark in a distributed system according to claim 1, characterized in that: Before performing a feature extraction operation on the historical business data within a preset time step according to the sliding window algorithm to determine the corresponding time features and concurrency features, the method includes: Performing a time granularity unification operation on the timestamps in the historical business data to determine corresponding time data of the same magnitude, and performing a normalization operation on the concurrency in the historical business data to determine corresponding unified concurrency data; The historical business data is standardized according to the same magnitude time data and the unified concurrent volume data to determine corresponding standardized historical business data.
3. The method for implementing a unique mark in a distributed system according to claim 1, characterized in that: The performing a feature extraction operation on the historical business data within a preset time step according to the sliding window algorithm to determine the corresponding time features and concurrency features includes: Classify and count the concurrent traffic in the historical service data according to the preset service types, and respectively determine the service concurrent traffic data corresponding to the service types; A feature extraction operation is performed on the business concurrency data within a preset time step according to a sliding window algorithm to determine corresponding time features and concurrency features.
4. The method for implementing a unique mark in a distributed system according to claim 1, characterized in that: The performing a time code generation operation according to the service time span and the service time granularity to determine a corresponding service time code includes: Performing a time series generation operation according to the business time span and the business time granularity to determine a corresponding time series, and performing a timestamp conversion operation according to the time series to determine a corresponding timestamp; A coding judgment operation is performed according to the time sequence and the timestamp to determine the corresponding service time code.
5. The method for implementing a unique mark in a distributed system according to claim 4, characterized in that: The performing a coding judgment operation according to the time sequence and the timestamp to determine the corresponding service time code includes: Determining whether the number of occupied bits of the time series is shorter than the number of occupied bits of the time code; If it is short, the corresponding service time code is determined according to the time series; if it is long, the corresponding service time code is determined according to the timestamp.
6. The method for implementing unique marking of a distributed system according to claim 1, characterized in that: The determining of the corresponding service sequence code according to the concurrent real-time service volume and a preset global auto-increment algorithm includes: Determine the corresponding globally unique serial number according to the preset global auto-increment algorithm; A modulo evaluation operation is performed on the concurrent real-time service volume according to the globally unique sequence number to determine a corresponding service sequence code.
7. The method for implementing a unique mark in a distributed system according to claim 1, characterized in that: The performing a string concatenation operation according to the service time code, the service tag code, and the service sequence code to determine a corresponding distributed system unique tag includes: Perform a string concatenation operation according to the service time code, the service mark code, and the service sequence code to determine a corresponding digital string; A corresponding distributed system unique mark is determined according to the length of the character string, wherein the distributed system unique mark is an integer or a long integer.
8. A device for implementing unique marking of a distributed system, characterized in that: The device comprises: A concurrent prediction model construction module is used to perform feature extraction operations on the historical business data within a preset time step according to a sliding window algorithm, determine corresponding time features and concurrent volume features, perform feature matrix and target variable construction operations according to the time features and the concurrent volume features, determine corresponding historical business features, input the historical business features into a preset time series model for model training, determine the corresponding concurrent prediction model, predict the preset business properties according to the concurrent prediction model, and determine the corresponding real-time business concurrent volume, wherein the historical business data includes a timestamp, a business type, and a concurrent volume; A service code determination module is used to perform a time analysis operation on the service nature to determine the corresponding service time span and service time granularity, perform a time code generation operation according to the service time span and the service time granularity to determine the corresponding service time code, perform a type and quantity analysis operation on the service nature, perform service numbering according to the number of service types obtained after the type and quantity analysis operation to determine the corresponding service tag code, and determine the corresponding service sequence code according to the real-time service concurrency and a preset global auto-increment algorithm, wherein the service time code includes a time series or a timestamp; The unique tag generation module is used to perform a string concatenation operation according to the business time code, the business tag code and the business sequence code to determine the corresponding distributed system unique tag.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for implementing unique marking of a distributed system as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for implementing a unique identification of a distributed system as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Global ID (Identity) generation method and system based on business
CN107038188A
Distributed global ID generation method, device and equipment, and storage medium
CN108959386A
A large-concurrency automatic code generation method and system
CN109697280A
Service information processing method and device and computer equipment
CN116307227A
System and methods for creating, distributing, analyzing and optimizing data-driven signals
US20210349909A1