Sequence number acquisition method and device

By detecting the number of serial number sets on the business side and building a serial number acquisition request to obtain a new serial number set, the problem of business process pausing when serial number acquisition in the prior art is solved, and the fluency and efficiency of business processing are improved.

CN119127349AActive Publication Date: 2024-12-13BEIJING PACTERA JINXIN TECH LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411259833.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-12-13
Estimated Expiration
2044-09-09

AI Technical Summary

Technical Problem

The existing serial number acquisition method will pause the business process when it is completed on the business side, resulting in a decrease in business processing efficiency.

Method used

By detecting whether the number of sequence number sets reaches the usage number threshold on the business side, if it is not reached, a sequence number acquisition request is built and sent to the server to obtain a new sequence number set, and an asynchronous thread is used during the acquisition process to avoid the main thread pause. Ensure the continuity of business processes.

Benefits of technology

It is realized that when the serial number set does not reach the usage threshold, the business side can continue to execute business processes, improving the fluency and efficiency of business processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127349A_ABST
    Figure CN119127349A_ABST
Patent Text Reader

Abstract

The invention relates to a serial number acquisition method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: executing a business process according to a first serial number set, and detecting whether a first number of the first serial number set reaches a use number threshold; the first sequence number set is an increasing sequence number sequence; under the condition that the first quantity does not reach the use quantity threshold value, constructing a serial number acquisition request, and sending the serial number acquisition request to the server; the serial number acquisition request is used for determining a second serial number set corresponding to the service end; and receiving a second serial number set sent by the server, wherein the starting serial number in the second serial number set is greater than the ending serial number in the first serial number set. By adopting the method, the business process processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium and computer program product for obtaining a serial number. Background Art

[0002] In the process of processing business, sequence numbers are needed to identify data, transactions, messages, etc. in the business end. Therefore, sequence numbers are an indispensable part of business data. When the sequence number in the business end is used up, the business end needs to obtain a new sequence number through the sequence number acquisition method.

[0003] In the current method for obtaining serial numbers, when the serial number is used up, the business end suspends the execution of the business process. Then, the business end constructs a serial number obtaining request and sends the serial number obtaining request to the server end, so that the server end generates a second serial number set according to the serial number obtaining request and returns the second serial number set to the business end.

[0004] However, in the current method for obtaining serial numbers, the business end suspends the execution of the business process to obtain a new serial number, which causes the business process to be processed unsmoothly and leads to a decrease in business processing efficiency. Summary of the invention

[0005] Based on this, it is necessary to provide a serial number acquisition method, device, computer equipment, computer readable storage medium and computer program product to address the above technical problems.

[0006] In a first aspect, the present application provides a method for obtaining a sequence number, which is applied to a service end and includes:

[0007] Executing a business process according to a first sequence number set, and detecting whether a first quantity of the first sequence number set reaches a usage quantity threshold; the first sequence number set is an increasing sequence number sequence;

[0008] In the case that the first quantity does not reach the usage quantity threshold, constructing a sequence number acquisition request and sending the sequence number acquisition request to the service end; the sequence number acquisition request is used to determine the second sequence number set corresponding to the service end;

[0009] The second sequence number set sent by the server is received, wherein the starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set.

[0010] In one embodiment, detecting whether the first quantity of the first sequence number set reaches a usage quantity threshold includes:

[0011] Determine the number of sequence numbers of the first sequence number set in the cache as a first number;

[0012] The product of the acquisition quantity and the usage ratio threshold is determined as the usage quantity threshold;

[0013] Determine whether the first quantity reaches the usage quantity threshold.

[0014] In one embodiment, before determining the product of the acquisition quantity and the usage ratio threshold as the usage quantity threshold, the method further includes:

[0015] Acquire a historical sequence number usage data set of the business process within a historical time period, and perform data processing on the historical sequence number usage data set according to a usage frequency algorithm to obtain a usage frequency;

[0016] An acquisition quantity is determined based on the usage frequency, and a usage frequency is determined based on the historical sequence number usage data set.

[0017] In one embodiment, constructing a sequence number acquisition request and sending the sequence number acquisition request to a server includes:

[0018] Establish a sequence number acquisition asynchronous thread, and construct a sequence number acquisition request through the sequence number acquisition asynchronous thread, the sequence number identifier, the acquisition quantity and the end sequence number in the first sequence number set;

[0019] The sequence number acquisition request is sent to the server through the sequence number acquisition asynchronous thread.

[0020] In one embodiment, after constructing the serial number acquisition request and sending the serial number acquisition request to the server, the method further includes:

[0021] Determining whether the first number is less than or equal to a preset alarm threshold;

[0022] If the first number is less than or equal to the alarm threshold, increase the usage ratio threshold to obtain an increased usage ratio threshold;

[0023] Update the alarm count and determine whether the alarm count exceeds a preset alarm count threshold;

[0024] If the alarm number exceeds the alarm number threshold, alarm information is constructed according to the sequence number identifier, the service identifier and the information that the first number is less than or equal to the alarm threshold, and the alarm information is sent to the target object.

[0025] In a second aspect, the present application provides a method for obtaining a sequence number, which is applied to a server and includes:

[0026] Receive a sequence number acquisition request sent by a service end; the sequence number acquisition request includes a sequence number identifier, an ending sequence number, and an acquisition quantity;

[0027] Querying an initial second sequence number set based on the sequence number identifier;

[0028] A second sequence number set is determined according to the initial second sequence number set, the ending sequence number and the acquired quantity, and the second sequence number set is sent to the service end.

[0029] In one embodiment, determining the second sequence number set according to the initial second sequence number set, the ending sequence number and the acquired quantity includes:

[0030] Determine whether the second number of sequence numbers in the initial second sequence number set is greater than or equal to the number obtained in the sequence number request;

[0031] If the second number is greater than or equal to the acquired number, a starting sequence number is determined based on the ending sequence number, and starting with the starting sequence number, a second sequence number set of the acquired number is determined in the initial second sequence number set.

[0032] In one embodiment, after determining whether the second number of sequence numbers in the initial second sequence number set is greater than or equal to the number of sequence numbers obtained in the sequence number request, the method further includes:

[0033] If the second number is less than the acquired number, generating a third sequence number set based on the sequence number rule corresponding to the sequence number identifier;

[0034] Updating the initial second sequence number set based on the third sequence number set to obtain an updated initial second sequence number set;

[0035] A starting sequence number is determined based on the ending sequence number, and starting with the starting sequence number, a second sequence number set of the acquired quantity is determined in the updated initial second sequence number set.

[0036] In a third aspect, the present application also provides a serial number obtaining device, including:

[0037] A detection module, executing a business process according to a first sequence number set, and detecting whether a first quantity of the first sequence number set reaches a usage quantity threshold; the first sequence number set is an increasing sequence number sequence;

[0038] A construction module, configured to construct a sequence number acquisition request and send the sequence number acquisition request to the service end when the first quantity does not reach the usage quantity threshold; the sequence number acquisition request is used to determine a second sequence number set corresponding to the service end;

[0039] The first receiving module is used to receive the second sequence number set sent by the server; the starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set.

[0040] In a fourth aspect, the present application also provides a serial number acquisition device, including:

[0041] A second receiving module is used to receive a sequence number acquisition request sent by a service end; the sequence number acquisition request includes a sequence number identifier, an ending sequence number and an acquisition quantity;

[0042] A query module, used for querying an initial second sequence number set based on the sequence number identifier;

[0043] A determination module is used to determine a second sequence number set according to the initial second sequence number set, the ending sequence number and the acquired quantity, and send the second sequence number set to the service end.

[0044] In a fifth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0045] Executing a business process according to a first sequence number set, and detecting whether a first quantity of the first sequence number set reaches a usage quantity threshold; the first sequence number set is an increasing sequence number sequence;

[0046] In the case that the first quantity does not reach the usage quantity threshold, constructing a sequence number acquisition request and sending the sequence number acquisition request to the service end; the sequence number acquisition request is used to determine the second sequence number set corresponding to the service end;

[0047] The second sequence number set sent by the server is received, wherein the starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set.

[0048] In a sixth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0049] Receive a sequence number acquisition request sent by a service end; the sequence number acquisition request includes a sequence number identifier, an ending sequence number, and an acquisition quantity;

[0050] Querying an initial second sequence number set based on the sequence number identifier;

[0051] A second sequence number set is determined according to the initial second sequence number set, the ending sequence number and the acquired quantity, and the second sequence number set is sent to the service end.

[0052] In a seventh aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0053] Executing a business process according to a first sequence number set, and detecting whether a first quantity of the first sequence number set reaches a usage quantity threshold; the first sequence number set is an increasing sequence number sequence;

[0054] In the case that the first quantity does not reach the usage quantity threshold, constructing a sequence number acquisition request and sending the sequence number acquisition request to the service end; the sequence number acquisition request is used to determine the second sequence number set corresponding to the service end;

[0055] The second sequence number set sent by the server is received, wherein the starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set.

[0056] In an eighth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0057] Receive a sequence number acquisition request sent by a service end; the sequence number acquisition request includes a sequence number identifier, an ending sequence number, and an acquisition quantity;

[0058] Querying an initial second sequence number set based on the sequence number identifier;

[0059] A second sequence number set is determined according to the initial second sequence number set, the ending sequence number and the acquired quantity, and the second sequence number set is sent to the service end.

[0060] In a ninth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0061] Executing a business process according to a first sequence number set, and detecting whether a first quantity of the first sequence number set reaches a usage quantity threshold; the first sequence number set is an increasing sequence number sequence;

[0062] In the case that the first quantity does not reach the usage quantity threshold, constructing a sequence number acquisition request and sending the sequence number acquisition request to the service end; the sequence number acquisition request is used to determine the second sequence number set corresponding to the service end;

[0063] The second sequence number set sent by the server is received, wherein the starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set.

[0064] In a tenth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0065] Receive a sequence number acquisition request sent by a service end; the sequence number acquisition request includes a sequence number identifier, an ending sequence number, and an acquisition quantity;

[0066] Querying an initial second sequence number set based on the sequence number identifier;

[0067] A second sequence number set is determined according to the initial second sequence number set, the ending sequence number and the acquired quantity, and the second sequence number set is sent to the service end.

[0068] The above-mentioned sequence number acquisition method, device, computer equipment, computer-readable storage medium and computer program product execute the business process according to the first sequence number set, and detect whether the first quantity of the first sequence number set reaches the usage quantity threshold; the first sequence number set is an increasing sequence of sequence numbers; when the first quantity does not reach the usage quantity threshold, a sequence number acquisition request is constructed, and the sequence number acquisition request is sent to the server; the sequence number acquisition request is used to determine the second sequence number set corresponding to the business end; the second sequence number set sent by the server is received, and the starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set. With this method, when the first quantity of the first sequence number set does not reach the usage quantity threshold, a sequence number acquisition request is constructed and sent to obtain the second sequence number set, so that the business end can continue to execute the business process according to the remaining sequence numbers in the first sequence number set, thereby making the business process processing process smoother and improving business processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0070] Figure 1 An application environment diagram of a method for obtaining a sequence number in an embodiment;

[0071] Figure 2 A schematic diagram of a flow chart of a method for obtaining a sequence number executed by a service end in one embodiment;

[0072] Figure 3 A schematic diagram of a flow chart for determining whether a first quantity reaches a usage quantity threshold in an embodiment;

[0073] Figure 4 A schematic diagram of a flow chart for determining a usage ratio threshold and an acquisition quantity in one embodiment;

[0074] Figure 5 A schematic diagram of a process of sending a sequence number acquisition request in one embodiment;

[0075] Figure 6 A schematic diagram of a process of sending alarm information in an embodiment;

[0076] Figure 7A schematic diagram of a flow chart of a method for obtaining a sequence number executed by a server in one embodiment;

[0077] Figure 8 A schematic diagram of a process for determining a second sequence number set in one embodiment;

[0078] Fig. 9 A schematic diagram of a flow chart of determining a second sequence number set in another embodiment;

[0079] Fig.10 is a schematic diagram of the architecture of a sequence number supplement method in an exemplary embodiment;

[0080] Fig.11 is a flow chart of a method for supplementing sequence numbers in an exemplary embodiment;

[0081] Fig.12 It is a structural block diagram of a sequence number acquisition device in an embodiment;

[0082] Fig.13 It is a structural block diagram of a sequence number obtaining device in another embodiment;

[0083] Fig.14 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0084] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0085] The serial number acquisition method provided in the embodiment of the present application can be applied to Figure 1 In the distributed system 100 shown. The distributed system 100 includes a server 110 and each business terminal 120. The business terminal 120 executes the business process. The server 110 communicates with each business terminal 120 through the network. The server 110 can be an independent physical server, or a server cluster composed of multiple physical servers, or a cloud server providing cloud computing services. The business terminal 120 can be an independent physical server, or a cloud server providing cloud computing services.

[0086] In an exemplary embodiment, Figure 2 As shown, a method for obtaining a sequence number is provided, and the method is applied to Figure 1 The service end 120 (hereinafter, the reference numeral is omitted, referred to as the service end) in FIG. 1 is taken as an example to explain, and the following steps 202 to 206 are included. Among them:

[0087] Step 202: Execute a business process according to the first sequence number set, and detect whether the first quantity of the first sequence number set reaches a usage quantity threshold.

[0088] The first sequence number set is an increasing sequence number sequence.

[0089] In implementation, a first sequence number set is stored in a cache of the service end. The service end obtains a sequence number from the first sequence number set according to the sequence order of the first sequence number set to execute a service process. Then, the service end detects whether a first quantity of sequence numbers in the first sequence number set reaches a usage quantity threshold.

[0090] Specifically, a fourth quantity is pre-set in the business end. A first sequence number set is stored in the cache of the business end. The business end determines a fourth sequence number set of a fourth quantity from the first sequence number set. The business end obtains the fourth sequence number set from the first sequence number set. Then, the business end executes a business process based on the sequence numbers in the fourth sequence number set. The business end determines a usage quantity threshold value based on the obtained quantity and the usage ratio threshold value, and determines whether the first quantity of the first sequence number set reaches the usage quantity threshold value.

[0091] In an exemplary embodiment, the first sequence number set is a sequence of sequence numbers that increases from 0001202408050001 to 0001202408050100. The service end obtains sequence numbers from the first sequence number set in the order of the sequence number (the order of sequence numbers from small to large) starting from 0001202408050001 to execute the service process. Then, the service end detects whether the first number of sequence numbers in the first sequence number set reaches the usage quantity threshold at a preset time interval.

[0092] Specifically, the fourth quantity pre-set in the business end is 10. A first sequence number set is stored in the cache of the business end. The first sequence number set is a sequence of sequence numbers that increases from 0001202408050001 to 0001202408050100. Based on the sequence number sequence order of the first sequence number set, the business end determines a fourth sequence number set of the fourth quantity from the first sequence number set, and the obtained fourth sequence number set is a sequence of sequence numbers from 0001202408050001 to 0001202408050010. Then, the business end executes the business process based on the sequence numbers in the fourth sequence number set. The business end determines the usage quantity threshold based on the acquisition quantity and the usage ratio threshold, and determines whether the first quantity of the first sequence number set reaches the usage quantity threshold.

[0093] In an optional embodiment, if the first quantity of the first sequence number set reaches a usage quantity threshold, the service end determines that there are sufficient sequence numbers in the first sequence number set that can be used, and stops executing the sequence number acquisition method.

[0094] Optionally, the business process may be, but is not limited to, business in the financial industry or the medical industry, and the embodiments of the present application do not limit the business process.

[0095] Optionally, the time interval can be set to, but is not limited to, 1 minute or 1 hour, according to business needs. The embodiment of the present application does not limit the time interval.

[0096] Step 204: When the first quantity does not reach the usage quantity threshold, a sequence number acquisition request is constructed and sent to the server.

[0097] The sequence number acquisition request is used to determine the second sequence number set corresponding to the service end.

[0098] In implementation, when the first quantity does not reach the usage quantity threshold, the business end constructs a sequence number acquisition request according to the sequence number identifier of the business process and the acquisition quantity, and then sends the sequence number acquisition request to the service end.

[0099] Specifically, the business end will establish a new asynchronous thread, namely, a sequence number acquisition asynchronous thread. Then, the business end constructs a sequence number acquisition request through the sequence number acquisition asynchronous thread, and sends the sequence number acquisition request to the server. The server receives the sequence number acquisition request and determines the second sequence number set based on the sequence number acquisition request. The server sends the second sequence number set to the business end.

[0100] In an exemplary embodiment, the service end establishes a sequence number acquisition asynchronous thread, and constructs a sequence number acquisition request based on the sequence number acquisition asynchronous thread, the sequence number identifier, and the acquisition quantity. Then, the service end sends the sequence number acquisition request to the service end so that the service end determines the second sequence number set. The service end sends the second sequence number set to the service end. The service end receives the second sequence number set sent by the service end.

[0101] Step 206: Receive a second sequence number set sent by the server.

[0102] The starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set.

[0103] In implementation, the server receives a sequence number acquisition request and determines a second sequence number set based on the sequence number acquisition request. Then, the server sends the second sequence number set to the service end, the service end receives the second sequence number set sent by the server, and updates the first sequence number set according to the second sequence number set to obtain an updated first sequence number set.

[0104] Specifically, the server receives a sequence number acquisition request. The sequence number acquisition request includes a sequence number identifier and an acquisition quantity. The server determines the starting sequence number of the second sequence number set based on the sequence number identifier, and determines the sequence number of the acquisition quantity based on the starting sequence number, thereby constructing a second sequence number set. Then, the server sends the second sequence number set to the business end through a network connection. The business end receives the second sequence number set, and adds all the sequence numbers in the second sequence number set to the first sequence number set, thereby obtaining an updated first sequence number set.

[0105] In the above-mentioned sequence number acquisition method, when the first quantity of the first sequence number set has not reached the usage quantity threshold, a sequence number acquisition request is constructed and sent to obtain a second sequence number set, so that the business end can continue to execute the business process according to the remaining sequence numbers in the first sequence number set, thereby making the business process processing process smoother and improving business processing efficiency.

[0106] In an exemplary embodiment, Figure 3 As shown, the specific processing process of detecting whether the first quantity of the first sequence number set reaches the usage quantity threshold in step 202 includes steps 302 to 306. Among them:

[0107] Step 302: determine the number of sequence numbers of the first sequence number set in the cache as a first number.

[0108] During implementation, the service end counts the sequence numbers in the first sequence number set to obtain a first quantity.

[0109] Specifically, a first sequence number set is stored in a cache in the business end. When the business end executes a business process, the business end obtains a sequence number from the first sequence number set, thereby providing necessary data for the business process. Then, the business end determines the number of all sequence numbers in the first sequence number set, and determines the number as the first number.

[0110] In an exemplary embodiment, there is a first sequence number set in the cache of the service end. When the service end executes a service process, the service end determines a fourth sequence number set from the first sequence number set according to a predetermined fourth quantity, and executes the service process according to the sequence numbers in the fourth sequence number set. Then, the service end counts the sequence numbers in the first sequence number set to obtain the number of all sequence numbers in the first sequence number set, that is, the first quantity.

[0111] Optionally, the first sequence number set may exist in the form of, but is not limited to, a queue or a set. The embodiment of the present application does not limit the form of the first sequence number set.

[0112] Step 304: determine the product of the acquisition quantity and the usage ratio threshold as the usage quantity threshold.

[0113] In implementation, the business end determines the acquisition quantity and the usage ratio threshold. Then, the business end multiplies the acquisition quantity and the usage ratio threshold to obtain the usage quantity threshold.

[0114] In an exemplary embodiment, the acquisition quantity and usage ratio threshold are positively correlated with the usage frequency of the sequence number. The higher the usage frequency, the higher the acquisition quantity and usage ratio threshold. The business end determines the acquisition quantity and usage ratio threshold according to the usage frequency. Then, the business end multiplies the acquisition quantity and the usage ratio threshold to obtain the product, and determines the product as the usage quantity threshold of the business process.

[0115] For example, if the number of acquisitions is 2000 and the usage ratio threshold is 0.5, the business end multiplies 2000 and 0.5 to obtain the usage threshold of 1000.

[0116] Step 306, determining whether the first quantity reaches a usage quantity threshold.

[0117] In implementation, the business end determines whether the first quantity reaches the usage quantity threshold. If the first quantity reaches the usage quantity threshold, the business end determines that there are enough sequence numbers in the first sequence number set to execute the business process. If the first quantity does not reach the usage quantity threshold, the business end continues to execute the above step 204. Among them, the specific processing process of step 204 has been described in detail in the above embodiment, and the embodiment of this application will not be repeated here.

[0118] Specifically, the business end determines whether the first quantity is greater than or equal to the usage quantity threshold to determine whether the first quantity reaches the usage quantity threshold. If the first quantity is greater than or equal to the usage quantity threshold, the business end determines that there are enough sequence numbers in the first sequence number set to execute the business process and stops executing the sequence number acquisition method. If the first quantity is less than the usage quantity threshold, the business end continues to execute the above step 204.

[0119] In an exemplary embodiment, the service end determines whether the sequence number exists in the cache. If the sequence number does not exist, the service end obtains the sequence number of the acquisition quantity from the service end, and continues to determine whether the sequence number exists in the cache. If the sequence number exists in the cache, the service end executes the above step 302. The specific processing process of step 302 has been specifically described in the above embodiment, and the embodiment of this application will not be repeated here.

[0120] For example, if the first quantity is 900, the usage quantity threshold is 1000. The business end determines that the first quantity does not reach the usage quantity threshold, and continues to execute step 204.

[0121] In this embodiment, by detecting whether the first quantity in the first sequence number set reaches the usage quantity threshold, it is determined whether there are sufficient numbers in the first sequence number set to support the execution of the business process, which makes the execution of the business process smooth and improves the execution efficiency of the business process.

[0122] In an exemplary embodiment, before determining the usage quantity threshold based on the acquisition quantity and the usage ratio threshold, the acquisition quantity and the usage ratio threshold need to be determined. Figure 4 As shown, before step 304, the specific processing process of the serial number acquisition method also includes steps 402 to 404. Among them:

[0123] Step 402 , obtaining a historical sequence number usage data set of a business process within a historical time period, and determining a usage frequency based on the historical sequence number usage data set.

[0124] The historical sequence number usage data set includes the sequence numbers used every day in the historical time period.

[0125] In implementation, a historical time period is preset in the business end. The business end obtains the historical sequence number usage data set of the business process within the historical time period. The business end uses the total number of sequence numbers in the historical sequence number usage data set. The business end performs data calculation on the total number of sequence numbers according to the usage frequency algorithm to obtain the usage frequency.

[0126] In an exemplary embodiment, the historical time period of the historical sequence number usage data set is 7 days. The total number of sequences is 23520. The service end performs data calculation on the total number of sequences according to the usage frequency algorithm and obtains a usage frequency of 20 sequences per hour.

[0127] In an optional embodiment, the historical serial number usage data set contains historical usage frequencies per hour in the historical time period. The service end inputs each historical usage frequency into the neural network, and predicts each historical usage frequency through the neural network to obtain the usage frequency.

[0128] Optionally, the neural network may be, but is not limited to, a Long Short-Term Memory (LSTM) network. The embodiments of the present application do not limit the neural network.

[0129] Optionally, the historical time period can be set to, but is not limited to, 7 days or 30 days. The embodiment of the present application does not limit the historical time period.

[0130] Step 404: determine the acquisition quantity based on the usage frequency, and determine the usage ratio threshold based on the usage frequency and the business feature information of the business process.

[0131] In implementation, an adjustment range is preset in the business end. A correspondence between the usage frequency and the initial usage ratio threshold is set in the business end. The business end determines the target adjustment value in the adjustment range. Then, the business end determines the sum of the usage frequency and the target adjustment value as the acquisition quantity. Then, the business end determines the initial usage ratio threshold corresponding to the usage frequency. Then, the business end determines whether the business feature information of the business process meets the preset adjustment conditions. If the business feature information meets the preset adjustment conditions, the business end adjusts the initial usage ratio threshold to obtain the ratio threshold.

[0132] Specifically, an adjustment range is pre-set in the business end. The business feature information includes the business category. The business end determines the target adjustment value in the adjustment range according to the adjustment range and the historical usage frequency. For example, if the historical usage frequency shows a downward trend, the business end determines the target adjustment value to be a negative value; if the historical usage frequency shows an upward trend, the business end determines the target adjustment value to be a positive value. The more obvious the downward trend, the smaller the target adjustment value; the more obvious the upward trend, the larger the target adjustment value. Then, the business end adds the usage frequency and the target adjustment value to obtain the acquisition quantity. Then, the business end determines the initial ratio threshold corresponding to the usage frequency. Then, the business end determines whether the business category of the business process is the target business category based on the business feature information. If the business category is the target business category, the business end adjusts the initial usage ratio threshold upward to obtain the usage ratio threshold. If the business category is not the target business category, the business end determines the initial usage ratio threshold as the usage ratio threshold.

[0133] For example, the adjustment range is -5 to 5. The historical usage frequency shows an upward trend, and the usage frequency is 20. The corresponding relationship between the usage frequency and the initial usage ratio threshold is: if the usage frequency is less than 10, the initial usage ratio threshold is 0.1. If the usage frequency is 10 to 20, the initial usage ratio threshold is 0.2. If the usage frequency is 20 to 30, the initial usage ratio threshold is 0.3. If the usage frequency is 30 to 40, the initial usage ratio threshold is 0.4. If the usage frequency is greater than 40, the initial usage ratio threshold is 0.5. The target business category is the transfer category. The business end determines the target adjustment value to be 5 in the adjustment range. Then, the business end determines the sum of the usage frequency and the target adjustment value, 25, as the acquisition quantity. The business end determines that the initial usage ratio threshold corresponding to the usage frequency is 0.2. Then, the business end determines whether the business category of the business process is the transfer category based on the business feature information. If the business category is not the transfer category, the business end determines the initial usage ratio threshold to be the usage ratio threshold.

[0134] In an optional embodiment, the business end displays an acquisition parameter template in response to a request to generate acquisition parameters for a business process. The acquisition parameter template contains the usage frequency and business feature information of the business process. The user can determine the acquisition quantity based on the displayed usage frequency and input the acquisition quantity. The business end responds to the edit operation of the acquisition quantity and obtains the input acquisition quantity. The user can also input a usage ratio threshold value based on the displayed usage frequency and business feature information. The business end responds to the input operation of the usage ratio threshold value and obtains the usage ratio threshold value input by the user.

[0135] Optionally, the adjustment range can be, but is not limited to, set to -5 to 5, which is determined according to the usage frequency of the business process. The embodiment of the present application does not limit the adjustment range.

[0136] In this embodiment, the usage frequency is determined by the historical sequence number usage data set, and the usage of the sequence number of the business process is clarified. Furthermore, the acquisition quantity and usage ratio thresholds are determined based on the usage frequency, which facilitates the subsequent determination of the usage quantity threshold to ensure that the usage quantity threshold is within a reasonable range, thereby ensuring that there are always sequence numbers in the first sequence number set to support the operation of the business process. In addition, the acquisition quantity and usage ratio thresholds can be dynamically adjusted according to the processing of the business process, meeting the needs in different scenarios and expanding the scope of use of the sequence number acquisition method.

[0137] In an exemplary embodiment, Figure 5 As shown, the specific processing process of step 204 includes steps 502 to 504. Among them:

[0138] Step 502: establish a sequence number acquisition asynchronous thread, and construct a sequence number acquisition request through the sequence number acquisition asynchronous thread, the sequence number identifier, the acquisition quantity, and the end sequence number in the first sequence number set.

[0139] The serial number identifier is an identifier representing the serial number.

[0140] In the implementation, the business end establishes a sequence number acquisition asynchronous thread. Then, the sequence number acquisition asynchronous thread in the business end determines the ending sequence number in the first sequence number set. The sequence number acquisition thread in the business end constructs a sequence number acquisition request according to the sequence number identifier, acquisition quantity and ending sequence number. At the same time, the main thread in the business end is also executing the business process according to the sequence number in the first sequence number set.

[0141] In an exemplary embodiment, the business end creates a new sequence number acquisition thread. The business end constructs a sequence number acquisition request based on the sequence number acquisition thread. Specifically, since the first sequence number set is an increasing sequence of sequence numbers. Therefore, the ending sequence number in the first sequence number set is the largest sequence number with the largest value in the first sequence number set. The sequence number acquisition thread determines the sequence number identifier corresponding to the business process, and determines the ending sequence number with the largest value in the first sequence number set. Then, the sequence number acquisition thread constructs a sequence number acquisition request based on the sequence number identifier, the acquisition quantity, and the ending sequence number.

[0142] Optionally, the sequence number identifier may be included in each sequence number, that is, the service end determines the sequence number identifier in the sequence number. The embodiment of the present application does not limit the method for determining the sequence number identifier.

[0143] Step 504: Send the sequence number acquisition request to the server through the sequence number acquisition asynchronous thread.

[0144] In implementation, the sequence number acquisition thread in the business end sends a sequence number acquisition request to the server end, so that the server end determines the second sequence number set according to the sequence number acquisition request and returns the second sequence number set to the business end.

[0145] Specifically, the business end and the server end are connected via a network. The sequence number acquisition thread in the business end calls the network process in the business end. The network process sends the sequence number acquisition thread to the server end based on the network connection. The server end determines the starting sequence number of the second sequence number set based on the ending sequence number and the sequence number identifier in the sequence number acquisition request. Then, the server end determines the second sequence number set based on the starting sequence number and the acquisition quantity, and sends the second sequence number set to the business end. The business end receives the second sequence number set. The asynchronous mode of the sequence number acquisition asynchronous thread enables the business process to continue to be executed using the cached sequence number when the number issuance service of the business end fails or is delayed, thereby improving the fault tolerance and availability of the business end. The combined use of the sequence number acquisition asynchronous thread and the usage quantity threshold allows the business system in the distributed system to be more flexibly expanded and managed.

[0146] In this embodiment, a sequence number acquisition asynchronous thread is established, and a sequence number acquisition request is constructed and sent through the sequence number acquisition asynchronous thread, so that the server determines and returns the second sequence number set according to the sequence number acquisition request. The sequence number acquisition asynchronous thread can obtain a new sequence number in the second sequence number set to support the operation of the business process without delaying the main thread to execute the business process, avoiding unsmooth business process processing, improving the efficiency of executing the business process, and improving the concurrent processing capability and response speed of the business end.

[0147] In an exemplary embodiment, when the first quantity is less than the usage quantity threshold, it is necessary to determine whether the first quantity reaches the alarm threshold to determine whether to adjust the usage ratio threshold. Figure 6 As shown, after step 204 is executed, the specific processing process of the serial number acquisition method also includes steps 602 to 608. Among them:

[0148] Step 602: Determine whether the first number is less than or equal to a preset alarm threshold.

[0149] In implementation, an alarm threshold is preset in the service end. The service end determines whether the first number is less than or equal to the alarm threshold.

[0150] Specifically, an alarm threshold is pre-set in the business end. The business end determines whether the first number is less than or equal to the alarm threshold. If the first number is greater than the alarm threshold, it indicates that there are still a certain number of sequence numbers in the business end that can support the execution of the business process. If the first number is less than or equal to the alarm threshold, it indicates that the execution time of the business process is shortened and the execution frequency is accelerated, and the usage ratio threshold needs to be increased.

[0151] In an optional embodiment, if the first number is greater than the alarm threshold, the service end initializes the alarm threshold and continues to execute the service process. Specifically, the service end initializes the alarm threshold to 0.

[0152] Optionally, the alarm threshold is set according to the frequency of use, and the alarm threshold should be smaller than the usage quantity threshold. The embodiment of the present application does not limit the alarm threshold.

[0153] Step 604: If the first number is less than or equal to the alarm threshold, increase the usage ratio threshold to obtain an increased usage ratio threshold.

[0154] In implementation, if the first number is less than or equal to the alarm threshold, the business end determines that the business process does not have enough sequence numbers to support the execution of the business process, and determines that there may be a problem of accelerated usage frequency. Therefore, the business end increases the usage ratio threshold to obtain an increased usage ratio threshold.

[0155] Specifically, if the first number is less than or equal to the alarm threshold, the service end determines whether the usage ratio threshold reaches a preset maximum usage ratio threshold. If the usage ratio threshold does not reach the maximum usage ratio threshold, the service end increases the usage ratio threshold to obtain the increased usage ratio threshold. If the usage ratio threshold reaches the maximum usage ratio threshold, the service end updates the usage ratio threshold to the maximum usage ratio threshold.

[0156] For example, the usage ratio threshold is 0.4 and the maximum usage ratio threshold is 0.5. If the first number is less than or equal to the alarm threshold, the service end determines that the usage ratio threshold does not reach the maximum usage ratio threshold. Then, the service end increases the usage ratio threshold to obtain the increased usage ratio threshold of 0.5.

[0157] Optionally, the increase value is determined according to the acquisition requirements, and the embodiment of the present application does not limit the increase value of the increase processing.

[0158] Step 606, updating the alarm times, and determining whether the alarm times exceed a preset alarm times threshold.

[0159] In implementation, the service end is pre-set with the alarm number and the alarm number threshold. The service end adds the alarm number and 1 to obtain the updated alarm number. Then, the service end determines whether the alarm number exceeds the preset alarm number threshold.

[0160] For example, the current alarm count is 1, and the alarm count threshold is 3. The service end updates the current alarm count, and obtains an updated alarm count of 2. Then, the service end determines that the alarm count does not exceed the preset alarm count threshold.

[0161] In an optional embodiment, if the number of alarms does not exceed the preset alarm number threshold, the service end continues to execute the above step 202. The specific processing process of step 202 has been described in detail in the above embodiment, and the embodiment of this application will not be repeated here.

[0162] Optionally, the alarm number threshold is generally set to 3 times, and is set according to alarm requirements. The embodiment of the present application does not limit the alarm number threshold.

[0163] Step 608: If the number of alarms exceeds the alarm number threshold, alarm information is constructed according to the sequence number identifier, the service identifier, and the information that the first number is less than or equal to the alarm threshold, and the alarm information is sent to the target object.

[0164] In implementation, if the number of alarms exceeds the alarm number threshold, the business end determines that there is a problem with the execution of the sequence number acquisition method, and needs to inform the target object of the problem. Therefore, the business end constructs alarm information based on the sequence number identifier, the business identifier of the business process, and the information that the first number is less than or equal to the alarm threshold. Then, the business end feeds back the alarm information to the target object in a variety of ways.

[0165] Specifically, the service end sends the alarm information to the mobile terminal of the target object through email, text message, etc., so that the target object knows the alarm information, and manually sends the second sequence number set to the service end based on the alarm information.

[0166] Optionally, the target object is generally a mobile device of an operation and maintenance personnel of the business process, or may be a mobile device of an executor of the business process. The embodiment of the present application does not limit the target object.

[0167] In this embodiment, when the first number is less than the alarm threshold, the usage ratio threshold is updated, the usage ratio threshold is dynamically adjusted, and the accuracy of the usage ratio threshold is improved. In addition, when the number of alarms exceeds the alarm number threshold, an alarm message is sent to the target object, so that the target object manually sends the second sequence number set, thereby avoiding interruption of the execution of the business process and improving the execution efficiency of the business process.

[0168] In an exemplary embodiment, Figure 7 As shown, a method for obtaining a sequence number is provided, and the method is applied to Figure 1 The server 110 (hereinafter, the reference numeral is omitted, referred to as the server) in the embodiment is used as an example to illustrate the method, which includes the following steps 702 to 706. Among them:

[0169] Step 702: Receive a sequence number acquisition request sent by the service end.

[0170] The sequence number acquisition request includes a sequence number identifier, an ending sequence number, and an acquisition quantity.

[0171] In implementation, the server receives a sequence number acquisition request sent by the business end through a network connection with the business end. The sequence number identifier indicates that a sequence number needs to be acquired. The end sequence number is used to determine the start sequence number, and the acquisition quantity is used to determine the total number of acquired sequence numbers.

[0172] Step 704: query the initial second sequence number set based on the sequence number identifier.

[0173] In implementation, the server queries the initial second sequence number set corresponding to the sequence number identifier according to the sequence number identifier.

[0174] In an exemplary embodiment, the sequence number includes a sequence number identifier. The server performs a fuzzy query based on the sequence number identifier to obtain each sequence number, and constructs an initial second sequence number set based on each sequence number.

[0175] Step 706, determine the second sequence number set according to the initial second sequence number set, the ending sequence number and the acquired quantity, and send the second sequence number set to the service end.

[0176] In implementation, the server determines whether the initial second sequence number set meets the preset sequence number set update condition based on the second number of the initial second sequence number set and the acquisition number. If the initial second sequence number set meets the sequence number update condition, the server generates a third sequence number set, and updates the initial second sequence number set according to the third sequence number set to obtain an updated initial second sequence number set. Then, the server determines the second sequence number set according to the updated second sequence number set, the ending sequence number and the acquisition number, and sends the second sequence number set to the service end. If the initial second sequence number set does not meet the sequence number update condition, the computer device determines the second sequence number set according to the initial second sequence number set, the ending sequence number and the acquisition number, and sends the second sequence number set to the service end.

[0177] Specifically, the sequence number update condition is that the second number is less than the acquisition number. The server determines whether the second number in the initial second sequence number set is less than the acquisition number. If the second number is less than the acquisition number, the server determines that the initial second sequence number set meets the sequence number update condition. If the second number is greater than or equal to the acquisition number, the server determines that the initial second sequence number set does not meet the sequence number update condition.

[0178] In this embodiment, the server responds to the sequence number acquisition request, determines the second sequence number set based on the sequence number acquisition request, and returns the second sequence number set to the business end, supplementing the sequence numbers in the business end so that the business end has sufficient sequence numbers to execute the business process, thereby making the business process processing smoother and improving business processing efficiency.

[0179] In an exemplary embodiment, Figure 8 As shown, the specific processing process of determining the second sequence number set according to the initial second sequence number set, the ending sequence number and the acquired quantity in step 706 includes steps 802 to 804. Among them:

[0180] Step 802: determine whether the second quantity of sequence numbers in the initial second sequence number set is greater than or equal to the acquisition quantity in the sequence number request.

[0181] Among them, the second number is the number of all serial numbers in the initial second serial number set.

[0182] In implementation, the server counts the serial numbers in the initial second serial number set to obtain a second quantity. Then, the server determines whether the second quantity is greater than or equal to the acquisition quantity in the serial number request.

[0183] For example, the server counts the sequence numbers in the initial sequence number set and obtains that the second number of the initial second sequence number set is 100. The acquired number is 100. The server determines that the second number is greater than or equal to the acquired number, that is, there are enough sequence numbers in the initial second sequence number set to be sent to the service end.

[0184] Step 804: If the second quantity is greater than or equal to the acquired quantity, determine the starting sequence number based on the ending sequence number, and determine a second sequence number set of the acquired quantity in the initial second sequence number set starting with the starting sequence number.

[0185] In implementation, if the second quantity is greater than or equal to the acquired quantity, the server determines that there are enough sequence numbers in the initial second sequence number set to be sent to the business end. The server determines a starting sequence number that is larger than the ending sequence number in the initial second sequence number set. Then, the server uses the starting sequence number as a starting point, determines the sequence numbers of the acquired quantity in the initial sequence number set, and constructs a second sequence number set based on each sequence number. Then, the server sends the second sequence number set to the business end.

[0186] Specifically, the sequence number acquisition request also includes a step length, which is the interval between two sequence numbers. If the second quantity is greater than or equal to the acquisition quantity, the server determines to add the end sequence number and the step length to obtain the initial starting sequence number. Then, the server queries whether the initial starting sequence number exists in the initial second sequence number set. If the initial starting sequence number exists in the initial second sequence number set, the server determines the initial starting sequence number as the starting sequence number. If the initial starting sequence number does not exist in the initial second sequence number set, the server queries the initial second sequence number set for a starting sequence number greater than the end sequence number. Then, the server starts with the starting sequence number, determines the sequence number of the acquisition quantity in the initial sequence number set, and constructs the second sequence number set based on each sequence number. Then, the server sends the second sequence number set to the business end.

[0187] In an exemplary embodiment, the step length in the sequence number acquisition request is 1. The ending sequence number is 0001202408050100. The acquisition quantity is 100. If the second quantity is greater than or equal to the acquisition quantity, the server adds the step length 1 and the ending sequence number to obtain the initial starting sequence number 0001202408050101. The server determines that there is an initial starting sequence number in the initial second sequence number set, and determines the initial starting sequence number as the starting sequence number. Then, the server uses the starting sequence number 0001202408050101 as the starting point, determines 100 sequence numbers in the initial sequence number set, and constructs a second sequence number set based on each sequence number. The second sequence number set is a set from 0001202408050101 to 0001202408050200.

[0188] In this embodiment, by judging whether the second number of the initial second sequence number set is greater than or equal to the acquired number, it is determined whether there are enough sequence numbers in the initial sequence number set to be sent to the service end. If the second number is greater than or equal to the acquired number, the second sequence number set is determined to facilitate the subsequent replenishment of the sequence numbers in the service end.

[0189] In an exemplary embodiment, if the second number is less than the acquired number, a third sequence number set needs to be generated to supplement the initial second sequence number set. Fig. 9 As shown, after step 802 is executed, the specific processing process of the serial number acquisition method also includes steps 902 to 906. Among them:

[0190] Step 902: If the second number is less than the acquired number, generate a third sequence number set based on the sequence number rule corresponding to the sequence number identifier.

[0191] In implementation, if the second quantity is less than the acquired quantity, the server queries the sequence number rule according to the sequence number identifier, and then generates a third sequence number set according to the sequence number rule.

[0192] Specifically, if the second number is less than the acquired number, the server queries the database for a sequence number rule corresponding to the sequence number identifier. The sequence number rule includes sequence number components and step length. The server determines the maximum sequence number in the initial second sequence number set. Then, the server generates a third sequence number set based on the maximum sequence number, sequence number components and step length.

[0193] In an exemplary embodiment, if the second quantity is less than the acquired quantity, the server queries the database for the serial number rule corresponding to the serial number identifier. The serial number rule includes serial number components, step length and generated quantity. The step length is 1. The generated serial number is 100. The serial number components include serial number identifier, business process trigger time and serial number sub-value. The server determines that the maximum serial number value in the initial second serial number set is 0001202408050150. Among them, 0001 is the serial number identifier, 20240805 is the business trigger time, and 0150 is the serial number sub-value. The server determines the starting serial number of the third serial number set as 0001202408050151 based on the maximum serial number value 0001202408050150 and the step length. Then, the server generates a third sequence number set according to the maximum sequence number value, sequence number components and step size. The third sequence number set is a set from 0001202408050151 to 0001202408050250.

[0194] Step 904: Update the initial second sequence number set based on the third sequence number set to obtain an updated initial second sequence number set.

[0195] In implementation, the server adds the third sequence number set to the initial second sequence number set to obtain an updated initial sequence number set.

[0196] For example, the initial second sequence number set is a set from 0001202408050101 to 0001202408050150. The third sequence number set is a set from 0001202408050151 to 0001202408050250. The server adds the third sequence number set to the initial second sequence number set, and the updated initial second sequence number set is a set from 0001202408050101 to 0001202408050250.

[0197] Step 906, determining the starting sequence number based on the ending sequence number, and starting with the starting sequence number, determining the second sequence number set of the acquired quantity in the updated initial second sequence number set.

[0198] In implementation, the server determines a starting sequence number greater than the ending sequence number in the updated initial second sequence number set. Then, the server determines the sequence number of the acquired quantity in the updated initial sequence number set starting with the starting sequence number, and constructs the second sequence number set based on each sequence number. Then, the server sends the second sequence number set to the service end.

[0199] Specifically, the sequence number acquisition request also includes a step length, which is the interval between two sequence numbers. If the second quantity is greater than or equal to the acquisition quantity, the server determines to add the end sequence number and the step length to obtain the initial starting sequence number. Then, the server queries whether the initial starting sequence number exists in the updated initial second sequence number set. If the initial starting sequence number exists in the updated initial second sequence number set, the server determines the initial starting sequence number as the starting sequence number. If the initial starting sequence number does not exist in the second sequence number set after the initial update, the server queries the initial second sequence number set for a starting sequence number greater than the end sequence number. Then, the server takes the starting sequence number as the starting point, determines the sequence number of the acquisition quantity in the updated initial sequence number set, and constructs the second sequence number set based on each sequence number. Then, the server sends the second sequence number set to the service end.

[0200] In an exemplary embodiment, the step length in the sequence number acquisition request is 1. The ending sequence number is 0001202408050100. The acquisition quantity is 100. If the second quantity is greater than or equal to the acquisition quantity, the server adds the step length 1 and the ending sequence number to obtain the initial starting sequence number 0001202408050101. The server determines that the initial starting sequence number exists in the updated initial second sequence number set, and determines the initial starting sequence number as the starting sequence number. Then, the server uses the starting sequence number 0001202408050101 as the starting point, determines 100 sequence numbers in the updated initial sequence number set, and constructs a second sequence number set based on each sequence number. The second sequence number set is a set from 0001202408050101 to 0001202408050200.

[0201] In this embodiment, when the second number is less than the acquired number, a third sequence number set is generated, and the initial second sequence number set is updated according to the third sequence number set to obtain an updated initial second sequence number set, so that the updated initial second sequence number set has a sufficient number of sequence numbers. Then, the second sequence number set is determined according to the updated initial second sequence number set, so as to facilitate the subsequent supplementation of the sequence numbers in the service end.

[0202] In an exemplary embodiment, Fig.10 FIG. 1 is a schematic diagram of the structure of a sequence number supplement method in an exemplary embodiment. Fig.10As shown, the serial number is the request serial number. The request serial number can be, but is not limited to, the core system serial number, the accounting batch group number, the public teller serial number, the customer account number, the globally unique sequence, etc. The serial number in the business end exists in the JVM (Java Virtual Machine, Java is a programming language) cache, and supports a dual-segment cache structure. Specifically, 1=100 is one segment, 101 is 200 is another segment. The business end supports the storage of serial numbers of the two segments 1-100 and 101-200. When the remaining amount of the cache of the first segment does not reach the usage quantity threshold, the cache filling of the second segment is triggered. When the resources of the first segment are used up, the serial number is obtained from the cache of the second segment, and the business process continues to execute. The present application can periodically or actively fill the cache according to the consumption status of the serial number resources in the cache to ensure that the serial number resources in the cache are sufficient, and supports the dual-segment filling mode. When the first number is less than the alarm threshold, an alarm is triggered.

[0203] In an exemplary embodiment, Fig.11 FIG. 1 is a flow chart of a sequence number supplement method in an exemplary embodiment. Fig.11 As shown, the serial number supplement method includes:

[0204] Step 1101: The business system obtains the sequence number from the cache and executes the business process.

[0205] Step 1102, check whether there is a sequence number in the cache. If there is a sequence number, execute step 1104, if not, execute step 1103.

[0206] Step 1103: construct a sequence number acquisition request and send the sequence number acquisition request to the server to acquire the second sequence number set from the server and add it to the cached first sequence number set. Then, continue to execute step 1102.

[0207] Step 1104, determine whether the first quantity of the first sequence number set in the cache reaches a preset usage quantity threshold. If the first quantity does not reach the usage quantity threshold, execute step 1105. If the first quantity reaches the usage quantity threshold, execute step 1101.

[0208] Step 1105: Generate a sequence number acquisition asynchronous thread, construct a sequence number acquisition request through the sequence number acquisition asynchronous thread, and send the sequence number acquisition request to the server.

[0209] Step 1106, determining whether the first number is less than or equal to the alarm threshold. If the first number is less than or equal to the alarm threshold, executing step 1107; if the first number is greater than the alarm threshold, executing step 1110.

[0210] Step 1107, increase the usage ratio threshold and update the number of alarms.

[0211] Step 1108, determine whether the alarm number exceeds the alarm number threshold. If the alarm number exceeds the alarm number threshold, execute step 1109. If the alarm number does not exceed the alarm number threshold, execute step 1110.

[0212] Step 1109, construct warning information and feed the warning information back to the target object.

[0213] Step 1110: Receive the second sequence number set returned by the server, and add the second sequence number set to the first sequence number set in the cache.

[0214] Among them, step 1105 is to cover the position, and the covering rule is to start covering the position when the first quantity is 0.4 times, 0.3 times, 0.2 times or 0.1 times of the acquired quantity to prevent concurrency. There are four covering opportunities in total.

[0215] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0216] Based on the same inventive concept, the embodiment of the present application also provides a sequence number acquisition device for implementing the sequence number acquisition method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more sequence number acquisition device embodiments provided below can refer to the limitations of the sequence number acquisition method above, and will not be repeated here.

[0217] In an exemplary embodiment, Fig.12 As shown, a sequence number acquisition device 1200 is provided, comprising: a detection module 1201, a construction module 1202 and a first receiving module 1203, wherein:

[0218] The detection module 1201 executes a business process according to a first sequence number set, and detects whether a first quantity of the first sequence number set reaches a usage quantity threshold; the first sequence number set is an increasing sequence of sequence numbers.

[0219] The construction module 1202 is used to construct a sequence number acquisition request and send the sequence number acquisition request to the service end when the first quantity does not reach the usage quantity threshold; the sequence number acquisition request is used to determine the second sequence number set corresponding to the service end.

[0220] The first receiving module 1203 is used to receive a second sequence number set sent by the server; the starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set.

[0221] In an exemplary embodiment, the detection module 1201 includes a first execution submodule and a first detection submodule. The first detection submodule includes:

[0222] The first determining submodule is used to determine the number of sequence numbers of the first sequence number set in the cache as a first number.

[0223] The second determining submodule is used to determine the product of the acquired quantity and the usage ratio threshold as the usage quantity threshold.

[0224] The first judgment submodule is used to judge whether the first quantity reaches a usage quantity threshold.

[0225] In an exemplary embodiment, the serial number obtaining device 1200 further includes:

[0226] The first acquisition module is used to acquire a historical sequence number usage data set of a business process within a historical time period, and determine the usage frequency based on the historical sequence number usage data set.

[0227] The first determination module is used to determine the acquisition quantity based on the usage frequency, and to determine the usage ratio threshold based on the usage frequency and the business feature information of the business process.

[0228] In an exemplary embodiment, the building block 1202 includes:

[0229] A submodule is established to establish a sequence number acquisition asynchronous thread, and a sequence number acquisition request is constructed through the sequence number acquisition asynchronous thread, the sequence number identifier, the acquisition quantity and the end sequence number in the first sequence number set.

[0230] The first sending submodule is used to send a sequence number acquisition request to a server through a sequence number acquisition asynchronous thread.

[0231] In an exemplary embodiment, the serial number obtaining device 1200 further includes:

[0232] The first judgment module is used to judge whether the first number is less than or equal to a preset alarm threshold.

[0233] The increasing module is used to increase the usage ratio threshold if the first number is less than or equal to the alarm threshold, so as to obtain the increased usage ratio threshold.

[0234] The first updating module is used to update the alarm times and determine whether the alarm times exceed a preset alarm times threshold.

[0235] The second construction module is used to construct alarm information according to the sequence number identifier, the service identifier and the information that the first number is less than or equal to the alarm threshold if the alarm number exceeds the alarm number threshold, and send the alarm information to the target object.

[0236] In an exemplary embodiment, Fig.13 As shown, a serial number acquisition device 1300 is provided, comprising: a second receiving module 1301, a query module 1302 and a determination module 1303, wherein:

[0237] The second receiving module 1301 is used to receive a sequence number acquisition request sent by the service end; the sequence number acquisition request includes a sequence number identifier, an ending sequence number and an acquisition quantity.

[0238] The query module 1302 is used to query the initial second sequence number set based on the sequence number identifier.

[0239] The determination module 1303 is used to determine the second sequence number set according to the initial second sequence number set, the ending sequence number and the acquired quantity, and send the second sequence number set to the service end.

[0240] In an exemplary embodiment, the determination module 1303 includes a third determination submodule and a second sending submodule, wherein the third determination submodule includes:

[0241] The second judgment submodule is used to judge whether the second quantity of the sequence numbers in the initial second sequence number set is greater than or equal to the acquisition quantity in the sequence number request.

[0242] The fourth determination submodule is used to determine the starting sequence number based on the ending sequence number if the second number is greater than or equal to the acquired number, and to determine the second sequence number set of the acquired number in the initial second sequence number set starting with the starting sequence number.

[0243] In an exemplary embodiment, the serial number obtaining device 1300 further includes:

[0244] A generating module is used to generate a third sequence number set based on a sequence number rule corresponding to the sequence number identifier if the second number is less than the acquired number.

[0245] The second updating module is used to update the initial second sequence number set based on the third sequence number set to obtain an updated initial second sequence number set.

[0246] The second determining module is used to determine the starting sequence number based on the ending sequence number, and to determine the second sequence number set of the acquired quantity in the updated initial second sequence number set starting with the starting sequence number.

[0247] Each module in the above-mentioned serial number acquisition device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0248] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.14 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used in the serial number acquisition method. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a serial number acquisition method is implemented.

[0249] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0250] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0251] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0252] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0253] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0254] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0255] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for obtaining a sequence number, characterized in that: The method is applied to a service end, and the method includes: Executing a business process according to a first sequence number set, and detecting whether a first quantity of the first sequence number set reaches a usage quantity threshold; the first sequence number set is an increasing sequence number sequence; In the case that the first quantity does not reach the usage quantity threshold, constructing a sequence number acquisition request and sending the sequence number acquisition request to the service end; the sequence number acquisition request is used to determine the second sequence number set corresponding to the service end; The second sequence number set sent by the server is received, wherein the starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set.

2. The method according to claim 1, characterized in that The detecting whether the first quantity of the first sequence number set reaches a usage quantity threshold comprises: Determine the number of sequence numbers of the first sequence number set in the cache as a first number; The product of the acquisition quantity and the usage ratio threshold is determined as the usage quantity threshold; Determine whether the first quantity reaches the usage quantity threshold.

3. The method according to claim 2, characterized in that Before determining the product of the acquisition quantity and the usage ratio threshold as the usage quantity threshold, the method further includes: Acquire a historical sequence number usage data set of the business process within a historical time period, and determine the usage frequency based on the historical sequence number usage data set; The acquisition quantity is determined based on the usage frequency, and the usage ratio threshold is determined based on the usage frequency and the business feature information of the business process.

4. The method according to claim 1, characterized in that: The step of constructing a sequence number acquisition request and sending the sequence number acquisition request to the server includes: Establish a sequence number acquisition asynchronous thread, and construct a sequence number acquisition request through the sequence number acquisition asynchronous thread, the sequence number identifier, the acquisition quantity and the end sequence number in the first sequence number set; The sequence number acquisition request is sent to the server through the sequence number acquisition asynchronous thread.

5. The method according to claim 1, characterized in that After constructing the sequence number acquisition request and sending the sequence number acquisition request to the server, the method further includes: Determining whether the first number is less than or equal to a preset alarm threshold; If the first number is less than or equal to the alarm threshold, increase the usage ratio threshold to obtain an increased usage ratio threshold; Update the alarm count and determine whether the alarm count exceeds a preset alarm count threshold; If the alarm number exceeds the alarm number threshold, alarm information is constructed according to the sequence number identifier, the service identifier and the information that the first number is less than or equal to the alarm threshold, and the alarm information is sent to the target object.

6. A method for obtaining a sequence number, characterized in that: The method is applied to the server, and the method includes: Receive a sequence number acquisition request sent by a service end; the sequence number acquisition request includes a sequence number identifier, an ending sequence number, and an acquisition quantity; Querying an initial second sequence number set based on the sequence number identifier; A second sequence number set is determined according to the initial second sequence number set, the ending sequence number and the acquired quantity, and the second sequence number set is sent to the service end.

7. The method according to claim 6, characterized in that The determining the second sequence number set according to the initial second sequence number set, the ending sequence number and the acquired quantity comprises: Determine whether the second number of sequence numbers in the initial second sequence number set is greater than or equal to the number obtained in the sequence number request; If the second number is greater than or equal to the acquired number, a starting sequence number is determined based on the ending sequence number, and starting with the starting sequence number, a second sequence number set of the acquired number is determined in the initial second sequence number set.

8. The method according to claim 7, characterized in that After determining whether the second number of sequence numbers in the initial second sequence number set is greater than or equal to the number of sequence numbers obtained in the sequence number request, the method further includes: If the second number is less than the acquired number, generating a third sequence number set based on the sequence number rule corresponding to the sequence number identifier; Updating the initial second sequence number set based on the third sequence number set to obtain an updated initial second sequence number set; A starting sequence number is determined based on the ending sequence number, and starting with the starting sequence number, a second sequence number set of the acquired quantity is determined in the updated initial second sequence number set.

9. A serial number acquisition device, characterized in that: The device comprises: A detection module, executing a business process according to a first sequence number set, and detecting whether a first quantity of the first sequence number set reaches a usage quantity threshold; the first sequence number set is an increasing sequence number sequence; A construction module, configured to construct a sequence number acquisition request and send the sequence number acquisition request to the service end when the first quantity does not reach the usage quantity threshold; the sequence number acquisition request is used to determine a second sequence number set corresponding to the service end; The first receiving module is used to receive the second sequence number set sent by the server; the starting sequence number in the second sequence number set is greater than the ending sequence number in the first sequence number set.

10. A serial number acquisition device, characterized in that: The device comprises: A second receiving module is used to receive a sequence number acquisition request sent by a service end; the sequence number acquisition request includes a sequence number identifier, an ending sequence number and an acquisition quantity; A query module, used for querying an initial second sequence number set based on the sequence number identifier; A determination module is used to determine a second sequence number set according to the initial second sequence number set, the ending sequence number and the acquired quantity, and send the second sequence number set to the service end.

Citation Information

Patent Citations

  • A method and apparatus for assigning a number to a service

    CN109388626A

  • Distributed system number generation method and system

    CN113065034A

  • Sequence number distribution method and device, equipment and storage medium

    CN114895953A

  • ID generation method and device, storage medium and computer equipment

    CN116719756A

  • Serial number distribution method and device, computer equipment and storage medium

    CN117076519A