CN114254589A - Numbering generation method and system applied to software system - Google Patents

Numbering generation method and system applied to software system Download PDF

Info

Publication number
CN114254589A
CN114254589A CN202111327780.7A CN202111327780A CN114254589A CN 114254589 A CN114254589 A CN 114254589A CN 202111327780 A CN202111327780 A CN 202111327780A CN 114254589 A CN114254589 A CN 114254589A
Authority
CN
China
Prior art keywords
numerical value
bits
bit
software system
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111327780.7A
Other languages
Chinese (zh)
Inventor
章茂胜
骆文郅
钱建安
江涛
张瑛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Xiaoan Technology Co ltd
Original Assignee
Wuhan Xiaoan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Xiaoan Technology Co ltd filed Critical Wuhan Xiaoan Technology Co ltd
Priority to CN202111327780.7A priority Critical patent/CN114254589A/en
Publication of CN114254589A publication Critical patent/CN114254589A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/588Random number generators, i.e. based on natural stochastic processes

Abstract

The invention provides a serial number generation method and a serial number generation system applied to a software system, wherein a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment are obtained; then generating a serial number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value; the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the preset system comprises a 62 system or an 88 system. By setting the timestamp bit, the obtained number has time sequence, and the target can be conveniently and rapidly inquired. By setting the self-increment bit, the number can be ensured to be increased within a single second. By setting random bits, the same numbering within a single second can be avoided. In addition, because the first numerical value, the second numerical value and the third numerical value are data in 62-system or 88-system, the length of the number can be greatly shortened, the number of the numbers which can be generated can be increased, and the method can be suitable for a system with a large number requirement.

Description

Numbering generation method and system applied to software system
Technical Field
The invention relates to the technical field of information, in particular to a serial number generation method and system applied to a software system.
Background
Currently, in order to make the target easy to find, the target is usually marked. For example, the targets may be orders, pipelines, and machine equipment, among others.
When the target is marked, a Universal Unique Identifier (UUID) is usually used for marking, and a number of the target can be automatically generated by a computer. For example, the computer may automatically generate the number of the target by a database key-up or snowflake algorithm.
However, the UUID and the number length of the object generated by the snowflake algorithm are usually long, and the number capacity that can be generated is not large enough, and cannot be applied to a system with a large number requirement. The number of the target generated by the database master key self-increment mode is easy to be utilized by a destructor due to obvious numbering regularity of different targets, so that the related information of the target is unsafe.
Disclosure of Invention
The invention provides a serial number generation method and system applied to a software system, which are used for overcoming the defects in the prior art.
The invention provides a number generation method applied to a software system, which comprises the following steps:
acquiring a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment;
generating a number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value;
the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the cardinal number of the preset system comprises numbers and letters or numbers, letters and special characters.
According to the number generation method applied to the software system provided by the invention, the number of the target in the software system is generated based on the first numerical value, the second numerical value and the third numerical value, and the method also comprises the following steps:
acquiring a fourth numerical value of the number of accumulated downtime at the current moment, wherein the fourth numerical value is data of the preset system;
correspondingly, the generating a number of the target in the software system based on the first numerical value, the second numerical value, and the third numerical value specifically includes:
generating the number based on the first, second, third, and fourth numerical values.
According to the number generation method applied to the software system, provided by the invention, the bit numbers of the timestamp bits, the self-increment bits, the random bits and the downtime accumulated number of bits are determined based on the following method:
determining a target number of bits of the number;
and determining the bit number of the timestamp bits, the self-increment bits, the random bits and the downtime accumulated number of bits based on the target bit number and the preset scale.
According to the number generation method applied to the software system, the preset system is a 62 system, the bit number of the timestamp bit is 7, the bit number of the random bit is 3, the bit number of the downtime accumulated number is 1, and the bit number of the self-increment bit is determined based on the target bit number, the bit number of the timestamp bit, the bit number of the random bit and the bit number of the downtime accumulated number.
According to the number generation method applied to the software system, the preset system is an 88 system, the bit number of the timestamp bit is 7, the bit number of the random bit is 3, the bit number of the downtime accumulated number is 1, and the bit number of the self-increment bit is determined based on the target bit number, the bit number of the timestamp bit, the bit number of the random bit and the bit number of the downtime accumulated number.
According to the number generation method applied to the software system provided by the invention, the second numerical value is determined based on the following method:
acquiring a fifth numerical value of the self-increment bit at the previous moment of the current moment;
and determining the second numerical value based on the fifth numerical value and any random number corresponding to the preset system.
According to the number generation method applied to the software system provided by the invention, the generation of the number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value specifically comprises the following steps:
and generating the number by adopting an NIO asynchronous distribution strategy based on the first numerical value, the second numerical value and the third numerical value.
The invention also provides a serial number generation system applied to the software system, which comprises the following components:
the acquisition module is used for acquiring a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment;
the generation module is used for generating the number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value;
the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the cardinal number of the preset system comprises numbers and letters or numbers, letters and special characters.
The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the above-mentioned number generation methods applied to the software system.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the numbering generation method as applied to a software system as described in any of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, carries out the steps of the numbering generation method as applied to a software system as described in any of the above.
The invention provides a serial number generation method and a serial number generation system applied to a software system, which are characterized in that a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment are obtained; then generating a number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value; the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the preset system comprises a 62 system or an 88 system. By setting the timestamp bit, the obtained number has time sequence, and the target can be conveniently and rapidly inquired. By setting the self-increment bit, the number can be ensured to be increased within a single second. By setting random bits, the same numbering within a single second can be avoided. In addition, because the first numerical value, the second numerical value and the third numerical value are data in 62-system or 88-system, the length of the number can be greatly shortened, the number of the numbers which can be generated can be increased, and the method can be suitable for a system with a large number requirement.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a number generation method applied to a software system according to the present invention;
FIG. 2 is a schematic structural diagram of a number generation system applied to a software system according to the present invention;
fig. 3 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flow chart of a number generation method applied to a software system according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
s1, acquiring a first numerical value of the timestamp bit, a second numerical value of the self-increment bit and a third numerical value of the random bit at the current moment;
s2, generating the number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value;
the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the cardinal number of the preset system comprises numbers and letters or numbers, letters and special characters.
Specifically, in the method for generating a serial number applied to a software system provided in the embodiment of the present invention, the execution subject is the serial number generation system, the system may be configured in a server, the server may be a local server or a cloud server, and the local server may be a computer, a tablet computer, a smart phone, and the like. The number generation method provided by the embodiment of the invention can be applied to a software system to obtain the number of the target in the software system, and the target can be identified through the number so as to be tracked, inquired, searched and the like subsequently. The software system may be an order system, a flow system, or the like, may also be a system for storing and managing information of the machine device, and may also be a database system, and the like, which is not specifically limited in the embodiment of the present invention. Accordingly, the target may be an order, a pipeline, a machine device, a database data, and the like. Further, the number of the object may be an order number, a serial number, a machine device identification, a database primary key (index), and the like.
Step S1 is executed to obtain a first value of the timestamp bit, a second value of the self-increment bit, and a third value of the random bit at the current time. Here, the current time is the time at which the number is generated.
The composition structure of the number may include timestamp bits, self-increment bits, and random bits, and the positions of the timestamp bits, the self-increment bits, and the random bits in the number may be set as needed, for example, the timestamp bits, the self-increment bits, and the random bits may be arranged according to the order of the timestamp bits, the self-increment bits, and the random bits, or the timestamp bits, the self-increment bits, and the random bits may be arranged in other random orders, which is not specifically limited in this embodiment of the present invention.
The first numerical value of the timestamp bit is used for representing the timestamp of the current moment, the timestamp can be accurate to the second, the serial number of production can be guaranteed to have the time sequence, and the target can be conveniently and rapidly inquired.
The second value of the incremental bits is used for representing the incremental data of the current moment, the second value can be incremented in a single second, and the increasing form can be set according to needs, for example, the second value can be continuously increased or discontinuously increased, that is, for two codes which are successively and continuously generated, the number in a random system is increased on the basis that the second data of the incremental bits of the first code which is generated later is the second data of the incremental bits of the second code which is generated earlier.
The third value of the random bit, which is used to characterize the random data at the current time, completely avoids identically numbered collisions within a single second.
In order to reduce the length of the generated number, the carry numbers of the first numerical value, the second numerical value and the third numerical value may be set as preset carry numbers, that is, the first numerical value, the second numerical value and the third numerical value are data of the preset carry numbers. The preset scale can be set according to needs, and the base number of the preset scale comprises numbers and letters or numbers, letters and special characters.
When the base number of the preset scale includes a number and letters, since the number is 10, the letters include 26 upper case letters and 26 lower case letters, and there are 52 letters. Therefore, the maximum preset scale may be 62, and the value of the preset scale may be adjusted by increasing or decreasing the base number of the preset scale.
When the predetermined base number includes numbers, letters and special characters, since the numbers have 10, the letters include 26 upper case letters and 26 lower case letters, and there are 52 in total, and the special characters may have 26. Therefore, the highest preset system can be an 88 system, and the value of the preset system can be adjusted by increasing or decreasing the base number of the preset system.
Taking the preset scale as 62 scale as an example, the base number may include 62 elements, such as 10 digits, 26 small-case letters, and 26 large-case letters. I.e., its cardinality may include: "0123456789 abcdefghijklmnorqtuwxyzABCDEFGHIJKLMNOPQRSTHUVXYZ".
Taking the preset scale as 88 scale as an example, the base number may include 88 elements, such as 10 digits, 26 lower case letters, 26 upper case letters, and 26 special symbols, that is: "0123456789 abcdefghijklmnopqrstuvxyz! @ # $% & () - + ═ { } [ ] | \/? < > ".
Because the number system of the serial number is adjustable, the n system can be switched into the m system at will by increasing or decreasing the base number. Because of the n-system radix code table, a new code table can be generated by randomly disordering the sequence on the premise of not increasing or decreasing the radix, so that theoretically the n-system total n! The (factorial) seed code table enriches the code table.
Then, step S2 is executed to automatically generate a number of the target in the software system according to the first value of the timestamp bit, the second value of the self-increment bit and the third value of the random bit. The timestamp bits, the self-increment bits and the random bits all correspond to fixed bit numbers, so that when the numbers are automatically generated, the first numerical value, the second numerical value and the third numerical value can be expressed by the bit numbers of the corresponding bits, and the numbers of the targets in the software system can be obtained.
The serial number generation method applied to the software system provided by the embodiment of the invention comprises the steps of firstly obtaining a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment; then generating a number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value; the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the preset system comprises a 62 system or an 88 system. By setting the timestamp bit, the obtained number has time sequence, and the target can be conveniently and rapidly inquired. By setting the self-increment bit, the number can be ensured to be increased within a single second. By setting random bits, the same numbering within a single second can be avoided. In addition, because the first numerical value, the second numerical value and the third numerical value are data in 62-system or 88-system, the length of the number can be greatly shortened, the number of the numbers which can be generated can be increased, and the method can be suitable for a system with a large number requirement.
On the basis of the foregoing embodiment, the number generation method applied to the software system provided in the embodiment of the present invention generates a number of a target in the software system based on the first numerical value, the second numerical value, and the third numerical value, and before that, the method further includes:
acquiring a fourth numerical value of the number of accumulated downtime at the current moment, wherein the fourth numerical value is data of the preset system;
correspondingly, the generating a number of the target in the software system based on the first numerical value, the second numerical value, and the third numerical value specifically includes:
generating the number based on the first, second, third, and fourth numerical values.
Specifically, in the embodiment of the present invention, before generating the number of the target in the software system, a fourth numerical value of the number of the accumulated downtime at the current time may also be obtained. And the fourth numerical value of the downtime accumulated number is used for representing the downtime accumulated number of the numbering generation system before the current moment.
The position of the downtime accumulation number in the number may be set according to needs, for example, the downtime accumulation number may be set after the random bit, or may be set in any position.
It should be noted that the fourth value, the first value, the second value, and the third value are data of a preset system, so that consistency of numbered system numbers can be ensured.
Thereafter, when generating the number of the target in the software system, the number may be generated according to the first numerical value, the second numerical value, the third numerical value, and the fourth numerical value. Because the number of the downtime accumulated times is also corresponding to the fixed bit number, when the number is automatically generated, the first numerical value, the second numerical value, the third numerical value and the fourth numerical value can be expressed by the bit number of the corresponding bit at the same time, and the number of the target in the software system can be obtained.
In the embodiment of the invention, the downtime state of the number generation system can be early warned through the fourth numerical value of the number of the downtime accumulated times, so that a user can master the working state of the number generation system by checking whether the fourth numerical value of the number of the downtime accumulated times changes. Moreover, the accumulated number of times of downtime is different before the system is crashed by numbering generation and during the restarting operation after the system is crashed, so that the phenomenon of time rollback caused by the system crashed by numbering generation can be further prevented. The method can be applied to a master multi-slave cluster to prevent the numbering generation system from being down and being incapable of providing services to the outside.
On the basis of the above embodiment, the number generation method applied to the software system provided in the embodiment of the present invention further includes:
monitoring the working state of the serial number generation system to obtain a monitoring result;
if the monitoring result is that the serial number generation system is in a downtime state, adding 1 to the downtime accumulated times to obtain new downtime accumulated times;
and when the serial number generation system is restarted, taking the new downtime accumulated times as a fourth numerical value of the downtime accumulated times.
On the basis of the foregoing embodiment, in the number generation method applied to the software system provided in the embodiment of the present invention, the number of bits of the timestamp bits, the self-incrementing bits, the random bits, and the total number of times of downtime is determined based on the following method:
determining a target number of bits of the number;
and determining the bit number of the timestamp bits, the self-increment bits, the random bits and the downtime accumulated number of bits based on the target bit number and the preset scale.
Specifically, in the embodiment of the present invention, when determining the bit numbers of the timestamp bits, the self-increment bits, the random bits, and the downtime accumulated number of bits, the target number of bits of the serial number may be determined first. The target number of bits may be set by the user as desired, and may be set to 12, 15, or the like, for example.
And then, according to the target digit and a preset system, determining the bit digits of the timestamp digit, the self-increment digit, the random digit and the downtime accumulated number digit. The bit digits of the timestamp bits, the random bits and the downtime accumulated number of bits can be fixed values given by a user according to values of a preset scale, and then the self-increment bit digits are obtained based on the target digit, the given timestamp bits, the given random bits and the bit digits of the downtime accumulated number of bits.
In the embodiment of the invention, the target digit of the number needs to be determined firstly, so that the length of the number can be adjusted, and the length can be completely adjusted according to the specific actual condition.
On the basis of the above embodiments, in the number generation method applied to the software system provided in the embodiments of the present invention, the number generation system may generate the number through single-process memory processing, and may realize high performance of the numbering system.
On the basis of the above embodiments, the number generation method applied to the software system provided in the embodiments of the present invention has good test results after ten thousands of thread tests, which indicates that the method has high concurrency performance.
On the basis of the above embodiment, in the number generation method applied to the software system provided in the embodiment of the present invention, the preset carry may be a 62 carry, the bit number of the timestamp bit may be 7, the bit number of the random bit may be 3, the bit number of the downtime accumulated number may be 1, and the bit number of the self-increment bit may be determined based on the target bit number, the bit number of the timestamp bit, the bit number of the random bit, and the bit number of the downtime accumulated number.
Specifically, in the embodiment of the present invention, the timestamp bits, the random bits, and the number of bits of the downtime accumulated number of bits may be given by the user in advance according to actual needs under the condition of determining the preset scale. Thereafter, the number of bits to self-increment is determined by calculating the difference between the target number of bits and the number of bits of the timestamp bits, the random bits, and the downtime accumulated number of bits. For example, if the preset scale is a 62 scale, the bit number of the timestamp bit may be 7, the bit number of the random bit may be 3, the bit number of the downtime accumulated number of bits may be 1, the target number of bits is n (n > 11), and if the self-increment bit number is n-7-3-1.
Specifically, when the preset number is 62, and n is 16, at least the following number of data amounts can be generated per second. Typically, numbers can be generated for 3.52 trillion to 218.34 trillion data volumes.
6216-7-1-13.52 trillion
For example, the numbering may be "sH 5K74a 000xy zDa 0", "sH 5K74a 000xJ uTK 0", "sH 5K74a 000yF 41Q 0".
On the basis of the foregoing embodiment, in the number generation method applied to the software system provided in the embodiment of the present invention, the preset scale is an 88-scale, the bit number of the timestamp bit is 7, the bit number of the random bit is 3, the bit number of the total number of times of downtime is 1, and the bit number of the self-increasing bit is determined based on the target bit number, the bit number of the timestamp bit, the bit number of the random bit, and the bit number of the total number of times of downtime.
Specifically, in the embodiment of the present invention, the timestamp bits, the random bits, and the number of bits of the downtime accumulated number of bits may be given by the user in advance according to actual needs under the condition of determining the preset scale. Thereafter, the number of bits to self-increment is determined by calculating the difference between the target number of bits and the number of bits of the timestamp bits, the random bits, and the downtime accumulated number of bits. For example, if the predetermined scale is 88, the number of bits of the timestamp bit may be 7, the number of bits of the random bit may be 3, the number of bits of the downtime accumulated number of bits may be 1, the target number of bits is n (n > 10), and if the number of bits of the self-increment is n-7-3-1.
Specifically, when the preset number is 88, n is 24, and at least the following number of data amounts can be generated per second.
8824-7-1-11.47E +29 ≈ 14700
For example, the number may be "3 Je2Rlu 0000000D/ykoOkf 0", "3 Je2Ro 60000000 EZ & B. -4V 0", "3 Je2Roa 0000000 FXkd 9N 050", "3 Je2Roa 0000000Gb U8DZ) U0".
On the basis of the foregoing embodiment, in the number generation method applied to the software system provided in the embodiment of the present invention, the second value is determined based on the following method:
acquiring a fifth numerical value of the self-increment bit at the previous moment of the current moment;
and determining the second numerical value based on the fifth numerical value and any random number corresponding to the preset system.
Specifically, in the embodiment of the present invention, when determining the second value of the self-increment bit, the fifth value of the self-increment bit at the previous time of the current time may be obtained first.
And then, on the basis of the fifth numerical value, any random number corresponding to a preset system can be added, and the self-increment second numerical value at the current moment is obtained.
In the embodiment of the invention, when the second value of the self-increment bit at the current moment is determined, any random number corresponding to the preset system is introduced, so that the second value of the self-increment bit can be increased progressively within a single second and is discontinuous, and the irregularity of the generated number is ensured.
On the basis of the foregoing embodiment, the method for generating a number applied to a software system according to an embodiment of the present invention, where the generating a number of a target in the software system based on the first numerical value, the second numerical value, and the third numerical value specifically includes:
and generating the number by adopting an NIO asynchronous distribution strategy based on the first numerical value, the second numerical value and the third numerical value.
Specifically, in the embodiment of the present invention, when generating a number of a target in a software system, an NIO asynchronous distribution policy may be adopted to implement, so that multiple masters and multiple slaves may be implemented, and the production efficiency of numbers is greatly increased.
As shown in fig. 2, on the basis of the above embodiment, an embodiment of the present invention provides a number generation system applied to a software system, including:
an obtaining module 21, configured to obtain a first numerical value of a timestamp bit, a second numerical value of a self-increment bit, and a third numerical value of a random bit at a current time;
a generating module 22, configured to generate a number of the target in the software system based on the first numerical value, the second numerical value, and the third numerical value;
the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the cardinal number of the preset system comprises numbers and letters or numbers, letters and special characters.
On the basis of the foregoing embodiment, in the number generation system applied to the software system provided in the embodiment of the present invention, the obtaining module is further configured to:
acquiring a fourth numerical value of the number of accumulated downtime at the current moment, wherein the fourth numerical value is data of the preset system;
accordingly, the generating module is specifically configured to:
generating the number based on the first, second, third, and fourth numerical values.
On the basis of the foregoing embodiment, the number generation system applied to the software system provided in the embodiment of the present invention further includes a first determining module, configured to:
determining a target number of bits of the number;
and determining the bit number of the timestamp bits, the self-increment bits, the random bits and the downtime accumulated number of bits based on the target bit number and the preset scale.
On the basis of the foregoing embodiment, in the numbering generation system applied to a software system provided in the embodiment of the present invention, the preset scale is a 62-scale, the number of bits of the timestamp bits is 7, the number of bits of the random bits is 3, the number of bits of the total number of times of downtime bits is 1, and the number of bits of the self-increment bits is determined based on the target number of bits, the number of bits of the timestamp bits, the number of bits of the random bits, and the number of bits of the total number of times of downtime bits.
On the basis of the foregoing embodiment, in the numbering generation system applied to a software system provided in the embodiment of the present invention, the preset scale is an 88-scale, the number of bits of the timestamp bits is 7, the number of bits of the random bits is 3, the number of bits of the total number of times of downtime bits is 1, and the number of bits of the self-increment bits is determined based on the target number of bits, the number of bits of the timestamp bits, the number of bits of the random bits, and the number of bits of the total number of times of downtime bits.
On the basis of the foregoing embodiment, the number generation system applied to the software system provided in the embodiment of the present invention further includes a second determining module, configured to:
acquiring a fifth numerical value of the self-increment bit at the previous moment of the current moment;
and determining the second numerical value based on the fifth numerical value and any random number corresponding to the preset system.
On the basis of the foregoing embodiment, the number generation system applied to the software system provided in the embodiment of the present invention generates a number for:
and generating the number by adopting an NIO asynchronous distribution strategy based on the first numerical value, the second numerical value and the third numerical value.
Specifically, the functions of the modules in the number generation system applied to the software system provided in the embodiment of the present invention correspond to the operation flows of the steps in the above method embodiments one to one, and the implementation effects are also consistent.
Fig. 3 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 3: a processor (processor)310, a communication Interface (communication Interface)320, a memory (memory)330 and a communication bus 340, wherein the processor 310, the communication Interface 320 and the memory 330 communicate with each other via the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the number generation method applied to the software system provided in the above embodiments, the method including: acquiring a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment; generating a number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value; the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the cardinal number of the preset system comprises numbers and letters or numbers, letters and special characters.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer-readable storage medium, the computer program being capable of executing, when executed by a processor, the number generation method applied to a software system provided in the above embodiments, the method including: acquiring a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment; generating a number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value; the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the cardinal number of the preset system comprises numbers and letters or numbers, letters and special characters.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the number generation method applied to a software system provided in the above embodiments, the method including: acquiring a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment; generating a number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value; the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the cardinal number of the preset system comprises numbers and letters or numbers, letters and special characters.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A number generation method applied to a software system is characterized by comprising the following steps:
acquiring a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment;
generating a number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value;
the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the cardinal number of the preset system comprises numbers and letters or numbers, letters and special characters.
2. The method as claimed in claim 1, wherein generating the number of the target in the software system based on the first value, the second value and the third value further comprises:
acquiring a fourth numerical value of the number of accumulated downtime at the current moment, wherein the fourth numerical value is data of the preset system;
correspondingly, the generating a number of the target in the software system based on the first numerical value, the second numerical value, and the third numerical value specifically includes:
generating the number based on the first, second, third, and fourth numerical values.
3. The number generation method applied to the software system according to claim 2, wherein the number of bits of the timestamp bits, the self-incrementing bits, the random bits, and the downtime accumulated number of bits is determined based on the following method:
determining a target number of bits of the number;
and determining the bit number of the timestamp bits, the self-increment bits, the random bits and the downtime accumulated number of bits based on the target bit number and the preset scale.
4. The number generation method applied to the software system according to claim 3, wherein the predetermined scale is a 62 scale, the number of bits of the timestamp bits is 7, the number of bits of the random bits is 3, the number of bits of the downtime accumulated number is 1, and the number of bits of the self-increment is determined based on the target number of bits, the number of bits of the timestamp bits, the number of bits of the random bits, and the number of bits of the downtime accumulated number.
5. The number generation method applied to the software system according to claim 3, wherein the predetermined system is 88 systems, the number of bits of the timestamp bits is 7, the number of bits of the random bits is 3, the number of bits of the downtime accumulated number is 1, and the number of bits of the self-increment is determined based on the target number of bits, the number of bits of the timestamp bits, the number of bits of the random bits, and the number of bits of the downtime accumulated number.
6. The number generation method applied to the software system according to any one of claims 1 to 5, wherein the second numerical value is determined based on:
acquiring a fifth numerical value of the self-increment bit at the previous moment of the current moment;
and determining the second numerical value based on the fifth numerical value and any random number corresponding to the preset system.
7. The method according to any one of claims 1 to 5, wherein the generating a number of the target in the software system based on the first numerical value, the second numerical value, and the third numerical value specifically includes:
and generating the number by adopting an NIO asynchronous distribution strategy based on the first numerical value, the second numerical value and the third numerical value.
8. A number generation system for use in a software system, comprising:
the acquisition module is used for acquiring a first numerical value of a timestamp bit, a second numerical value of a self-increment bit and a third numerical value of a random bit at the current moment;
the generation module is used for generating the number of the target in the software system based on the first numerical value, the second numerical value and the third numerical value;
the first numerical value, the second numerical value and the third numerical value are data of a preset system, and the cardinal number of the preset system comprises numbers and letters or numbers, letters and special characters.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the number generation method applied to a software system according to any one of claims 1 to 7 are implemented when the processor executes the program.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the number generation method as claimed in any one of claims 1 to 7 applied to a software system.
CN202111327780.7A 2021-11-10 2021-11-10 Numbering generation method and system applied to software system Pending CN114254589A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111327780.7A CN114254589A (en) 2021-11-10 2021-11-10 Numbering generation method and system applied to software system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111327780.7A CN114254589A (en) 2021-11-10 2021-11-10 Numbering generation method and system applied to software system

Publications (1)

Publication Number Publication Date
CN114254589A true CN114254589A (en) 2022-03-29

Family

ID=80792403

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111327780.7A Pending CN114254589A (en) 2021-11-10 2021-11-10 Numbering generation method and system applied to software system

Country Status (1)

Country Link
CN (1) CN114254589A (en)

Similar Documents

Publication Publication Date Title
CN110554732B (en) Identification number generation method and device, electronic equipment and storage medium
CN108388604A (en) User right data administrator, method and computer readable storage medium
CN109714249B (en) Method and related device for pushing applet messages
CN112115145A (en) Data acquisition method and device, electronic equipment and storage medium
CN111767297B (en) Big data processing method, device, equipment and medium
CN112559558A (en) Serial number generation method and device, computing device and storage medium
CN112506486A (en) Search system establishing method and device, electronic equipment and readable storage medium
CN110807035A (en) Serial number generation method, device, equipment and storage medium
CN103905512A (en) Data processing method and equipment
CN114254589A (en) Numbering generation method and system applied to software system
CN109165259B (en) Index table updating method based on network attached storage, processor and storage device
CN113127490B (en) Key name generation method and device and computer readable storage medium
CN110362575B (en) Method and device for generating global index of data
CN113254271A (en) Data sequence recovery method, device, equipment and storage medium
CN111651362A (en) Test case generation method and device, storage medium and computer equipment
CN107066247B (en) Patch query method and device
CN112308440A (en) Work order processing method and device, computer equipment and computer readable storage medium
CN111984731A (en) Method and device for synchronizing data among large data platform bins and storage medium
CN106681785B (en) Software generation method and device
CN111209284A (en) Metadata-based table dividing method and device
CN111443934B (en) Gray scale user determination method, device, equipment and storage medium
CN108803548B (en) Method and device for managing parallel operation of equipment
CN115495911A (en) Model renaming method, device and storage medium
CN115393067A (en) Method, device, equipment and storage medium for batch credit recalculation
CN117633014A (en) Service data processing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination