CN110598068A - Global identification generation method and device - Google Patents

Global identification generation method and device Download PDF

Info

Publication number
CN110598068A
CN110598068A CN201910889603.4A CN201910889603A CN110598068A CN 110598068 A CN110598068 A CN 110598068A CN 201910889603 A CN201910889603 A CN 201910889603A CN 110598068 A CN110598068 A CN 110598068A
Authority
CN
China
Prior art keywords
sequence
acquisition request
time point
target
mixed
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
CN201910889603.4A
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.)
JD Digital Technology Holdings Co Ltd
Original Assignee
JD Digital Technology Holdings 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 JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN201910889603.4A priority Critical patent/CN110598068A/en
Publication of CN110598068A publication Critical patent/CN110598068A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90348Query processing by searching ordered data, e.g. alpha-numerically ordered data

Abstract

The embodiment of the application discloses a global identification generation method and a global identification generation device. One embodiment of the method comprises: responding to a received first obtaining request, and obtaining a current time point, wherein the first obtaining request is used for requesting to obtain a global identifier in a digital sequence form; generating a target digital sequence according to the difference value between a preset future time point and the current time point; and returning the target digit sequence to the electronic equipment sending the first acquisition request. This embodiment provides a new way of generating a global identity.

Description

Global identification generation method and device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a global identification generation method and device.
Background
As data proliferates, traditional relational and non-relational databases have become increasingly unable to satisfy vast data storage, and more data is migrated to data warehouses, distributed file servers, and the like. The file server can distinguish the data blocks by using the data block identifiers. Most file servers generate identification sequences as data block identifications according to ascending order of a dictionary, and the identification sequences have globally unique functions.
Disclosure of Invention
The embodiment of the application provides a global identification generation method and a global identification generation device.
In a first aspect, an embodiment of the present application provides a global identifier generating method, where the method includes: responding to a received first acquisition request, and acquiring a current time point, wherein the first acquisition request is used for requesting to acquire a global identifier in a digital sequence form; generating a target digital sequence according to the difference value between a preset future time point and the current time point; and returning the target digit sequence to the electronic equipment sending the first acquisition request.
In a second aspect, an embodiment of the present application provides an apparatus for generating a global identifier, where the apparatus includes: the acquisition unit is configured to respond to receiving a first acquisition request, and acquire a current time point, wherein the first acquisition request is used for requesting to acquire a global identifier in a digital sequence form; a first generating unit configured to generate a target digit sequence according to a difference between a preset future time point and the current time point; and the first returning unit is configured to return the target digit sequence to the electronic equipment which sends the first acquisition request.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to implement the method according to any one of the embodiments of the global identity generation method described above.
In a fourth aspect, the present application provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method of any one of the above global identity generation methods.
The global identifier generation method and device provided by the embodiment of the application respond to the fact that a first acquisition request is received, and a current time point is acquired, wherein the first acquisition request is used for requesting a global identifier for digital sequence driving; then, generating a target digital sequence according to the difference value between the preset future time point and the current time point; finally, the target digital sequence is sent to the first electronic device; thus, technical effects may include at least: a new global identity generation approach is provided.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a global identity generation method according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a global tag generation method according to the present application;
FIG. 4 is a flowchart according to an exemplary implementation of step 202 of the present application;
FIG. 5 is a flow diagram of one embodiment of a global identity generation method according to the present application;
FIG. 6 is a flowchart according to an exemplary implementation of step 502 of the present application;
FIG. 7 is a flowchart of an exemplary implementation of step 5025 according to the present application;
FIG. 8A is a schematic illustration of a critical worse process according to the present application;
FIG. 8B is a schematic illustration of a non-critical bit-worse procedure according to the present application;
FIG. 8C is a schematic illustration of a shift operation process according to the present application;
FIG. 9 is a schematic structural diagram of one embodiment of a global flag generation apparatus according to the present application;
FIG. 10 is a block diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the global identity generation method or global identity generation apparatus of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include first servers 101, 102, 103, a network 104, and a second server 105. The network 104 serves as a medium for providing communication links between the first servers 101, 102, 103 and the second server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The first servers 101, 102, 103 may interact with the second server 105 over the network 104 to receive or send messages or the like. The first servers 101, 102, 103 may implement various functions, such as supporting various client applications, running a distributed database, etc.
The first servers 101, 102, 103 may be servers providing various services, such as background servers supporting shopping applications on the terminal device. The first servers 101, 102, 103 may be servers that provide various services. The server may provide the service in response to a service request of the user. It is to be understood that one first server may provide one or more services, and that the same service may be provided by a plurality of first servers.
It should be noted that the first servers 101, 102, and 103 may be hardware or software. When the first servers 101, 102, and 103 are hardware, they may be implemented as a distributed first server cluster composed of a plurality of first servers, or implemented as a single first server. When the first server is software, it may be implemented as a plurality of software or software modules (for example, to provide distributed services), or as a single software or software module. And is not particularly limited herein.
The second server 105 may be a second server providing various services, for example a server providing global identification required by the databases on the first servers 101, 102, 103. The second server may analyze and perform other processing on the received data such as the global identifier obtaining request, and feed back a processing result (for example, the global identifier) to the first server.
The second server 105 may be a server that provides various services. The second server may provide the service in response to a service request of the user. It will be appreciated that one second server may provide one or more services, and that the same service may be provided by a plurality of second servers.
It should be noted that the global identifier generating method provided in the embodiment of the present application is generally executed by the second server 105, and accordingly, the global identifier generating apparatus is generally disposed in the second server 105.
The second server may be hardware or software. When the second server is hardware, it may be implemented as a distributed second server cluster composed of a plurality of second servers, or may be implemented as a single second server. When the second server is software, it may be implemented as a plurality of software or software modules (for example, to provide distributed services), or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of first servers, networks, and second servers in fig. 1 is merely illustrative. There may be any number of first servers, networks, and second servers, as desired for implementation. When the electronic device on which the global identifier generation method operates does not need to perform data transmission with other electronic devices, the system architecture may include only the electronic device on which the global identifier generation method operates.
With continued reference to FIG. 2, a flow 200 of one embodiment of a global identity generation method according to the present application is shown. The global identification generation method comprises the following steps:
step 201, in response to receiving the first obtaining request, obtaining a current time point.
In this embodiment, an execution subject (e.g., the second server shown in fig. 1) of the global flag generation method may acquire the current time point in response to receiving the first acquisition request.
Here, the first acquisition request is used to request acquisition of a global identifier in the form of a sequence of numbers.
Here, the global identification may be a unique identification of the file in the system.
Here, the global sequence in the form of a number sequence may be a number sequence.
Here, the number sequence may include only numbers. The number may be a natural number including [ 0-9 ].
Here, the current time point may indicate a current time. Alternatively, the current time may be a time point recorded by a natural clock, or a time point recorded by a logical clock.
Here, the current time point under the clock of the execution body described above may be acquired.
Optionally, the precision of the current time point may be set according to specific situations, for example, the precision may be as accurate as nanoseconds. It will be appreciated that the higher the accuracy, the greater the number of digital sequences that can be provided per second.
Step 202, a target number sequence is generated according to a difference between a preset future time point and a current time point.
In this embodiment, the execution body may generate the target number sequence according to a difference between a preset future time point and a current time point.
Here, the preset future time point indicates a certain time point in the future. As an example, the preset future point in time may indicate the last second of a million years of a metric unit.
Optionally, the accuracy of the preset future time point may be set according to specific situations, for example, the accuracy may be as accurate as nanoseconds.
Step 203, the target number sequence is returned to the electronic device sending the first acquisition request.
In this embodiment, the execution subject may return the target number sequence to the electronic device that sent the first acquisition request.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the global flag generation method according to the present embodiment. The method comprises the following specific steps:
first, the first electronic device 301 sends a first acquisition request 303 to the server 302.
The server 302 may then obtain the current point in time in response to receiving the first obtaining request.
The server may then generate a target number sequence 304 based on the difference between the preset future point in time and the current point in time.
Finally, the server may send the generated target number sequence 304 to the first electronic device 301.
The method shown in this embodiment acquires a current time point by responding to a received first acquisition request, where the first acquisition request is used to request a global identifier for digital sequence driving; then, generating a target digital sequence according to the difference value between the preset future time point and the current time point; finally, the target digital sequence is sent to the first electronic device; thus, technical effects may include at least:
first, a new global flag generation approach is provided.
Secondly, a target digit sequence is generated based on the current time point. The current time point is continuously changed along with the time, so that the generated target number sequence has global uniqueness; furthermore, because the uniqueness of the global identifier can be ensured based on the current time point, information such as clocks or machine numbers of other electronic devices can be not referred to, so that clock synchronization among a plurality of electronic devices can be not required, and information such as machine numbers of other electronic devices does not need to be acquired. Therefore, the efficiency of generating the global identification can be improved, and the resource consumption for generating the global identification can be reduced (the computing resource consumption for synchronizing the clocks of multiple machines is reduced, and the communication resource consumption for transmitting various information is reduced).
In some embodiments, please refer to FIG. 4, which illustrates an alternative implementation of step 202 (i.e., flow 202). The process 202 may include:
step 2021, determining the difference between the preset future time point and the current time point as the mirror image time point.
Step 2022, generate a first number sequence according to the product of the mirror time point and the preset future time point.
In some embodiments, the product of the mirrored point in time and the preset future point in time may be determined as the first sequence of numbers.
In some embodiments, the product of the mirror time point and a coefficient of a preset first length may also be determined as the first number sequence.
At step 2023, a target number sequence is generated based on the first number sequence.
It should be noted that, as time goes by, the series of first number sequences generated by the execution main body is a descending sequence; since the difference between the preset future time point and the current time point is decreasing and the future time point is positive, the generated first digit sequence is decreasing over time.
It should be noted that, because the accuracy of the preset future time point and the current time point may be higher, some electronic devices do not support calculation, in this case, a technician may set a calculator and a calculation method with higher accuracy according to an actual situation, and details are not described here.
In some embodiments, step 2023 may comprise: and determining the first number sequence as the target number sequence.
In some embodiments, step 2023 may comprise: determining whether the length of the first digit sequence is a first preset length; in response to the fact that the length of the first digital sequence is determined to be a first preset length, the first digital sequence is spliced with a target system identifier to generate a second digital sequence; and determining the second digit sequence as a target digit sequence. If the first preset length is not the first preset length, the first digit sequence can be supplemented with 0 to the first preset length, and then the first digit sequence is spliced with the parent system identifier.
Here, the target system identifier may be an identifier of a system in which the electronic device that transmitted the first acquisition request is located.
It should be noted that, before the target digital sequence is generated, length check may be performed on the target digital sequence, and if the length is not the first preset length, length completion may be performed on the first digital sequence; if the length is the first preset length, the first digital sequence and the target system identification can be spliced to obtain a second digital sequence, and the second digital sequence is determined as a target digital sequence. Therefore, the obtained target number sequence can comprise a target system identification, so that the target number sequence is convenient to recognize and determine which system the target number sequence is applied to. Moreover, the lengths of the general target system identifiers are uniform, and the lengths of the obtained target digital sequences are uniform under the condition that the first digital sequence is the first preset length, so that the electronic equipment can conveniently set the storage space with the uniform length for the target digital sequences, and the calculation method is convenient.
In some embodiments, the global flag is 32 bits.
It should be noted that since the generation of the global identifier using the current time point can guarantee global uniqueness, a sequence with a relatively short length can be used. The global identifier is 32 bits, so that the memory space consumed by storing the global identifier is reduced, and the calculation amount for searching the identifier is reduced compared with the prior art of 64 global identifiers.
With further reference to fig. 5, a flow 500 of yet another embodiment of a global identity generation method is illustrated. The process 500 of the global identity generation method includes the following steps:
step 501, receiving an acquisition request, and determining whether the acquisition request is a first acquisition request or a second acquisition request according to the indication information.
In this embodiment, an execution subject (e.g., the second server shown in fig. 1) of the global flag generation method may receive the acquisition request, and determine whether the acquisition request is the first acquisition request or the second acquisition request according to the indication information.
Here, the acquisition request is for requesting a global identifier, and the acquisition request includes indication information for indicating whether the global identifier is in a digital sequence form or a mixed sequence form.
It may be appreciated that if it is determined that the acquisition request is a first acquisition request, it may be determined that the first acquisition request is received; if it is determined that the acquisition request is a second acquisition request, it may be determined that the second acquisition request is received.
Step 502, in response to receiving the second acquisition request, generating a target mixing sequence.
In this embodiment, an execution subject of the global flag generation method (e.g., the second server shown in fig. 1) may generate the target mixing sequence in response to receiving the second acquisition request.
Here, the second retrieval request is for requesting retrieval of the global identity in the form of a mixed sequence.
Here, the mixing sequence may include letters and numbers. Optionally, comprising [ a-z ] one or more of the 26 letters; the numbers may include [ 0-9 ] one or more of the 10 numbers.
Step 503, returning the target mixing sequence to the electronic device sending the second obtaining request.
In this embodiment, an execution subject of the global identifier generation method (for example, the second server shown in fig. 1) may return the target mixing sequence to the electronic device that sent the second acquisition request.
Step 504, in response to receiving the first obtaining request, obtaining the current time point.
And 505, generating a target digital sequence according to the difference value between the preset future time point and the current time point.
Step 506, the target number sequence is returned to the electronic device that sent the first acquisition request.
It should be noted that details and technical effects of the step 504, the step 505, and the step 506 may refer to the description of the step 201, the step 202, and the step 203, and are not described herein again.
As can be seen from fig. 5, compared with the embodiment corresponding to fig. 2, the process 500 of the global identifier generating method in this embodiment highlights that the received acquisition request is determined to be the first acquisition request or the second acquisition request through the indication information. In the event of a second acquisition request, a target blending sequence may be generated and the second blending sequence returned. Therefore, the scheme described in this embodiment can support generation of the global identifier in the form of a digital sequence and a mixed sequence, realize function aggregation, and reduce the number of the number sending devices which need to communicate with the electronic device requesting the global identifier. It will be appreciated that a signaling device, also known as a sender, may be a device that generates and transmits a global identification.
In some embodiments, please refer to FIG. 6, which illustrates an alternative implementation of step 502 (i.e., flow 502). The process 502 may include:
step 5021, it is determined whether the predefined location of the second acquisition request is empty.
Here, the second fetch request may include a plurality of parameter bits. The predefined location may be a predefined parameter bit.
As an example, the second fetch request may include 64 parameter bits. The 32 parameters from bit 33 to bit 64 may be defined as predefined positions.
It is understood that the predefined location is empty, either with no parameter or with a default parameter (e.g., 0).
Step 5022, in response to the fact that the predefined position of the second obtaining request is determined to be empty, a first preset number of characters are obtained from a preset character set, and a first mixed sequence is generated.
Here, the first mixed sequence may be obtained by randomly arranging the first predetermined number of characters.
Here, the preset character set may include a number subset and a letter subset.
As an example, the subset of numbers may include the 10 numbers [ 0-9 ]. The subset of letters may include the 26 letters [ a-z ].
Step 5023, adjusting the positions of the characters in the first mixed sequence to generate a second mixed sequence, and determining the second mixed sequence as a target mixed sequence.
In some embodiments, step 5023 may comprise: determining binary codes corresponding to all characters in the first mixed sequence from an ASCII code comparison table; then, according to the sequence of binary codes from big to small, the characters in the first mixed sequence are arranged to obtain a second mixed sequence. It will be appreciated that the binary code corresponding to the character in the preceding position in the sequence is greater than the binary code corresponding to the character in the following position.
The positions of the characters in the first mixed sequence are rearranged based on the ASCII code lookup table, and the largest sequence in which the characters can be extracted in the first mixed sequence can be obtained. Based on the largest sequence, if the sequence is generated in descending order, more sequences can be generated.
In some embodiments, step 5023 may comprise: determining binary codes corresponding to the characters at the first two positions in the first mixed sequence from an ASCII code comparison table; then, according to the sequence of binary codes from big to small, the characters at the first two positions in the first mixed sequence are arranged to obtain a second mixed sequence.
In some embodiments, step 5023 may comprise: and adjusting the character position in the first mixed sequence to generate a second mixed sequence, wherein the second mixed sequence is a last sequence of the first mixed sequence. The relationship of the second mixing sequence to the first mixing sequence may be as follows: the sequences in the sequence set are arranged in ascending lexicographic order with the second blending sequence preceding the first blending sequence. Here, the first set of sequences may include: and a sequence generated by adjusting the position of the character in the first number of characters.
Step 5024, in response to determining that the predefined position in the second obtaining request is not empty, obtaining the parameter in the predefined position as a third mixing sequence.
Here, the parameters in the predefined locations may be arranged in the order of arrangement in the predefined locations as the third mixing sequence.
Step 5025, generating a previous sequence of the third mixed sequence, and determining the previous sequence as a target mixed sequence.
Here, the relationship between the previous sequence and the third mixed sequence is as follows: the sequences in the sequence set are arranged in ascending lexicographic order, the last sequence preceding the third mixed sequence.
Here, the sequence set includes sequences generated by adjusting positions of elements in the parameters.
It should be noted that the parameter of the predefined location may be a global identifier returned to the electronic device before the execution of the main body. For the electronic device, the global identifier obtained last time may be used as a previous global identifier, and a new global identifier may be obtained from the second obtaining request packed by the previous global identifier to the execution main body. The executing agent may generate a previous identifier of the previous global identifier, and return the previous global identifier to the electronic device. Thus, the plurality of target mix sequences returned by the execution main body to the electronic device are in descending order in chronological order.
In some embodiments, the positions of the elements in the parameters may be adjusted for the parameters to generate a plurality of sequences, and thus the sequence set may be generated. Step 5025 may include: and arranging the sequences in the sequence set according to a lexicographic order in an ascending order, and acquiring sequences smaller than the third mixed sequence from the sequences adjacent to the third mixed sequence in the arrangement result as a previous sequence.
In some embodiments, please refer to fig. 7, which illustrates an alternative implementation of step 5025 (i.e., flow 5025). The process 5025 may include:
step 50251, the third mixed sequence is subjected to bit adjacent poor.
Here, the bit critical worse may include: and performing bit adjacent poor on the third mixed sequence, wherein the bit adjacent poor comprises: and determining whether the previous character is larger than the next character between two adjacent characters, and if so, interchanging positions.
Referring to FIG. 8A, an exemplary process of poor clinical outcome is shown. In the figure, character 8 is the preceding character of character 7, and character 8 is larger than character 7, then character 7 and character 8 interchange positions.
Step 50252, non-adjacent bit poor is performed on the third mixing sequence passing through the adjacent bit poor.
Here, the non-adjacent bit poor may include: determining whether the front character is larger than the rear character between two non-adjacent characters, and if so, interchanging the positions of the two non-adjacent characters; for the first subsequence beginning and ending with two non-adjacent characters, the parts except the first character in the first subsequence are arranged in a reverse order of the lexicographic order.
Referring to FIG. 8B, an exemplary process of non-adjacent bit poor is shown. Character 9 and character 8 are two non-adjacent characters. Character 9 is the preceding character of character 8, and character 9 and character 8 interchange positions if preceding character 9 is larger than preceding character 8. The first subsequence "87 c 9" beginning and ending with characters 8 and 9, except for the first character 8, "7 c 9" is arranged in reverse of the lexicographic order, giving "c 97".
Step 50253, shift operation is performed on the third mixed sequence with poor non-adjacent bits to obtain the previous sequence.
Here, the shift operation may include: determining the part except the head and tail characters in the third mixed sequence which is subjected to the non-adjacent bit poor processing as a second subsequence; determining whether the second subsequence conforms to an ascending lexicographic order; if yes, the character which is smaller than the first character of the third mixed sequence in the second subsequence and has the smallest absolute value of difference is exchanged with the first character of the third mixed sequence; and arranging the exchanged second subsequence in a reverse order according to the dictionary order to obtain the previous sequence.
Referring to FIG. 8C, an exemplary process of a shift operation is shown. The part except the head and the tail is determined as a second subsequence which can be '234567'; then, determining that the second sequence conforms to the ascending order of the lexicographic order; the character in the second subsequence which is smaller than the first character 8 and has the smallest absolute value of the difference with the first character, i.e. the character 7, is interchanged with the first character; the interchanged second subsequence, "2345689", is arranged in reverse order, in alphabetical order, to yield "79865132".
It should be noted that, the previous sequence generated through the adjacent bit poor, non-adjacent bit poor and shift operations can avoid generating a sequence set by ranking the elements in the parameter in advance, thereby reducing the space for storing the sequence set; moreover, the generation mode needs fewer calculation steps compared with the whole arrangement, and can improve the calculation speed and save the calculation resources.
In some embodiments, if the second subsequence does not conform to the ascending lexicographic order, the third mixed sequence is discarded from the beginning and end, and then subjected to adjacent bit corruption and/or non-adjacent bit corruption. And will not be described in detail herein.
With further reference to fig. 9, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of a global identifier generating apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 9, the global flag generating apparatus 900 of the present embodiment includes: an acquisition unit 901, a first generation unit 902, and a first return unit 903. The obtaining unit is configured to obtain a current time point in response to receiving a first obtaining request, wherein the first obtaining request is used for requesting to obtain a global identifier in a digital sequence form; a first generating unit configured to generate a target digit sequence according to a difference between a preset future time point and the current time point; and the first returning unit is configured to return the target digit sequence to the electronic equipment which sends the first acquisition request.
In this embodiment, specific processing of the obtaining unit 901, the first generating unit 902, and the first returning unit 903 of the global identifier generating apparatus 900 and technical effects thereof may refer to relevant descriptions of step 201, step 202, and step 203 in the corresponding embodiment of fig. 2, which are not described herein again.
In some embodiments, the first generating unit is further configured to: determining the difference value between the preset future time point and the current time point as a mirror image time point; generating a first digital sequence according to the product of the mirror image time point and the preset future time point; based on the first number sequence, a target number sequence is generated.
In some embodiments, the first obtaining request includes a target system identifier; and the first generating unit is further configured to: determining whether the length of the first digit sequence is a first preset length; in response to determining that the length of the first digital sequence is a first preset length, splicing the first digital sequence with the target system identifier to obtain a second digital sequence; and determining the second digit sequence as the target digit sequence.
In some embodiments, the global flag is 32 bits.
In some embodiments, the above apparatus further comprises: a receiving unit (not shown in the figure) configured to: receiving an acquisition request, and determining whether the acquisition request is a first acquisition request or a second acquisition request according to indication information, wherein the acquisition request is used for requesting a global identifier, the acquisition request comprises the indication information, and the indication information is used for indicating whether the global identifier is in a digital sequence form or a mixed sequence form; a second generating unit (not shown in the figure) configured to generate a target mixing sequence in response to receiving a second obtaining request, wherein the second obtaining request is used for requesting to obtain the global identification in the form of the mixing sequence, and the mixing sequence comprises letters and numbers; a second returning unit (not shown in the figure) configured to return the target mixing sequence to the electronic device that sent the second acquisition request.
In some embodiments, the second generating unit is further configured to: in response to determining that the predefined position of the second acquisition request is empty, acquiring a preset first number of characters from a preset character set to generate a first mixed sequence; and adjusting the character position in the first mixing sequence to generate a second mixing sequence, and determining the second mixing sequence as the target mixing sequence.
In some embodiments, the second generating unit is further configured to: determining binary codes corresponding to all characters in the first mixed sequence from an ASCII code comparison table; and arranging the characters in the first mixed sequence according to the sequence of the binary codes from large to small to obtain a second mixed sequence.
In some embodiments, the second generating unit is further configured to: in response to determining that the predefined location in the second acquisition request is not empty, acquiring a parameter in the predefined location as a third mixing sequence; generating a previous sequence of a third mixed sequence, and determining the previous sequence as the target mixed sequence, wherein the relationship between the previous sequence and the third mixed sequence is as follows: and arranging the sequences in the sequence set according to a lexicographic ascending order, wherein the previous sequence is one bit before the third mixed sequence, and the sequence set comprises the sequences generated by adjusting the positions of the elements in the parameters.
In some embodiments, the second generating unit is further configured to: and performing bit adjacent poor on the third mixed sequence, wherein the bit adjacent poor comprises: determining whether the front character is larger than the rear character between two adjacent characters, and if so, interchanging positions; and performing non-adjacent bit poor on the third mixed sequence passing through the adjacent bit poor, wherein the non-adjacent bit poor comprises: determining whether the front character is larger than the rear character between two non-adjacent characters, and if so, interchanging the positions of the two non-adjacent characters; for a first subsequence taking two non-adjacent characters as heads and tails, arranging parts except the first character in the first subsequence in a reverse sequence in a lexicographic order; and for a third mixed sequence with poor non-adjacent bits, performing a shift operation to obtain the previous sequence, wherein the shift operation includes: determining the part except the head and tail characters in the third mixed sequence which is subjected to the non-adjacent bit poor processing as a second subsequence; determining whether the second subsequence conforms to an ascending lexicographic order; if yes, the character which is smaller than the first character of the third mixed sequence in the second subsequence and has the smallest absolute value of difference is exchanged with the first character of the third mixed sequence; and arranging the exchanged second subsequence in a reverse order according to the dictionary order to obtain the previous sequence.
Referring now to FIG. 10, shown is a block diagram of a computer system 1000 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 10, the computer system 1000 includes a processor (e.g., a central processing unit CPU)1001 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage section 1006 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the system 1000 are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An Input/Output (I/O) interface 1005 is also connected to the bus 1004.
The following components are connected to the I/O interface 1005: a storage section 1006 including a hard disk and the like; and a communication section 1007 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1007 performs communication processing via a network such as the internet. A driver 1008 is also connected to the I/O interface 1005 as necessary. A removable medium 1009 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1008 as necessary, so that a computer program read out therefrom is mounted into the storage section 1006 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network through the communication section 1007 and/or installed from the removable medium 1009. The computer program, when executed by the processor 1001, performs the above-described functions defined in the method of the present application. It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a first generation unit, and a first return unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the acquisition unit may also be described as a "unit for acquiring the current time point".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: responding to a received first acquisition request, and acquiring a current time point, wherein the first acquisition request is used for requesting to acquire a global identifier in a digital sequence form; generating a target digital sequence according to the difference value between a preset future time point and the current time point; and returning the target digit sequence to the electronic equipment sending the first acquisition request.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A global identity generation method comprises the following steps:
the method comprises the steps of responding to the received first obtaining request, obtaining a current time point, wherein the first obtaining request is used for requesting to obtain a global identification in a digital sequence form;
generating a target digital sequence according to a difference value between a preset future time point and the current time point;
and returning the target digital sequence to the electronic equipment sending the first acquisition request.
2. The method of claim 1, wherein the generating a target digit sequence based on a difference between a preset future time point and the current time point comprises:
determining the difference value between the preset future time point and the current time point as a mirror image time point;
generating a first digital sequence according to the product of the mirror image time point and the preset future time point;
based on the first number sequence, a target number sequence is generated.
3. The method of claim 2, wherein the first acquisition request includes a target system identification; and
generating a target digit sequence based on the first digit sequence, comprising:
determining whether the length of the first digit sequence is a first preset length;
in response to the fact that the length of the first digital sequence is determined to be a first preset length, splicing the first digital sequence and the target system identification to obtain a second digital sequence;
and determining the second digit sequence as the target digit sequence.
4. The method of claim 1, wherein the global flag is 32 bits.
5. The method according to any one of claims 1-4, wherein the method further comprises:
receiving an acquisition request, and determining whether the acquisition request is a first acquisition request or a second acquisition request according to indication information, wherein the acquisition request is used for requesting a global identifier, the acquisition request comprises the indication information, and the indication information is used for indicating whether the global identifier is in a digital sequence form or a mixed sequence form;
generating a target mixed sequence in response to receiving a second acquisition request, wherein the second acquisition request is used for requesting to acquire a global identifier in the form of a mixed sequence, and the mixed sequence comprises letters and numbers;
and returning the target mixing sequence to the electronic equipment sending the second acquisition request.
6. The method of claim 5, wherein the generating a target mixing sequence in response to receiving a second acquisition request comprises:
in response to determining that the predefined position of the second acquisition request is empty, acquiring a preset first number of characters from a preset character set to generate a first mixed sequence;
adjusting the character position in the first mixing sequence, generating a second mixing sequence, and determining the second mixing sequence as the target mixing sequence.
7. The method of claim 6, wherein the adjusting the character positions in the first blended sequence to generate a second blended sequence comprises:
determining binary codes corresponding to all characters in the first mixed sequence from an ASCII code comparison table;
and arranging the characters in the first mixed sequence according to the sequence of the binary codes from large to small to obtain a second mixed sequence.
8. The method of claim 5, wherein the generating a target mixing sequence in response to receiving a second acquisition request comprises:
in response to determining that the predefined location in the second acquisition request is not empty, acquiring a parameter in the predefined location as a third mixing sequence;
generating a last sequence of a third mixed sequence, and determining the last sequence as the target mixed sequence, wherein the last sequence and the third mixed sequence have the following relation: and arranging the sequences in the sequence set in ascending lexicographic order, wherein the last sequence is one bit before the third mixed sequence, and the sequence set comprises the sequences generated by adjusting the positions of the elements in the parameters.
9. The method of claim 8, wherein the generating a last sequence of the third mixed sequence comprises:
and performing bit adjacent poor on the third mixed sequence, wherein the bit adjacent poor comprises: determining whether the front character is larger than the rear character between two adjacent characters, and if so, interchanging positions;
and performing non-adjacent bit poor on the third mixed sequence passing through the adjacent bit poor, wherein the non-adjacent bit poor comprises: determining whether a front character is larger than a rear character between two non-adjacent characters, and if so, interchanging the positions of the two non-adjacent characters; for a first subsequence taking two non-adjacent characters as heads and tails, arranging parts except the first character in the first subsequence in a reverse sequence in a lexicographic order;
and for a third mixed sequence with poor non-adjacent bits, performing a shift operation to obtain the previous sequence, wherein the shift operation includes: determining the part except the head and tail characters in the third mixed sequence which is subjected to the non-adjacent bit poor processing as a second subsequence; determining whether the second subsequence conforms to an ascending lexicographic order; if yes, the character which is smaller than the first character of the third mixed sequence in the second subsequence and has the smallest absolute value of difference is exchanged with the first character of the third mixed sequence; and arranging the exchanged second subsequence in a reverse order according to the dictionary order to obtain the previous sequence.
10. A global identity generation apparatus comprising:
the acquisition unit is configured to acquire a current time point in response to receiving a first acquisition request, wherein the first acquisition request is used for requesting to acquire the global identification in the form of a digital sequence;
a first generating unit configured to generate a target digit sequence according to a difference between a preset future time point and the current time point;
a first returning unit configured to return the target number sequence to the electronic device that sent the first acquisition request.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9.
12. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-9.
CN201910889603.4A 2019-09-19 2019-09-19 Global identification generation method and device Pending CN110598068A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910889603.4A CN110598068A (en) 2019-09-19 2019-09-19 Global identification generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910889603.4A CN110598068A (en) 2019-09-19 2019-09-19 Global identification generation method and device

Publications (1)

Publication Number Publication Date
CN110598068A true CN110598068A (en) 2019-12-20

Family

ID=68861361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910889603.4A Pending CN110598068A (en) 2019-09-19 2019-09-19 Global identification generation method and device

Country Status (1)

Country Link
CN (1) CN110598068A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111353772A (en) * 2020-02-24 2020-06-30 网银在线(北京)科技有限公司 Method and device for generating single number, storage medium and electronic device
CN115510815A (en) * 2022-11-17 2022-12-23 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Rule-based identification generation method and apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5428645A (en) * 1992-11-03 1995-06-27 International Business Machines Corporation Anonymous time synchronization method
CN109309736A (en) * 2017-07-28 2019-02-05 北京京东尚科信息技术有限公司 The generation method and generating means of globally unique ID
CN109697133A (en) * 2018-12-28 2019-04-30 广州华多网络科技有限公司 ID generation method, apparatus and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5428645A (en) * 1992-11-03 1995-06-27 International Business Machines Corporation Anonymous time synchronization method
CN109309736A (en) * 2017-07-28 2019-02-05 北京京东尚科信息技术有限公司 The generation method and generating means of globally unique ID
CN109697133A (en) * 2018-12-28 2019-04-30 广州华多网络科技有限公司 ID generation method, apparatus and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111353772A (en) * 2020-02-24 2020-06-30 网银在线(北京)科技有限公司 Method and device for generating single number, storage medium and electronic device
CN111353772B (en) * 2020-02-24 2024-01-16 网银在线(北京)科技有限公司 Single number generation method and device, storage medium and electronic device
CN115510815A (en) * 2022-11-17 2022-12-23 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Rule-based identification generation method and apparatus
CN115510815B (en) * 2022-11-17 2023-03-28 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Rule-based identification generation method and apparatus

Similar Documents

Publication Publication Date Title
CN111104479A (en) Data labeling method and device
CN102971703A (en) Enhancing an inquiry for a search of a database
CN108933695B (en) Method and apparatus for processing information
CN110598068A (en) Global identification generation method and device
CN114817651B (en) Data storage method, data query method, device and equipment
CN111784318A (en) Data processing method and device, electronic equipment and storage medium
CN112818026A (en) Data integration method and device
CN108804451B (en) Method and device for generating primary key, electronic equipment and readable storage medium
CN113590756A (en) Information sequence generation method and device, terminal equipment and computer readable medium
CN113220705A (en) Slow query identification method and device
CN116204428A (en) Test case generation method and device
CN114201466B (en) Anti-cache breakdown method, device, equipment and readable storage medium
CN107977381B (en) Data configuration method, index management method, related device and computing equipment
CN109308299B (en) Method and apparatus for searching information
CN110413165B (en) Icon configuration method and device, electronic equipment and computer readable medium
CN107656985B (en) Webpage query method and system
CN114547184A (en) Personnel information synchronization method, terminal device and storage medium
CN109426358B (en) Information input method and device
CN113779048A (en) Data processing method and device
CN113760695A (en) Method and device for positioning problem code
CN112131287A (en) Method and device for reading data
CN110795604A (en) Method, apparatus, computing device and medium for generating transaction serial number
CN109426356B (en) Information input method and device
CN110019336B (en) Method and device for querying data
CN114449031B (en) Information acquisition method, device, equipment and storage medium

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
CB02 Change of applicant information

Address after: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Applicant after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Applicant before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address after: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176

Applicant before: Jingdong Digital Technology Holding Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20191220

RJ01 Rejection of invention patent application after publication