CN112597740A - Serial number generation method and server for generating serial number in distributed system - Google Patents

Serial number generation method and server for generating serial number in distributed system Download PDF

Info

Publication number
CN112597740A
CN112597740A CN202011554683.7A CN202011554683A CN112597740A CN 112597740 A CN112597740 A CN 112597740A CN 202011554683 A CN202011554683 A CN 202011554683A CN 112597740 A CN112597740 A CN 112597740A
Authority
CN
China
Prior art keywords
code
information
server
serial number
date
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
CN202011554683.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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202011554683.7A priority Critical patent/CN112597740A/en
Publication of CN112597740A publication Critical patent/CN112597740A/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
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a serial number generation method and a server for generating serial numbers in a distributed system. The method comprises the following steps: the server obtains date information and time information when receiving a calling request of the service equipment; the server processes according to the date information to obtain a 3-bit date code; processing according to the time information to obtain 5-bit time code; and the server generates a serial number corresponding to the calling request according to the code, the date code and the time code of the server. According to the technical scheme, by encoding and compressing the date information and the time information, the length of the time element in the serial number is shortened, the reading performance of the serial number is improved, and the work of the financial system is convenient. The method can be independently realized by the server, does not depend on a database and third-party storage, can realize the generation of serial numbers at high concurrency, and has high generation speed. And a serial number is generated according to the code of the server, so that the repeated probability of the serial number is reduced, and the accuracy of checking and tracking is improved.

Description

Serial number generation method and server for generating serial number in distributed system
Technical Field
The present application relates to the field of computer technologies, and in particular, to a serial number generation method and a server for generating a serial number in a distributed system.
Background
In the financial industry, when transacting financial services for users, it is often necessary to use service equipment, such as Automatic Teller Machines (ATMs), super counters, autonomous service terminals, number machines, and the like. With the continuous development of information technology and internet technology, the emerging technology is continuously fused with bank service, the materialization removal characteristic of financial transaction is highlighted, the customer experience requirement is continuously improved, the requirements of bank outlets for intellectualization, light weight and marketing transformation are continuously improved, and the putting strength of banks to business equipment is continuously increased at present. This results in increasing difficulty in centralized management of business devices.
In the prior art, a serial number generator of a background service system of business equipment often depends on database storage, and the speed of acquiring serial numbers is slow, the performance is not high, and fields are redundant. The serial number usually directly contains an 8-bit date and an 8-bit time. For example, 20 minutes 55 seconds 95 milliseconds at 13 days 5 and 20 of 2015 are represented in serial number as 2015052013205595. Each serial number generated by the server is typically sent to the accounting system for verification and is therefore not repeatable and guaranteed to be traceable. In the prior art, the generation speed of serial numbers is slow; the time elements in the serial number are too long, so that the performance is poor, and inconvenience is brought to the work of an accounting system. In addition, the uniqueness of the serial number cannot be guaranteed.
Disclosure of Invention
Based on the above problems, the present application provides a serial number generation method and a serial number generator, so as to shorten the length of the time element in the serial number, accelerate the serial number generation speed, and reduce the repetition probability of the serial number.
The embodiment of the application discloses the following technical scheme:
in a first aspect, the present application provides a serial number generation method applied to a server, including:
acquiring date information and time information when a call request of the service equipment is received;
processing according to the date information to obtain a 3-bit date code; processing according to the time information to obtain 5-bit time code;
and generating a serial number corresponding to the calling request according to the code of the server, the date code and the time code.
Optionally, the above method further comprises: and sending the serial number to an accounting system so that the accounting system checks according to the serial number.
Optionally, the date information includes: year information, month information, and day information;
the processing according to the date information to obtain the 3-bit date code specifically includes:
carrying out 62-system coding processing on the year information, carrying out 16-system coding processing on the month information, and carrying out 36-system coding processing on the day information to obtain the 3-bit date code; the 3 bits correspond to the year information, the month information, and the day information, respectively.
Optionally, the time information includes: hour information, minute information, second information, and millisecond information;
the processing according to the time information to obtain a 5-bit time code specifically includes:
carrying out 36-bit encoding processing on the hour information, carrying out 62-bit encoding on the minute information, carrying out 62-bit encoding on the second information, and carrying out 2-bit 62-bit encoding on the millisecond information to obtain the 5-bit time code; 3 bits of the 5 bits correspond to the hour information, the minute information, and the second information, respectively, and the remaining 2 bits of the 5 bits collectively correspond to the millisecond information.
Optionally, the above method further comprises:
obtaining a hostname of the server;
and after removing the preset symbol from the host name, taking the remaining last 3 bits as the code of the server.
Optionally, the above method further comprises:
and when the residual digit in the host name is less than 3 bits after the preset symbol is removed from the host name, filling the residual digit to 3 bits by using a preset filling character, and taking the filled 3 bits as the code of the server.
Optionally, the above method further comprises:
acquiring a terminal number code of the service equipment; the terminal number coding comprises: province number and logical terminal number;
the generating of the serial number corresponding to the call request according to the code of the server, the date code and the time code specifically includes:
and generating a serial number corresponding to the calling request according to the code of the server, the province number, the logic terminal number, the date code and the time code.
Optionally, the above method further comprises:
obtaining a log serial number of the server; the log serial number of the server adopts 3-bit 10-system coding;
the generating of the serial number corresponding to the call request according to the code of the server, the province number, the logic terminal number, the date code and the time code specifically includes:
and generating a serial number corresponding to the calling request according to the code of the server, the province number, the logic terminal number, the date code, the time code and the log serial number of the server.
Optionally, the log serial number of the server is automatically increased from 000 to 999, and the method further includes:
when the log serial number of the server rises to 999, counting is restarted from 000; and/or the presence of a gas in the gas,
and after the server is restarted, the log sequence number of the server is cleared and the counting is restarted from 000.
Optionally, the generating a serial number corresponding to the call request according to the code of the server, the province number, the logic terminal number, the date code, the time code, and the log serial number of the server specifically includes:
and generating a serial number corresponding to the calling request by adopting a combination mode of a code of 3 bits of the server, a code of 2 bits of the province number, a code of 4 bits of the logic terminal, a code of 3 bits of the date, a code of 5 bits of the time, and a log serial number of 3 bits.
Optionally, the service device is a self-service device.
In a second aspect, the present application provides a server for generating serial numbers in a distributed system, including:
the acquisition module is used for acquiring date information and time information when a calling request of the service equipment is received;
the processing module is used for processing according to the date information to obtain a 3-bit date code; processing according to the time information to obtain 5-bit time code;
and the generation module is used for generating the serial number corresponding to the calling request according to the code of the server, the date code and the time code.
Optionally, the above server further comprises:
and the sending module is used for sending the serial number to an accounting system so that the accounting system can check according to the serial number.
Optionally, the date information includes: year information, month information, and day information;
the processing module is specifically configured to perform 62-ary coding processing on the year information, perform 16-ary coding processing on the month information, and perform 36-ary coding processing on the day information to obtain the 3-bit date code; the 3 bits correspond to the year information, the month information, and the day information, respectively.
Optionally, the time information includes: hour information, minute information, second information, and millisecond information;
the processing according to the time information to obtain a 5-bit time code specifically includes:
the processing module is specifically configured to perform 36-bit encoding processing on the hour information, perform 62-bit encoding on the minute information, perform 62-bit encoding on the second information, and perform 2-bit 62-bit encoding on the millisecond information to obtain the 5-bit time code; 3 bits of the 5 bits correspond to the hour information, the minute information, and the second information, respectively, and the remaining 2 bits of the 5 bits collectively correspond to the millisecond information.
Optionally, the obtaining module is further configured to obtain a hostname of the server;
the processing module is further configured to remove a preset symbol from the host name, and use the remaining last 3 bits as the code of the server.
Optionally, the processing module is further configured to, when a remaining bit number in the host name is less than 3 bits after a preset symbol is removed from the host name, fill the remaining bit number to 3 bits with a preset padding character, and use the padded 3 bits as the code of the server.
Optionally, the obtaining module is further configured to obtain a terminal number code of the service device; the terminal number coding comprises: province number and logical terminal number;
the generation module is specifically configured to generate a serial number corresponding to the call request according to the code of the server, the province number, the logic terminal number, the date code, and the time code.
Optionally, the obtaining module is further configured to obtain a log serial number of the server; the log serial number of the server adopts 3-bit 10-system coding;
the generation module is specifically configured to generate a serial number corresponding to the call request according to the code of the server, the province number, the logic terminal number, the date code, the time code, and the log serial number of the server.
Optionally, the log serial number of the server is automatically increased from 000 to 999, and when the log serial number of the server rises to 999, the counting is restarted from 000; and/or, after the server is restarted, the log sequence number of the server is cleared and the counting is restarted from 000.
Optionally, the generating module is specifically configured to generate the serial number corresponding to the call request in a combination manner of a code of 3 bits of the server, +2 bits of the province number, +4 bits of the logic terminal number, +3 bits of the date code, +5 bits of the time code, and +3 bits of the log serial number.
Compared with the prior art, the method has the following beneficial effects:
the serial number generation method provided by the embodiment of the application comprises the following steps: the server obtains date information and time information when receiving a calling request of the service equipment; the server processes according to the date information to obtain a 3-bit date code; processing according to the time information to obtain 5-bit time code; and the server generates a serial number corresponding to the calling request according to the code of the server, the date code and the time code. According to the technical scheme, by encoding and compressing the date information and the time information, the length of the time element in the serial number is shortened, the reading performance of the serial number is improved, and the work of the financial system is convenient. In addition, the generation method can be independently realized by the server, does not depend on a database and third-party storage, can realize the generation of serial numbers at high concurrency, and has high generation speed. In addition, the serial number is generated according to the code of the server, the repeated probability of the serial number is reduced, and the accuracy of checking and tracking is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a serial number generation method provided in an embodiment of the present application;
fig. 2 is a flowchart of another serial number generation method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a server for generating serial numbers in a distributed system according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a server for generating serial numbers in another distributed system according to an embodiment of the present application.
Detailed Description
As described above, the current method for generating serial numbers mainly depends on database storage, and the generation speed is slow; the time elements in the serial number are too long and inconvenient to read, so that the working performance of the accounting system is influenced; it is difficult to avoid generating duplicate serial numbers. Based on the above problems, the inventors have studied to provide a serial number generation method and a server for generating a serial number in a distributed system.
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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 application.
Method embodiment
Referring to fig. 1, the figure is a flowchart of a serial number generation method provided in an embodiment of the present application. As shown in fig. 1, the method includes:
s101: the server obtains date information and time information when the call request of the service device is received.
In a distributed system, a plurality of servers are included. Each server may be communicatively coupled to a plurality of service devices. When a service device receives a service processing request of a user, a call request can be sent to a server connected with the service device, so that the server can generate a serial number according to the call request.
The server may record date information and time information while receiving the call request. The date information includes: year information, month information, and day information; the time information includes: hour information, minute information, second information, and millisecond information. For example, if the call request is received at 13 o 'clock 47 min 50 sec 500 msec on 12 d 12 m 2020, the date information is 12 d 5 m 2020, and the time information is 500 msec 13 o' clock 47 min 50 sec.
S102: the server processes according to the date information to obtain a 3-bit date code; and processing according to the time information to obtain 5-bit time code.
As an example implementation manner, the processing in S102 according to the date information to obtain a 3-bit date code specifically includes:
carrying out 62-system coding processing on the year information, carrying out 16-system coding processing on the month information and carrying out 36-system coding processing on the day information to obtain a 3-bit date code; the 3 bits correspond to year information, month information, and day information, respectively.
By way of example, the year information is encoded with 2020 as the origin of the count, 0 in 2020, 1 in 2021, a in 2030, and Z in 2082, and the binary comparison table is described in the appendix. The month information is coded in 16-system from 1-9 to 1-9, and A, B, C respectively identifies 10 months, 11 months and 12 months. The code of the day information adopts 36-system, 1-9 respectively mark 1-9 days, A-V respectively mark 10-31 days, and the system comparison table is shown in the appendix.
Note that the notation in the appendix is merely illustrative and is not intended to limit the processing method of the date code.
As an example implementation manner, the processing in S102 according to the time information to obtain a 5-bit time code specifically includes:
carrying out 36-bit encoding processing on the hour information, carrying out 62-bit encoding on the minute information, carrying out 62-bit encoding on the second information, and carrying out 2-bit 62-bit encoding on the millisecond information to obtain 5-bit time encoding; 3 bits of the 5 bits correspond to hour information, minute information, and second information, respectively, and the remaining 2 bits of the 5 bits collectively correspond to millisecond information.
By way of example, the hour information is coded in 36-ary notation with 0-9 identifying 0-9 points and A-N identifying 10-23 points. The minute information is coded by a 62-system code and is marked by 0-9 to 0-9, the a-z mark is marked by 10 to 35, and the A-X mark is marked by 36 to 59. The second information is coded with 62, and is identified by 0-9 for 0-9 seconds, a-z for 10 seconds to 35 seconds, and A-X for 36 seconds to 59 seconds. The millisecond information is coded by 2-bit 62 system, and the system comparison table is detailed in the appendix.
S103: and the server generates a serial number corresponding to the calling request according to the code, the date code and the time code of the server.
In a distributed system, each server has its own ID code. An implementation of obtaining the ID code of the server is described below. First, the hostname (hostname) of the server may be obtained; then, after removing the preset symbol from the host name, the remaining last 3 bits are used as the code of the server. The preset symbols include: ' - ', ' and the like. For example, a server with a hostname GSTV-a-11, whose ID is encoded as a 11. One possible scenario is: when the predetermined symbol is removed from the host name, the remaining number of bits in the host name is less than 3 bits. At this time, the remaining number of bits can be padded to 3 bits by using the preset padding character, and the padded 3 bits are used as the code of the server. In one example, the padding character is preset to 'H'.
The above is the serial number generation method provided in the embodiment of the present application. By processing the date information and the time information, the method shortens the length of the time element in the serial number, improves the reading performance of the serial number and facilitates the work of an accounting system. For example, the prior art requires that the date and time be expressed in 8 bits in the serial number, respectively. In the embodiment of the present application, the date can be expressed by 3 bits, and the time can be expressed by 5 bits, and the time is also accurate to millisecond. In addition, the generation method can be independently realized by the server, does not depend on a database and third-party storage, can realize the generation of serial numbers at high concurrency, and has high generation speed. In addition, the serial number is generated according to the code of the server, the repeated probability of the serial number is reduced, and the accuracy of checking and tracking is improved. For example, according to the method provided by the embodiment of the present application, even different servers generate different serial numbers at the same time.
In order to further reduce the repetition probability of serial numbers, the embodiment of the application also provides another serial number generation method. The following description is made with reference to the embodiments and the accompanying drawings.
Referring to fig. 2, the figure is a flowchart of another serial number generation method provided in the embodiment of the present application. As shown in fig. 2, the method includes:
s201: the server obtains date information and time information when the call request of the service device is received.
S202: the server processes according to the date information to obtain a 3-bit date code; and processing according to the time information to obtain 5-bit time code.
S201 to S202 are substantially the same as the implementations of S101 to S102 in the foregoing embodiments, and reference may be made to the description of the foregoing embodiments, which are not repeated herein.
S203: the server obtains the code of the server.
The manner of obtaining the ID code of the server is described in the foregoing embodiment S103, which can be understood by reference and will not be described herein.
S204: the server obtains a terminal number code of the service equipment; the terminal number coding comprises: a province number and a logical terminal number.
The terminal number of the service equipment is coded by 6 bits, wherein the first 2 bits are provincial numbers, and the last 4 bits are logic terminal numbers. The terminal number code may be obtained from a message sent by the service device. In the message, the character string containing the province number and the logical terminal number may be generally interspersed with other characters, for example, 000 or the like, between the province number and the logical terminal number. If the character string in the message is 410001234, the first two digits of the character string are 41-digit provinces, and the last four digits 1234 are the logical terminal numbers. The provincial number represents the geographical position of the service equipment, and the logic terminal number is the only code of the service equipment and is used for distinguishing other service equipment.
S205: the server obtains a log serial number of the server; the log serial number of the server adopts 3-bit 10-system coding.
The log sequence number of the server automatically increases from 000 to 999. Even if the code of the server, the date code and the time code are the same, serial numbers corresponding to different call requests can be distinguished through different log serial numbers.
In one possible implementation, when the server's log sequence number rises to 999, the count is restarted from 000; and/or, when the server is restarted, the log sequence number of the server is cleared and the counting is restarted from 000. The re-counting of log sequence numbers avoids duplication or errors of the generated serial numbers.
S206: and the server generates a serial number corresponding to the calling request according to the code, the province number, the logic terminal number, the date code, the time code and the log serial number of the server.
In one possible implementation of S206, the serial number may be generated in the following manner: and generating a serial number corresponding to the call request by adopting a combination mode of a code of a 3-bit server, a 2-bit province number, a 4-bit logic terminal number, a 3-bit date code, a 5-bit time code and a 3-bit log serial number. Of course, the above combination is not limited to the sequential combination of codes or numbers in the serial number. For example, the combination mode of serial numbers can also be 3-bit date coding + 5-bit time coding + 3-bit log serial number + 3-bit server coding + 2-bit province number + 4-bit logic terminal number.
For example, a server with hostname GSTV-a-11 processes a message from a service device (the string in the message includes 410001234) at 13 o 'clock, 47 min 50 sec 500 ms at 12 o' clock, 5/12/2020, and the current server has a log serial number of 034. The generated serial number is: a1141123405CDLO 84034. The system comparison table is detailed in the appendix.
In the above embodiment, the server generates the serial number corresponding to the call request according to the code, the provincial number, the logic terminal number, the date code, the time code and the log serial number of the server, so that the serial number and the call request have unique correspondence, and the serial number is ensured not to be repeated. Therefore, the accounting system can check the business equipment and accurately track the business processed by the business equipment according to the serial number.
After S201 to S206, the method provided in the embodiment of the present application may further include:
s207: and the server sends the serial number to the accounting system so that the accounting system checks according to the serial number.
The service devices described in the above embodiments include self-service devices. Such as self-service equipment like ATMs, super counters, self-service terminals, call machines, etc., where the type and function of the business equipment is not limited.
Server embodiment
Based on the serial number generation method provided by the foregoing embodiment, the present application further provides a server for generating a serial number in a distributed system. The following description is made with reference to the embodiments and the accompanying drawings.
Referring to fig. 3, this figure is a schematic structural diagram of a server that generates a serial number in a distributed system according to an embodiment of the present application. As shown in fig. 3, the server includes:
an obtaining module 301, configured to obtain date information and time information when a call request of a service device is received;
a processing module 302, configured to perform processing according to the date information to obtain a 3-bit date code; processing according to the time information to obtain 5-bit time code;
a generating module 303, configured to generate a serial number corresponding to the call request according to the code of the server, the date code, and the time code.
The server processes the date information and the time information, so that the length of a time element in the serial number is shortened, the reading performance of the serial number is improved, and the work of an accounting system is convenient and fast. For example, the prior art requires that the date and time be expressed in 8 bits in the serial number, respectively. In the embodiment of the present application, the date can be expressed by 3 bits, and the time can be expressed by 5 bits, and the time is also accurate to millisecond. In addition, the server independently generates serial numbers, does not depend on a database and third-party storage, can realize the generation of the serial numbers at high concurrency, and is high in generation speed. In addition, the serial number is generated according to the code of the server, the repeated probability of the serial number is reduced, and the accuracy of checking and tracking is improved. For example, according to the server provided in the embodiment of the present application, even if different servers are provided, the serial numbers generated at the same time are different.
As shown in the schematic structural diagram of the server shown in fig. 4, optionally, the server further includes:
a sending module 304, configured to send the serial number to an accounting system, so that the accounting system performs verification according to the serial number.
Optionally, the date information includes: year information, month information, and day information;
the processing module 302 is specifically configured to perform 62-ary coding processing on the year information, perform 16-ary coding processing on the month information, and perform 36-ary coding processing on the day information to obtain the 3-bit date code; the 3 bits correspond to the year information, the month information, and the day information, respectively.
Optionally, the time information includes: hour information, minute information, second information, and millisecond information;
the processing according to the time information to obtain a 5-bit time code specifically includes:
the processing module 302 is specifically configured to perform 36-bit binary coding processing on the hour information, perform 62-bit binary coding on the minute information, perform 62-bit binary coding on the second information, and perform 2-bit 62-bit binary coding on the millisecond information to obtain the 5-bit time code; 3 bits of the 5 bits correspond to the hour information, the minute information, and the second information, respectively, and the remaining 2 bits of the 5 bits collectively correspond to the millisecond information.
Optionally, the obtaining module 301 is further configured to obtain a hostname of the server;
the processing module 302 is further configured to remove a preset symbol from the host name, and then use the remaining last 3 bits as the code of the server.
Optionally, the processing module 302 is further configured to, when the remaining number of bits in the host name is less than 3 bits after removing the preset symbol from the host name, fill the remaining number of bits to 3 bits with a preset padding character, and use the padded 3 bits as the code of the server.
Optionally, the obtaining module 301 is further configured to obtain a terminal number code of the service device; the terminal number coding comprises: province number and logical terminal number;
the generating module 303 is specifically configured to generate a serial number corresponding to the call request according to the code of the server, the province number, the logic terminal number, the date code, and the time code.
Optionally, the obtaining module 301 is further configured to obtain a log serial number of the server; the log serial number of the server adopts 3-bit 10-system coding;
the generating module 303 is specifically configured to generate a serial number corresponding to the call request according to the code of the server, the province number, the logic terminal number, the date code, the time code, and the log serial number of the server.
Optionally, the log serial number of the server is automatically increased from 000 to 999, and when the log serial number of the server rises to 999, the counting is restarted from 000; and/or, after the server is restarted, the log sequence number of the server is cleared and the counting is restarted from 000.
Optionally, the generating module 303 is specifically configured to generate the serial number corresponding to the call request by using a combination manner of a code of the 3 bits server, the +2 bits of the province number, the +4 bits of the logic terminal number, the +3 bits of the date code, the +5 bits of the time code, and the +3 bits of the log serial number.
In the above embodiment, the server generates the serial number corresponding to the call request according to the code, the provincial number, the logic terminal number, the date code, the time code and the log serial number of the server, so that the serial number and the call request have unique correspondence, and the serial number is ensured not to be repeated. Therefore, the accounting system can check the business equipment and accurately track the business processed by the business equipment according to the serial number.
The above description is only one specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Appendix: carry system comparison table
Figure BDA0002858010740000121
Figure BDA0002858010740000131
Figure BDA0002858010740000141
Figure BDA0002858010740000151

Claims (10)

1. A serial number generation method applied to a server comprises the following steps:
acquiring date information and time information when a call request of the service equipment is received;
processing according to the date information to obtain a 3-bit date code; processing according to the time information to obtain 5-bit time code;
and generating a serial number corresponding to the calling request according to the code of the server, the date code and the time code.
2. The method of claim 1, further comprising: and sending the serial number to an accounting system so that the accounting system checks according to the serial number.
3. The method of claim 1, wherein the date information comprises: year information, month information, and day information;
the processing according to the date information to obtain the 3-bit date code specifically includes:
carrying out 62-system coding processing on the year information, carrying out 16-system coding processing on the month information, and carrying out 36-system coding processing on the day information to obtain the 3-bit date code; the 3 bits correspond to the year information, the month information, and the day information, respectively.
4. The method of claim 1, wherein the time information comprises: hour information, minute information, second information, and millisecond information;
the processing according to the time information to obtain a 5-bit time code specifically includes:
carrying out 36-bit encoding processing on the hour information, carrying out 62-bit encoding on the minute information, carrying out 62-bit encoding on the second information, and carrying out 2-bit 62-bit encoding on the millisecond information to obtain the 5-bit time code; 3 bits of the 5 bits correspond to the hour information, the minute information, and the second information, respectively, and the remaining 2 bits of the 5 bits collectively correspond to the millisecond information.
5. The method of claim 1, further comprising:
obtaining a hostname of the server;
and after removing the preset symbol from the host name, taking the remaining last 3 bits as the code of the server.
6. The method of claim 5, further comprising:
and when the residual digit in the host name is less than 3 bits after the preset symbol is removed from the host name, filling the residual digit to 3 bits by using a preset filling character, and taking the filled 3 bits as the code of the server.
7. The method of any one of claims 1-6, further comprising:
acquiring a terminal number code of the service equipment; the terminal number coding comprises: province number and logical terminal number;
the generating of the serial number corresponding to the call request according to the code of the server, the date code and the time code specifically includes:
and generating a serial number corresponding to the calling request according to the code of the server, the province number, the logic terminal number, the date code and the time code.
8. The method of claim 7, further comprising:
obtaining a log serial number of the server; the log serial number of the server adopts 3-bit 10-system coding;
the generating of the serial number corresponding to the call request according to the code of the server, the province number, the logic terminal number, the date code and the time code specifically includes:
and generating a serial number corresponding to the calling request according to the code of the server, the province number, the logic terminal number, the date code, the time code and the log serial number of the server.
9. The method according to claim 8, wherein the generating a serial number corresponding to the call request according to the code of the server, the province number, the logical terminal number, the date code, the time code, and the log serial number of the server specifically includes:
and generating a serial number corresponding to the calling request by adopting a combination mode of a code of 3 bits of the server, a code of 2 bits of the province number, a code of 4 bits of the logic terminal, a code of 3 bits of the date, a code of 5 bits of the time, and a log serial number of 3 bits.
10. A server for generating serial numbers in a distributed system, comprising:
the acquisition module is used for acquiring date information and time information when a calling request of the service equipment is received;
the processing module is used for processing according to the date information to obtain a 3-bit date code; processing according to the time information to obtain 5-bit time code;
and the generation module is used for generating the serial number corresponding to the calling request according to the code of the server, the date code and the time code.
CN202011554683.7A 2020-12-24 2020-12-24 Serial number generation method and server for generating serial number in distributed system Pending CN112597740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011554683.7A CN112597740A (en) 2020-12-24 2020-12-24 Serial number generation method and server for generating serial number in distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011554683.7A CN112597740A (en) 2020-12-24 2020-12-24 Serial number generation method and server for generating serial number in distributed system

Publications (1)

Publication Number Publication Date
CN112597740A true CN112597740A (en) 2021-04-02

Family

ID=75202127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011554683.7A Pending CN112597740A (en) 2020-12-24 2020-12-24 Serial number generation method and server for generating serial number in distributed system

Country Status (1)

Country Link
CN (1) CN112597740A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023108627A1 (en) * 2021-12-17 2023-06-22 深圳晶泰科技有限公司 Resource encoding method, apparatus, and system, and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850619A (en) * 2015-05-15 2015-08-19 深圳市金蝶友商电子商务服务有限公司 Receipt code generation method and apparatus
CN106412035A (en) * 2016-09-14 2017-02-15 联动优势电子商务有限公司 Serial number generation method and terminal
CN109002276A (en) * 2018-06-19 2018-12-14 深圳市买买提信息科技有限公司 serial number generation method, device, terminal device and storage medium
CN110619114A (en) * 2019-09-26 2019-12-27 北京明略软件系统有限公司 Serial number generation method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850619A (en) * 2015-05-15 2015-08-19 深圳市金蝶友商电子商务服务有限公司 Receipt code generation method and apparatus
CN106412035A (en) * 2016-09-14 2017-02-15 联动优势电子商务有限公司 Serial number generation method and terminal
CN109002276A (en) * 2018-06-19 2018-12-14 深圳市买买提信息科技有限公司 serial number generation method, device, terminal device and storage medium
CN110619114A (en) * 2019-09-26 2019-12-27 北京明略软件系统有限公司 Serial number generation method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023108627A1 (en) * 2021-12-17 2023-06-22 深圳晶泰科技有限公司 Resource encoding method, apparatus, and system, and electronic device

Similar Documents

Publication Publication Date Title
CN105589885B (en) A kind of method and system of consistency verification of data
US7743996B2 (en) System and method for data entry
RU2198425C2 (en) System for cryptographic protection of transmitted information
CN106412035A (en) Serial number generation method and terminal
CN110765478B (en) Big data information secure storage encryption system and method thereof
CN110377268A (en) Serial number generation method, device and storage medium
CN112597740A (en) Serial number generation method and server for generating serial number in distributed system
CN115884110A (en) Method and system for judging short message verification code
CN107634765A (en) A kind of Internet of Things coding method and system
CN112751676B (en) Signing and certification method, hash value generation method, certification equipment and storage medium
EP2933943A1 (en) Storage efficient and unconditionally secure private information retrieval
CN110276609B (en) Business data processing method and device, electronic equipment and computer readable medium
CN106953880B (en) Data processing method and system, sub server and main server
EP3872733A1 (en) Communication of sensitive data in restricted data channel
CN110570194A (en) hardware wallet recovery method and device and hardware wallet
CN113672771A (en) Data entry processing method and device, medium and electronic equipment
US20220209956A1 (en) Method for performing a transaction on the block chain and computer program product
CN111984450A (en) Configuration fault positioning method and system based on mirror image binary comparison
CN111147482A (en) OTP algorithm-based identity identification code generation and verification method
CN111325599A (en) Order data processing method, device, equipment and storage medium
CN109885555A (en) A kind of user information management method and device
CN103325063A (en) Test major test report inquiry and verification system
CN116828404B (en) Industry short message accurate sending method and device, electronic equipment and medium
CN117852072A (en) Position verification method based on hidden trace query
US10216942B1 (en) Method for preserving the integrity of stored data

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