Sequence number processing method, server, computer device and storage medium
By creating and managing the original records of serial numbers, generating allocation records, and supporting the release and reuse of serial numbers, the problems of auto-incrementing serial numbers occupying many positions, consuming a large amount of storage, and having low query efficiency are solved, thus achieving efficient serial number management and storage space optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN BANK CO LTD
- Filing Date
- 2022-07-21
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies suffer from problems such as large number of spaces occupied by auto-incrementing serial numbers, high storage requirements, and low query efficiency.
By creating the original record of the serial number, an allocation record is generated and the allocated serial number is returned. The serial number primary key is short, a two-level caching strategy is adopted, most operations are completed in memory, and the release and reuse of serial numbers are supported, reducing storage space.
It achieves efficient allocation and release of serial numbers, reduces storage space requirements, improves query efficiency, and is suitable for various database types.
Smart Images

Figure CN115391334B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, specifically to a serial number processing method, server, computer equipment, and storage medium. Background Technology
[0002] Serial numbers are used to uniquely identify system elements and are widely used in the internet field, where optimization is possible. However, auto-incrementing serial numbers have disadvantages such as remaining occupied even after release and overflow going unnoticed. Auto-incrementing serial numbers rely on the assumption that they will never reach their usage limit, necessitating a very long maximum length. This results in a large number of bytes occupied and a large storage requirement, leading to low efficiency in serial number lookups. Summary of the Invention
[0003] In view of this, this application provides a serial number processing method, server, computer equipment, and storage medium to solve the problems of large number of bits occupied, large storage consumption, and low query efficiency of auto-incrementing serial numbers in the prior art.
[0004] To address the aforementioned technical problems, the first technical solution provided in this application is: a method for processing serial numbers, comprising: creating an original record of serial numbers, wherein the serial number includes a primary key, a name, and a grouping representation, the original record including the primary key, the name, the grouping, the start number of the serial number, the end number of the serial number, and the current position; in response to an allocation request, generating an allocation record and returning the allocated sequence in the serial number, wherein the allocation record is represented as a record in the original record whose current position has been shifted one position backward.
[0005] Optionally, it further includes: in response to the current position being the same as the end number of the sequence number, reclaiming the corresponding allocation record.
[0006] Optionally, it further includes: in response to receiving a release sequence number, and the name and grouping of the release sequence number being the same as the name and grouping in the original record, adding a first sub-record in the allocation record to update the allocation record table, wherein the first sub-record represents the release sequence number, and the representation method of the first sub-record is the same as that of the allocation record, and it is located below the allocation record.
[0007] Optionally, it further includes: in response to another allocation request, processing the allocation record such that the first sub-record corresponding to the release sequence number is marked as allocated, and returning the release sequence number, wherein the other allocation request indicates a request to allocate the release sequence number.
[0008] Optionally, it further includes: obtaining the unreleased serial number from the updated allocation record, and adding a second sub-record to the updated allocation record, wherein the second sub-record represents the unreleased serial number, thereby releasing the unreleased serial number.
[0009] Optionally, the acquisition of the unreleased sequence number from the self-updated allocation record is performed at preset time intervals.
[0010] Optionally, the method further includes: obtaining consecutive sequence numbers from the updated allocation record, and modifying the allocation record based on the consecutive sequence numbers, wherein in the modified allocation record, the ending number of the first sequence number in the consecutive sequence numbers is modified to increase the number of consecutive sequence numbers, and the remaining sequence numbers in the consecutive sequence numbers are marked as modified; wherein the consecutive sequence numbers include a first sequence number and a second sequence number, wherein the ending number of the first sequence number is greater than the current position of the second sequence number, and the difference between the ending number of the first sequence number and the current position of the second sequence number is 1.
[0011] To address the aforementioned technical problems, the second technical solution provided in this application is: to provide a server, including a processor, a memory, and a transceiver, wherein the transceiver is used for communication connections with client terminals and bank terminals, the memory stores a computer program, and the processor is used to execute the computer program to implement the method described in any of the above-mentioned embodiments.
[0012] To address the aforementioned technical problems, the third technical solution provided in this application is: to provide a computer device, comprising: a processor and a memory, wherein the memory is connected to the processor and is used to store a computer program that can run on the processor; wherein, when the processor executes the computer program, it implements the method described in any of the above-mentioned embodiments.
[0013] To solve the above-mentioned technical problems, the fourth technical solution provided in this application is: to provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, to implement the method described in any of the above-mentioned methods.
[0014] The beneficial effects of this application are as follows: Unlike existing technologies, this application creates an original record of sequence numbers. Upon receiving an allocation request, it generates an allocation record and returns the allocated sequence from the sequence numbers. The allocation record is the record whose current position in the original record has been shifted one position forward. The primary key of the sequence number in this application is shorter, and the allocation and release of the sequence table only requires one record operation. If a two-level caching strategy is adopted, most operations can be completed in memory, resulting in high efficiency. It occupies less space. For an integer sequence number, recording each one individually might require up to 32GB of data space. However, using the method in this application, after optimization, only a small amount of data is needed; in most cases, 1MB of storage space is sufficient for most scenarios. It is reusable: obsolete sequence numbers can be released and reused. In contrast, auto-incrementing or date-incrementing sequences in a database cannot reuse sequence numbers. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is an overall flowchart of a serial number processing method provided in an embodiment of this application;
[0017] Figure 2 This is a schematic diagram of the allocation record provided in an embodiment of this application;
[0018] Figure 3 This is a schematic diagram of the query status of allocation records provided in an embodiment of this application;
[0019] Figure 4 This is a schematic diagram of the original record of the serial number provided in one embodiment of this application;
[0020] Figure 5 This is a schematic diagram of the state of the allocation record table when allocating a record according to an embodiment of this application;
[0021] Figure 6 This is a flowchart illustrating the process of reclaiming allocation records according to an embodiment of this application;
[0022] Figure 7 This is a schematic diagram of the status of an allocation record table for recovering an allocation record according to an embodiment of this application;
[0023] Figure 8 This is a schematic diagram of the status of the allocation record table for recovering three allocation records according to an embodiment of this application;
[0024] Figure 9 This is a schematic diagram of the status of an allocation record table for reallocating released serial numbers, provided in an embodiment of this application.
[0025] Figure 10 This is a flowchart illustrating the process of reallocating a released serial number according to an embodiment of this application;
[0026] Figure 11 This is a schematic diagram of the status of discarded but not released serial numbers in the allocation record table according to an embodiment of this application;
[0027] Figure 12 This is a schematic diagram of the status of a discarded serial number in the allocation record table after it has been released, according to an embodiment of this application.
[0028] Figure 13 This is a schematic diagram of the state of the allocation record table after the data content becomes fragmented, according to an embodiment of this application;
[0029] Figure 14 This is a schematic diagram of the status of the allocation record table after merging fragmented data once, according to an embodiment of this application;
[0030] Figure 15 This is a schematic diagram of the final state of the allocation record table after multiple merging of fragmented data according to an embodiment of this application;
[0031] Figure 16 This is a schematic diagram of the structure of a server provided in one embodiment of this application;
[0032] Figure 17 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0033] Figure 18 This is a schematic block diagram of the structure of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation
[0034] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0035] The terms "first" and "second" in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movements between components in a specific orientation (as shown in the figures). If the specific orientation changes, the directional indications will change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0036] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0037] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
[0038] To address the problems of excessive space usage, large storage requirements, and low query efficiency associated with auto-incrementing serial numbers in existing technologies, this application provides a serial number processing method, a server computer device, and a storage medium.
[0039] Please see Figures 1 to 5 , Figure 1This is an overall flowchart of a serial number processing method provided in an embodiment of this application. Figure 2 This is a schematic diagram of the allocation record provided in an embodiment of this application. Figure 3 This is a schematic diagram of the query status of allocation records provided in an embodiment of this application. Figure 4 This is a schematic diagram of the original record of the serial number provided in one embodiment of this application. Figure 5 This is a schematic diagram of the state of the allocation record table when allocating a record according to an embodiment of this application.
[0040] The serial number processing method provided in this application is mainly used for generating and managing serial numbers in a database, as well as querying serial numbers in the database. It has low storage space requirements and can be applied to most databases and serial number types. The database can be Oracle, etc., and this application does not limit it.
[0041] The serial number processing method of this application includes:
[0042] S1: Create the original record for the sequence number, where the sequence number includes the primary key, name, and grouping representation. The original record includes the primary key, name, group, start number of the sequence number, end number of the sequence number, and current position.
[0043] Specifically, the original record of the serial number is the initial data record of the serial number, which is composed of a primary key (id), a name, and a group to form a serial number identifier. For example... Figure 2 and Figure 3 As shown, the sequence number between the beginning and end digits is the overall permutation number. The position of a specific sequence number obtained through record lookup is its current position (pos). The original record can also include a record indicating whether the sequence number is valid (enable), providing a basis for determining the validity of the queried sequence number. For example, creating a sequence number device from 1 to 10000 would have the following initialized content: Figure 4 As shown.
[0044] S2: In response to the allocation request, generate an allocation record and return the allocated sequence in the sequence number, where the allocation record is represented as the record whose current position in the original record has been shifted one position to the right.
[0045] Specifically, upon receiving a request to allocate a sequence number, a corresponding allocation record is generated. This records the already allocated sequence numbers, meaning the allocation record shifts the sequence number in the original record one position forward. In other words, the shifted sequence number's position is the original record's current position incremented by 1. For example, if the original record's sequence number starts at 1, ends at 10000, and is currently at position 1, then upon receiving an allocation request, the sequence number's starting number will be 1, the ending number 10000, and the current position 2. Figure 5 As shown.
[0046] Please see Figures 6 to 8 , Figure 6 This is a flowchart illustrating the process of reclaiming allocation records according to an embodiment of this application. Figure 7 This is a schematic diagram of the status of an allocation record table for reclaiming an allocation record according to an embodiment of this application. Figure 8 This is a schematic diagram of the status of the allocation record table for recovering three allocation records according to an embodiment of this application.
[0047] In one embodiment, the serial number processing method further includes:
[0048] S3: In response to the current position being the same as the end number of the sequence number, reclaim the corresponding allocation record.
[0049] Specifically, if after moving the sequence number in the original record one position to the right, the current position of the moved sequence number is found to be the same as the last number of the sequence number in the original record, then it is equivalent to the original record having reached the last sequence number. At this point, the sequence number recycling mechanism can be activated to move the allocation record to the history record, which is equivalent to deleting the allocation record.
[0050] S4: In response to receiving a release sequence number, and the name and grouping of the release sequence number are the same as those in the original record, add a first sub-record in the allocation record to update the allocation record table; wherein the first sub-record represents the release sequence number, and the representation method of the first sub-record is the same as that of the allocation record, and it is located below the allocation record.
[0051] Specifically, such as Figure 6 and Figure 7As shown, when the database receives a request to release a sequence number, it also needs to verify whether the name and grouping of the sequence number are the same as those of the sequence number in the original record. If they are the same, the sequence number is reclaimed, and a new sub-record is added to the allocation record. The first sub-record can be understood as a record for a sequence number that has already been released. After the first sub-record is added to the allocation record, it is equivalent to adding another record to the allocation record table, which means that the allocation record table has been updated. It can be understood that the first sub-record has the same meaning as other sequence numbers in the allocation record during allocation, and the first sub-record exists in the allocation record as part of the allocation record table.
[0052] For example, when a serial number is no longer in use, the application can actively release it. If the serial number is actively released, it can be reused immediately. For instance, after releasing serial number 1, a new serial number with position 1 is immediately added to the allocation record table. This new serial number can be allocated normally like other serial numbers. Figure 7 As shown.
[0053] For example, if 5 sequence numbers are assigned, and the 2nd, 3rd, and 4th sequence numbers are released, then the data content will be as follows: Figure 8 As shown. By Figure 8 It can be seen that each time a serial number is released, the primary key in the allocation record table increases by 1, and the start number, end number, and current position of the serial number that is re-released are all the same.
[0054] Please see Figures 9 to 12 , Figure 9 This is a schematic diagram of the status of an allocation record table for reallocating released sequence numbers, provided in one embodiment of this application. Figure 10 This is a flowchart illustrating the reallocation of released serial numbers according to an embodiment of this application. Figure 11 This is a schematic diagram illustrating the status of discarded but not released serial numbers in the allocation record table according to an embodiment of this application. Figure 12 This is a schematic diagram of the status of a discarded serial number in the allocation record table after it has been released, according to an embodiment of this application.
[0055] In one embodiment, such as Figure 10 As shown, the serial number processing method further includes:
[0056] S5: In response to another allocation request, process the allocation record so that the first sub-record corresponding to the release sequence number is marked as allocated, and return the release sequence number, wherein the other allocation request indicates that the release sequence number is requested to be allocated.
[0057] Specifically, if, based on the released sequence number, a request for the allocation of another sequence number is received, and the current position of the returned sequence number is the same as the end number of the sequence number in the original record, for example, in... Figure 8 If a new primary key is allocated based on the previous one, and the result is 2, then as described in step S3, a situation will arise where the current position 2 of the sequence number is the same as the end number 2 of the sequence number in the original record. At this point, the sequence number recycling mechanism can be activated to delete the allocated record. That is, the allocation record where both the current and end positions are 2 will be deleted, and the data content will be as follows: Figure 9 As shown.
[0058] S6: Obtain the unreleased sequence number from the updated allocation record, and add a second sub-record to the updated allocation record, where the second sub-record represents the unreleased sequence number, thereby releasing the unreleased sequence number.
[0059] Specifically, unreleased serial numbers are retrieved from the updated allocation records at preset time intervals. These preset time intervals can be manually set as needed. If the business system using this application provides an interface to monitor the existence of serial numbers, then at preset time intervals, discarded but not released serial numbers will be found through segmented detection. The specific steps for finding and releasing serial numbers can be as follows: start by taking the minimum value; end by taking the maximum value; query the primary key serial number in units of 1000. If the serial number does not exist and has not been released in the database, then the serial number is released.
[0060] For example, the serial number with primary key 5 is discarded, but the method of this application is not called to release it, and the original data is as follows: Figure 11 As shown. After reclaiming the sequence number with primary key 5, a new record will be added to the allocation record table, where the start number, end number, and current position of the sequence number are all 5, as shown. Figure 12 As shown, this allows the serial number with primary key 5 to be reassigned and used again.
[0061] Please see Figures 12 to 15 ,in Figure 13 This is a schematic diagram of the state of the allocation record table after the data content becomes fragmented, according to an embodiment of this application. Figure 14 This is a schematic diagram of the allocation record table after one merging of fragmented data, provided in an embodiment of this application. Figure 15 This is a schematic diagram of the final state of the allocation record table after multiple merging of fragmented data according to an embodiment of this application.
[0062] In one embodiment, the serial number processing method further includes:
[0063] S61: After updating the allocation record, obtain consecutive sequence numbers and modify the allocation record based on the consecutive sequence numbers. In the modified allocation record, the last number of the first consecutive sequence number is changed to increase the number of consecutive sequence numbers, and the remaining consecutive sequence numbers are marked as modified.
[0064] Specifically, with continuous allocation and release, the data content of the sequence number allocation record table becomes fragmented, meaning that consecutive content stores multiple data entries, such as... Figure 12 As shown, there are two sequence numbers with the current position being 5. At this time, the business system will be in a relatively idle period, allowing it to automatically scan and merge fragmented data. Consecutive sequence numbers include the first sequence number and the second sequence number, where the ending number of the first sequence number is greater than the current position of the second sequence number, and the difference between the ending number of the first sequence number and the current position of the second sequence number is 1. That is, adding 1 to the ending number of the first sequence number gives the current position of the second sequence number. This can be represented as: providing the original data [a, b], where [a, b] can be considered a data pair, where [a, b] satisfies a end + 1 = b pos, and then merging them into a single data entry. For example, as... Figure 13 The sequence contains consecutive serial numbers 3 and 4, meaning the first serial number is 3 and the second serial number is 4. By adding 1 to the last digit of the first serial number (3), we can obtain the current position of the second serial number (4) as 4. Therefore, merging the two consecutive serial numbers into one results in... Figure 14 The contents of the allocation record table are shown.
[0065] The allocation record table is iterated and integrated using the method a end + 1 = b pos until no data pairs that meet the conditions are found. The final allocation record table data result is as follows. Figure 15 As shown, three sequence numbers can be merged into one. This consolidates the sequence number allocation record table, reducing storage space usage and improving sequence number utilization efficiency.
[0066] The serial number processing method provided in this application includes: creating an original record for the serial number, wherein the serial number includes a primary key, name, and grouping representation; the original record includes a primary key, name, grouping, start number of the serial number, end number of the serial number, and current position; responding to an allocation request, generating an allocation record and returning the allocated sequence in the serial number, wherein the allocation record is represented as the record whose current position in the original record has been shifted one position forward. The serial number primary key in this application is short, and the allocation and release of the sequence table only requires one record operation. If a two-level caching strategy is adopted, most operations can be completed in memory, resulting in high efficiency. It occupies less space; for an integer serial number, if recorded one by one, it may require up to 32GB of data space, while the method in this application, after optimization, only requires a small amount of data, and in most cases, 1MB of storage space is sufficient for most scenarios. It is reusable: obsolete serial numbers can be released and reused. Auto-incrementing or date-incrementing sequences in the database cannot reuse serial numbers. It has a wide range of applications: if a serial number is neither a primary key nor a unique index, auto-incrementing cannot be used.
[0067] Please see Figure 16 , Figure 16 This is a schematic diagram of the structure of a server provided in one embodiment of this application.
[0068] like Figure 16 As shown in the embodiment of this application, the server 10 includes a processor 110, a memory 120, and a transceiver 130. The memory 120 and the transceiver 130 are respectively coupled to the processor 110.
[0069] Processor 110 is used to control the operation of server 10. Processor 110 can also be referred to as CPU (Central Processing Unit). Processor 110 may be an integrated circuit chip with signal processing capabilities. Processor 110 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The general-purpose processor can be a microprocessor, or processor 110 can be any conventional processor.
[0070] The memory 120 is used to store computer programs and may be RAM, ROM, or other types of storage devices. Specifically, the memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory is used to store at least one line of program code.
[0071] The processor 110 is used to execute the computer program stored in the memory 120 to implement the interactive processing method described in the embodiments of the serial number processing method of this application.
[0072] Transceiver 130 is used to establish communication connections with the peripheral systems of the client terminal and the core systems of the bank for data transmission.
[0073] For a detailed description of the functions and execution processes of each functional module or component in the server 10 embodiments of this application, please refer to the description in the first embodiment of the serial number processing method of this application, which will not be repeated here.
[0074] Please see Figure 17 , Figure 17 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0075] Electronic device 200 may specifically include processor 210 and memory 220. Memory 220 is coupled to processor 210.
[0076] Processor 210 is used to control the operation of electronic device 200. Processor 210 can also be referred to as CPU (Central Processing Unit). Processor 210 may be an integrated circuit chip with signal processing capabilities. Processor 210 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The general-purpose processor can be a microprocessor, or processor 210 can be any conventional processor.
[0077] The memory 220 is used to store computer programs and may be RAM, ROM, or other types of storage devices. Specifically, the memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory is used to store at least one line of program code.
[0078] The processor 210 is used to execute a computer program stored in the memory 220 to implement the serial number processing method described in the embodiments of the serial number processing method of this application.
[0079] In some embodiments, the electronic device 200 may further include a peripheral device interface 230 and at least one peripheral device. The processor 210, memory 220, and peripheral device interface 230 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 230 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 240, a display screen 250, an audio circuit 260, and a power supply 270.
[0080] Peripheral device interface 230 can be used to connect at least one I / O (Input / output) related peripheral device to processor 210 and memory 220. In some embodiments, processor 210, memory 220 and peripheral device interface 230 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 210, memory 220 and peripheral device interface 230 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0081] The radio frequency (RF) circuit 240 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 240 communicates with communication networks and other communication devices via electromagnetic signals, and it serves as the transceiver of the electronic device 200. The RF circuit 240 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 240 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 240 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 240 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0082] Display screen 250 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 250 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 210 for processing. In this case, display screen 250 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 250, located on the front panel of electronic device 200; in other embodiments, there may be at least two display screens, respectively located on different surfaces of electronic device 200 or in a folded design; in still other embodiments, display screen 250 may be a flexible display screen, located on a curved or folded surface of electronic device 200. Furthermore, display screen 250 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. Display screen 250 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light Emitting Diode).
[0083] The audio circuit 260 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting them into electrical signals that are input to the processor 210 for processing, or to the radio frequency circuit 240 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the electronic device 200. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 210 or the radio frequency circuit 240 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 260 may also include a headphone jack.
[0084] Power supply 270 is used to supply power to various components in electronic device 200. Power supply 270 can be alternating current, direct current, a disposable battery, or a rechargeable battery. When power supply 270 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0085] For a detailed description of the functions and execution processes of each functional module or component in the embodiments of the electronic device 200 of this application, please refer to the description in the embodiments of the serial number processing method of this application, which will not be repeated here.
[0086] In the several embodiments provided in this application, it should be understood that the disclosed electronic device 200 and serial number processing method can be implemented in other ways. For example, the embodiments of the electronic device 200 described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0087] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0088] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0089] Please see Figure 18 , Figure 18 This is a schematic block diagram of the structure of a computer-readable storage medium provided in an embodiment of this application.
[0090] See Figure 18 If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium 300. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions / computer programs to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this invention. The aforementioned storage medium includes various media such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, as well as electronic devices such as computers, mobile phones, laptops, tablets, and cameras that have the aforementioned storage media.
[0091] The execution process of the program data in the computer-readable storage medium 300 can be described with reference to the embodiments of the serial number processing method of this application described above, and will not be repeated here.
[0092] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for processing serial numbers, characterized in that, include: Create an original record for a serial number, wherein the serial number includes a primary key, a name, and a grouping identifier, and the original record includes the primary key, the name, the grouping, the start number of the serial number, the end number of the serial number, and the current position; In response to an allocation request, an allocation record is generated and the allocated sequence in the sequence number is returned, wherein the allocation record is characterized as a record in the original record in which the current position is shifted one position to the right; In response to receiving a release sequence number, and the name and grouping of the release sequence number are the same as the name and grouping in the original record, a first sub-record is added to the allocation record to update the allocation record table, wherein the first sub-record represents the release sequence number, and the representation method of the first sub-record is the same as that of the allocation record, and it is located below the allocation record; After updating the allocation record, obtain consecutive sequence numbers, and modify the allocation record based on the consecutive sequence numbers. In the modified allocation record, the ending number of the first sequence number in the consecutive sequence numbers is changed to increase the number of consecutive sequence numbers, and the remaining sequence numbers in the consecutive sequence numbers are marked as modified. The consecutive serial numbers include a first serial number and a second serial number, wherein the ending number of the first serial number is greater than the current position of the second serial number, and the difference between the ending number of the first serial number and the current position of the second serial number is 1.
2. The method according to claim 1, characterized in that, Further includes: In response to the current position being the same as the end number of the sequence number, the corresponding allocation record is reclaimed.
3. The method according to claim 1, characterized in that, Further includes: In response to another allocation request, the allocation record is processed such that the first sub-record corresponding to the release sequence number is marked as allocated, and the release sequence number is returned, wherein the other allocation request indicates a request to allocate the release sequence number.
4. The method according to claim 1, characterized in that, Further includes: The unreleased serial numbers are obtained from the updated allocation record, and a second sub-record is added to the updated allocation record, wherein the second sub-record represents the unreleased serial numbers, thereby releasing the unreleased serial numbers.
5. The method according to claim 4, characterized in that, The acquisition of the unreleased sequence number by the self-updated allocation record is performed at preset time intervals.
6. A server, characterized in that, The device includes a processor, a memory, and a transceiver, the transceiver being used for communication connections with client terminals and bank terminals, the memory storing a computer program, and the processor being used to execute the computer program to implement the method as described in any one of claims 1 to 5.
7. A computer device, characterized in that, include: processor; A memory, connected to the processor, for storing computer programs that can run on the processor; The processor executes the computer program to implement the method described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Rapid file predistribution and file box dynamic management process
CN101211338A