A serial number generation method and apparatus
By obtaining user business requests to generate call parameters, calling a preset database and returning a matching target serial number, the problem of poor serial number management in the business system is solved, the practicality of generated serial numbers and the level of business services are improved, and the intelligent capabilities are enhanced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN COMTOP INFORMATION TECH
- Filing Date
- 2022-12-26
- Publication Date
- 2026-05-26
AI Technical Summary
The existing business system cannot effectively manage the generation of serial numbers, resulting in low usability of the generated serial numbers and thus reducing the level of business services.
By obtaining the user's business request, generating call parameters, calling the sequence recycling table, sequence pre-storage table or sequence registry in the preset database, returning the target sequence number that matches the business request, and judging and recycling the sequence number in real time according to the business status to ensure the uniqueness and validity of the sequence number.
It improves the usability of serial number generation in business systems, enhances serial number management capabilities, makes business systems more intelligent, and improves user experience and business service levels.
Smart Images

Figure CN116244304B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of programming language technology, and in particular to a serial number generation method and apparatus. Background Technology
[0002] With the steady development of my country's economic construction, the volume of various businesses in my country is also increasing day by day. Relying on the business systems required for consumption and services, it is possible to locate each business link and reflect the methods and content of cooperation and transactions through business serial numbers.
[0003] In practical applications, existing business systems are often deployed across multiple nodes. This deployment architecture can ensure the high availability of serial numbers for the business systems. However, these business systems often cannot effectively manage the generation of serial numbers, which reduces the usability of the generated serial numbers and consequently lowers the business service level of the system. Therefore, providing a method to improve the usability of generated serial numbers, thereby enhancing the business service level of the system, is particularly important. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a serial number generation method and apparatus that can improve the practicality of serial number generation in a business system, thereby improving the business service level of the business system.
[0005] To address the aforementioned technical problems, the first aspect of this invention discloses a serial number generation method, the method comprising:
[0006] Obtain the user's business request, which indicates the user's willingness to process the business.
[0007] Based on the business request, generate the calling parameters for the business system;
[0008] The system invokes a preset database of the business system using the aforementioned parameters and returns a target serial number. The preset database includes at least one of a serial number recycling table, a serial number pre-store table, and a serial number registry. The business meaning of the target serial number matches the business request.
[0009] As an optional implementation, in the first aspect of the present invention, before obtaining the user's service request, the method further includes:
[0010] Obtain business information from the business system, wherein the business information includes at least one business type and / or business content of the business system.
[0011] Based on the business information, the registration conditions matching each of the business types are determined, and the registration conditions include business number, coding rules, and business name;
[0012] Based on all the aforementioned registration conditions, determine the sequence registry of the business system.
[0013] As an optional implementation, in the first aspect of the invention, after determining the sequence registry of the business system based on all the registration conditions, the method further includes:
[0014] According to the sequence registry, multiple pre-stored serial numbers are generated. The pre-stored serial numbers are unused serial numbers, and each pre-stored serial number has a corresponding business meaning.
[0015] Based on all the pre-stored sequence numbers, determine the sequence pre-store table of the business system.
[0016] As an optional implementation, in the first aspect of the present invention, after invoking the preset database of the business system through the invocation parameters and returning the target serial number, the method further includes:
[0017] Obtain the service status of the target serial number, wherein the service status is used to indicate the service status of the service associated with the target serial number;
[0018] Based on the service status of the target serial number, it is determined in real time whether the target serial number meets the preset recycling conditions;
[0019] When it is determined that the target serial number meets the preset recycling conditions, the target serial number is stored in a pre-determined serial recycling table.
[0020] As an optional implementation, in the first aspect of the present invention, the step of calling the preset database of the business system and returning the target serial number through the calling parameters includes:
[0021] The call parameters are used to invoke the sequence recycling table of the business system;
[0022] Check if a first sequence number matching the business request exists in the sequence recycling table;
[0023] If the first sequence number exists in the sequence recycling table, then the first sequence number is returned as the target sequence number.
[0024] As an optional implementation, in the first aspect of the present invention, if the first sequence number does not exist in the sequence recovery table, the method further includes:
[0025] Using the aforementioned call parameters, the system invokes the preset sequence cache of the business system and queries whether there exists a cache number in the preset sequence cache that matches the business request.
[0026] If the cache number exists in the preset sequence cache, then a second sequence number is generated based on the cache number, and the second sequence number is returned as the target sequence number;
[0027] If the cache number does not exist in the preset sequence cache, the sequence pre-store table of the business system is called through the calling parameters, and the third sequence number matching the business request is queried in the sequence pre-store table. If the third sequence number exists in the sequence pre-store table, the third sequence number is returned as the target sequence number.
[0028] As an optional implementation, in the first aspect of the present invention, if the cache number does not exist in the preset sequence cache and the third sequence number does not exist in the sequence pre-store table, the method further includes:
[0029] The call parameters are used to invoke the sequence registry of the business system;
[0030] The first registration condition is obtained by searching the sequence registry, and the first registration condition matches the service request.
[0031] Based on the first registration conditions and the business request, a fourth serial number is generated and returned as the target serial number.
[0032] A second aspect of the present invention discloses a serial number generation apparatus, the apparatus comprising:
[0033] The acquisition module is used to acquire the user's business request, which indicates the user's willingness to process the business.
[0034] The generation module is used to generate the calling parameters of the business system based on the business request;
[0035] The calling module is used to call the preset database of the business system through the calling parameters and return the target serial number. The preset database includes at least one of a serial number recycling table, a serial number pre-store table, and a serial number registry. The business meaning of the target serial number matches the business request.
[0036] As an optional implementation, in a second aspect of the invention, the acquisition module is further configured to:
[0037] Before obtaining the user's business request, obtain the business information of the business system, the business information including the business type and / or business content of at least one business of the business system;
[0038] The device also includes:
[0039] The determination module is used to determine the registration conditions that match each of the services based on the service information, wherein the registration conditions include service number, encoding rules and service name; and to determine the sequence registry of the service system based on all the registration conditions.
[0040] As an optional implementation, in a second aspect of the invention, the generation module is further configured to:
[0041] After the determining module determines the sequence registry of the business system based on all the registration conditions, it generates multiple pre-stored serial numbers based on the sequence registry. The pre-stored serial numbers are unactivated serial numbers, and each pre-stored serial number has a corresponding business meaning.
[0042] The determining module is further configured to determine the sequence pre-store table of the business system based on all the pre-stored sequence numbers.
[0043] As an optional implementation, in a second aspect of the invention, the acquisition module is further configured to:
[0044] After the calling module calls the preset database of the business system through the calling parameters and returns the target serial number, the business status of the target serial number is obtained. The business status is used to indicate the business status of the business associated with the target serial number.
[0045] The device also includes:
[0046] The judgment module is used to determine in real time whether the target serial number meets the preset recycling conditions based on the service status of the target serial number;
[0047] The storage module is used to store the target serial number into a predetermined serial number recycling table when the judgment module determines that the target serial number meets the preset recycling conditions.
[0048] As an optional implementation, in the second aspect of the present invention, the method by which the calling module invokes the preset database of the business system through the calling parameters and returns the target serial number specifically includes:
[0049] The call parameters are used to invoke the sequence recycling table of the business system;
[0050] Check if a first sequence number matching the business request exists in the sequence recycling table;
[0051] If the first sequence number exists in the sequence recycling table, then the first sequence number is returned as the target sequence number.
[0052] As an optional implementation, in the second aspect of the present invention, if the first sequence number does not exist in the sequence recycling table, the method by which the calling module calls the preset database of the business system through the calling parameters and returns the target sequence number further includes:
[0053] Using the aforementioned call parameters, the system invokes the preset sequence cache of the business system and queries whether there exists a cache number in the preset sequence cache that matches the business request.
[0054] If the cache number exists in the preset sequence cache, then a second sequence number is generated based on the cache number, and the second sequence number is returned as the target sequence number;
[0055] If the cache number does not exist in the preset sequence cache, the sequence pre-store table of the business system is called through the calling parameters, and the third sequence number matching the business request is queried in the sequence pre-store table. If the third sequence number exists in the sequence pre-store table, the third sequence number is returned as the target sequence number.
[0056] As an optional implementation, in the second aspect of the present invention, if the cache number does not exist in the preset sequence cache and the third sequence number does not exist in the sequence pre-store table, the method by which the calling module calls the preset database of the business system through the calling parameters and returns the target sequence number further includes:
[0057] The call parameters are used to invoke the sequence registry of the business system;
[0058] The first registration condition is obtained by searching the sequence registry, and the first registration condition matches the service request.
[0059] Based on the first registration conditions and the business request, a fourth serial number is generated and returned as the target serial number.
[0060] A third aspect of the present invention discloses another serial number generation apparatus, the apparatus comprising:
[0061] Memory containing executable program code;
[0062] A processor coupled to the memory;
[0063] The processor calls the executable program code stored in the memory to execute the serial number generation method disclosed in the first aspect of the present invention.
[0064] The fourth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute the serial number generation method disclosed in the first aspect of the present invention.
[0065] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0066] In this embodiment of the invention, a user's business request is obtained, indicating the user's intention to process a business transaction. Based on the business request, calling parameters for the business system are generated. Using these parameters, a preset database of the business system is invoked, and a target serial number is returned. The preset database includes at least one of a serial number recycling table, a serial number pre-stored table, and a serial number registry. The business meaning of the target serial number matches the business request. Therefore, implementing this invention can generate corresponding calling parameters based on the user's business request, thereby invoking the preset database and returning a target serial number matching the business request. This improves the practicality of the serial number generation by the business system, thus enhancing the business service level of the system. It also strengthens the serial number management capabilities of the business system, making it more intelligent and improving the user experience. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of the present invention, 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0068] Figure 1 This is a flowchart illustrating a serial number generation method disclosed in an embodiment of the present invention;
[0069] Figure 2 This is a flowchart illustrating another serial number generation method disclosed in an embodiment of the present invention;
[0070] Figure 3 This is a schematic diagram of the structure of a serial number generation device disclosed in an embodiment of the present invention;
[0071] Figure 4 This is a schematic diagram of another serial number generation device disclosed in an embodiment of the present invention;
[0072] Figure 5 This is a schematic diagram of the structure of another serial number generation device disclosed in an embodiment of the present invention. Detailed Implementation
[0073] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0074] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end 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 ends.
[0075] 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 the invention. 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.
[0076] This invention discloses a serial number generation method and apparatus, which can generate corresponding calling parameters based on user business requests, then call a preset database and return a target serial number matching the business request. This improves the usability of serial number generation in the business system, thereby enhancing the business service level of the system; it also strengthens the serial number management capabilities of the business system, making it more intelligent and improving the user experience. Detailed descriptions follow.
[0077] Example 1
[0078] Please see Figure 1 , Figure 1 This is a flowchart illustrating a serial number generation method disclosed in an embodiment of the present invention. Wherein, Figure 1 The described serial number generation method can be applied to business systems that require serial number generation, and this embodiment of the invention does not limit its application. Optionally, this method can be implemented by a business system, which can be integrated into a business processing device or exist independently of the business processing device. It can also be a local server or cloud server used to process serial number generation and / or management processes, etc., and this embodiment of the invention does not limit its application. Figure 1As shown, the serial number generation method may include the following operations:
[0079] 101. Obtain the user's business request.
[0080] In this embodiment of the invention, optionally, the business request is used to indicate the user's business processing intention. When the user calls the business system, the business system can assign the user a unique organization code or call the user's existing organization code, and obtain the user's business request based on the user's organization code. For example, when a bank counter user calls the business system, the user's organization code is associated with banking services, meaning the business system can obtain part of the user's banking business processing intentions based on the organization code. Optionally, the user can select services in a visual business system through a business processing device (e.g., a computer), so that the business system can obtain the user's business request. Further optionally, the business system can record the user's business processing status multiple times, and automatically obtain the user's habitual business requests based on the user's business processing status records.
[0081] 102. Generate the calling parameters for the business system based on the business request.
[0082] In this embodiment of the invention, optionally, the business system can be divided into a consumer end and a server end. The consumer end is used to provide users with access to the business system, while the server end is used by the business system to provide corresponding business services based on users' business requests. The call parameters are the control means for the consumer end to call the server end. Further optionally, the call parameters are used to call different service interfaces in the business system, such as generating service interfaces through REST call sequence numbers. Generating different call parameters for the business system based on different business requests can improve the accuracy of business system calls, thereby improving the efficiency of business processing.
[0083] 103. By calling parameters, the system calls the preset database of the business system and returns the target serial number.
[0084] In this embodiment of the invention, optionally, the preset database includes at least one of a sequence recycling table, a sequence pre-storage table, and a sequence registry. The sequence recycling table stores sequence numbers that have been enabled and meet preset recycling conditions; the sequence pre-storage table stores pre-generated but not yet enabled sequence numbers; and the sequence registry stores registration conditions for sequence numbers matched with different services. Further optionally, the column numbers of the sequence recycling table, the sequence pre-storage table, and the sequence registry are all stored in the preset database, and a distributed lock is used to ensure that the sequence numbers are unique and have corresponding business meanings. Simultaneously, the preset database is persisted to ensure that each registration condition in the sequence registry is independent and not lost.
[0085] As can be seen, implementing the embodiments of the present invention can generate corresponding calling parameters according to the user's business request, and then call the preset database and return the target serial number that matches the business request. This can improve the practicality of the serial number generation of the business system, thereby improving the business service level of the business system; it can enhance the serial number management capability of the business system, thereby making the business system more intelligent, and thus improving the user experience.
[0086] In an optional embodiment, before obtaining the user's service request in step 101 above, the method further includes:
[0087] Obtain business information from the business system;
[0088] Based on the business information, determine the registration conditions that match each business.
[0089] Based on all registration conditions, determine the sequence registry for the business system.
[0090] In this optional embodiment, the business information may optionally include the business type and / or business content of at least one business of the business system. Optionally, the registration conditions may include a business number, encoding rules, and a business name. Further optional, the business system may invoke a preset service (equivalent to business information) from the consumer end to the server end. The server responds to the invocation, determines the sequence registry corresponding to the business information, stores the sequence registry in a preset memory, and returns a success message.
[0091] In this optional embodiment, the serial number registry can serve as the registration basis for generating serial numbers. When the consumer needs to use a serial number, the consumer calls the service to address the registration center, and the registration center calls the serial number registry in the server to generate the corresponding serial number.
[0092] As can be seen, this optional embodiment can determine the corresponding sequence registry based on the business information of the business system, and can provide a sequence registry for front-end and back-end (consumer end and server end) calls. This is beneficial for generating non-repeating sequence numbers to meet the sequence number requirements of the business system, thereby improving the intelligence level of the business system.
[0093] In another alternative embodiment, after determining the sequence registry of the business system based on all registration conditions in the above steps, the method further includes:
[0094] Based on the serial number registry, generate multiple pre-stored serial numbers;
[0095] Based on all the pre-stored sequence numbers, determine the sequence pre-store table of the business system.
[0096] In this optional embodiment, the pre-stored serial number refers to an inactive serial number, and each pre-stored serial number has a corresponding business meaning. Optionally, different services can each correspond to multiple pre-stored serial numbers, so that the required serial number can be returned promptly when the service is modified or adjusted.
[0097] As can be seen, this optional embodiment can generate multiple pre-stored serial numbers and determine the serial number pre-store table of the business system, and can prepare multiple serial numbers in advance for subsequent business replacement, thereby improving the efficiency of serial number retrieval and thus improving the business processing efficiency of the business system.
[0098] In another optional embodiment, after step 103 above, which calls the preset database of the business system by calling parameters and returns the target serial number, the method further includes:
[0099] Obtain the business status of the target sequence number;
[0100] Based on the business status of the target serial number, it is determined in real time whether the target serial number meets the preset recycling conditions;
[0101] When a target serial number is determined to meet the preset recycling conditions, the target serial number is stored in a pre-determined serial number recycling table.
[0102] In this optional embodiment, the business status can be used to indicate the business status of the business associated with the target serial number. This business status can be that the business has ended, the business processing is abnormal, or the business processing is normal. Further optionally, when the business status of the target serial number is "business ended" or "business processing is abnormal," the target serial number is determined to meet preset recycling conditions and is recycled. For example, when the business associated with the target serial number has been completed, it indicates that the target serial number no longer has the capability to process the current business, and it should be recycled, i.e., its activation should be suspended. When the business associated with the target serial number shows "business processing is abnormal," it means that the target serial number may be abnormal (the target serial number is a duplicate serial number or empty), and it should be recycled, i.e., its activation should be suspended or the serial number should be destroyed.
[0103] As can be seen, this optional embodiment can reclaim and store the target serial number in the serial number reclamation table when the target serial number meets the preset reclamation conditions. It can suspend the activation of the serial number and reactivate it when the next business needs it, which is conducive to improving the utilization efficiency of the serial number and thus improving the intelligence level of the business system. It can also detect abnormal serial numbers in a timely manner and reclaim them, which is conducive to improving the accuracy of the serial number and thus improving the business processing efficiency of the business system.
[0104] Example 2
[0105] Please see Figure 2 , Figure 2 This is a flowchart illustrating a serial number generation method disclosed in an embodiment of the present invention. Wherein, Figure 2 The described serial number generation method can be applied to business systems that require serial number generation, and this embodiment of the invention does not limit its application. Optionally, this method can be implemented by a business system, which can be integrated into a business processing device or exist independently of the business processing device. It can also be a local server or cloud server used to process serial number generation and / or management processes, etc., and this embodiment of the invention does not limit its application. Figure 2 As shown, the serial number generation method may include the following operations:
[0106] 201. Obtain the user's business request.
[0107] 202. Generate the calling parameters for the business system based on the business request.
[0108] 203. By calling parameters, the sequence recycling table of the business system is invoked.
[0109] In this embodiment of the invention, optionally, the sequence recycling table stores multiple generated sequence numbers that have been recycled through the sequence recycling service interface, as well as sequence numbers generated when business processing is abnormal. By calling this sequence recycling table, sequence numbers can be recycled and reused, reducing the phenomenon of duplicate sequence number generation and thus saving sequence number resources.
[0110] 204. Query the sequence recycling table to see if there is a first sequence number that matches the business request. If there is a first sequence number in the sequence recycling table, return the first sequence number as the target sequence number.
[0111] In this embodiment of the invention, specifically, the first serial number is merely used to refer to the serial number matching the business request and has no other special meaning, which is not limited here. Optionally, the original business meaning corresponding to each recycled serial number in the serial number recycling table will still be retained. Further optionally, the serial number matching the business request is queried in the serial number recycling table. If it exists, the serial number is reactivated and returned as the target serial number, wherein the business meaning of the reactivated serial number matches the user's business request.
[0112] In this embodiment of the invention, for other descriptions of steps 201 and 202, please refer to the detailed description of steps 101 and 102 in Embodiment 1. These descriptions will not be repeated in this embodiment of the invention.
[0113] As can be seen, implementing the embodiments of the present invention can generate corresponding calling parameters according to the user's business request, and then call the preset database and return the target serial number that matches the business request. This can improve the practicality of the serial number generated by the business system, thereby improving the business service level of the business system; it can enhance the serial number management capability of the business system, thereby making the business system more intelligent and improving the user experience; it can call the serial number recycling table of the business system and query whether there is a serial number that matches the user's business request to reactivate the target serial number, thereby reducing the repeated generation of serial numbers, saving serial number resources, and thus improving the serial number management efficiency of the business system.
[0114] In an optional embodiment, if the first sequence number does not exist in the above sequence recovery table, the method further includes:
[0115] By calling parameters, the system invokes the business system's preset sequence cache and queries whether there is a cache number in the preset sequence cache that matches the business request.
[0116] If a cache number exists in the preset sequence cache, a second sequence number is generated based on the cache number, and the second sequence number is returned as the target sequence number.
[0117] If the cache number is not present in the preset sequence cache, the sequence pre-store table of the business system is called by calling the parameters, and a third sequence number matching the business request is queried in the sequence pre-store table. If the third sequence number exists in the sequence pre-store table, the third sequence number is returned as the target sequence number.
[0118] In this optional embodiment, the preset sequence cache is a temporary storage space between the preset database and the business system. Its access speed is faster than the database. However, because the data in the preset sequence cache is difficult to fully synchronize with the preset database, there may be data update discrepancies between the preset sequence cache and the preset database. Therefore, when a sequence number matching the user's business request cannot be found in the sequence recycling table, the cache can be called to query the cache number. Optionally, the cache number is an intermediate data product generated based on the registration conditions when generating the sequence number. That is, each sequence number to be generated has a corresponding cache number, and these cache numbers are stored in the preset sequence cache for easy retrieval at any time.
[0119] In this optional embodiment, the sequence pre-store table stores pre-generated and unused pre-stored sequence numbers. Each of these pre-stored sequence numbers has a different business meaning. By pre-stored a certain number of pre-stored sequence numbers, they can be retrieved at any time when needed for the next business, reducing the process of generating sequence numbers and improving the return rate of sequence numbers.
[0120] As can be seen, this optional embodiment can generate a corresponding second sequence number when a cache number matching the business request exists in the preset sequence cache, or further query the sequence pre-store table to call a third sequence number when the cache number does not exist in the preset sequence cache, and finally return the second or third sequence number as the target sequence number. This simplifies the sequence number return process, thereby improving the efficiency of sequence number return and thus improving the business processing efficiency of the business system.
[0121] In another optional embodiment, if the preset sequence cache does not contain a cache number and the sequence pre-store table does not contain a third sequence number, the method further includes:
[0122] By calling parameters, the sequence registry of the business system is invoked;
[0123] Search the sequence registry to find the first registration condition;
[0124] Based on the first registration condition and the business request, a fourth serial number is generated and returned as the target serial number.
[0125] In this optional embodiment, the sequence registry may optionally store the registration conditions for various different services that the business system can handle. Using this table as the registration basis enables the business system to generate unique sequence numbers. Optionally, the first registration condition refers to the registration condition that matches the business request and has no other special meaning, and is not limited here.
[0126] As can be seen, this optional embodiment can call the business system's sequence registry to generate a fourth sequence number that matches the user's business request and return it as the target sequence number. This ensures the uniqueness of the generated sequence number and provides a unique numbering certificate for subsequent business, thereby ensuring the accuracy and effectiveness of the business system in handling business.
[0127] Example 3
[0128] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a serial number generation device disclosed in an embodiment of the present invention. Figure 3 The described serial number generation device can be applied to business systems that require serial number generation, and this embodiment of the invention does not limit its application. Optionally, the device can be implemented by a business system, which can be integrated into a business processing device or exist independently of the business processing device. It can also be a local server or cloud server, etc., used to process serial number generation and / or management processes, and this embodiment of the invention does not limit its application. Figure 3 As shown, the serial number generation device may include:
[0129] The acquisition module 301 is used to acquire the user's business request, which is used to indicate the user's willingness to process the business.
[0130] The generation module 302 is used to generate the calling parameters of the business system based on the business request;
[0131] Module 303 is used to call the preset database of the business system through the call parameters and return the target serial number. The preset database includes at least one of the serial number recycling table, serial number pre-store table and serial number registry. The business meaning of the target serial number matches the business request.
[0132] It is evident that implementation Figure 3 The described serial number generation device can generate corresponding call parameters according to the user's business request, then call the preset database and return the target serial number that matches the business request. This can improve the usability of the serial number generation of the business system, thereby improving the business service level of the business system; it can enhance the serial number management capability of the business system, thereby making the business system more intelligent and improving the user experience.
[0133] In an optional embodiment, the acquisition module 301 described above is further configured to:
[0134] Before obtaining the user's business request, obtain the business information of the business system. The business information includes the business type and / or business content of at least one business of the business system.
[0135] And, such as Figure 4 As shown, the device also includes:
[0136] The determination module 304 is used to determine the registration conditions that match each type of business based on the business information. The registration conditions include the business number, coding rules, and business name; and to determine the sequence registry of the business system based on all registration conditions.
[0137] It is evident that implementation Figure 4 The described serial number generation device can determine the corresponding serial number registry based on the business information of the business system, and can provide a serial number registry for front-end and back-end (consumer end and server end) to be called. This is conducive to generating non-repeating serial numbers to meet the serial number requirements of the business system, thereby improving the intelligence level of the business system.
[0138] In another optional embodiment, the above-described generation module 302 is further configured to:
[0139] After the aforementioned determination module 304 determines the sequence registry of the business system based on all registration conditions, multiple pre-stored serial numbers are generated based on the sequence registry. The pre-stored serial numbers are unused serial numbers, and each pre-stored serial number has a corresponding business meaning.
[0140] The aforementioned determining module 304 is also used to determine the sequence pre-store table of the business system based on all pre-stored sequence numbers.
[0141] It is evident that implementation Figure 4 The described serial number generation device can generate multiple pre-stored serial numbers and determine the serial number pre-store table of the business system. It can prepare multiple serial numbers in advance for subsequent business replacement, thereby improving the efficiency of serial number retrieval and thus improving the business processing efficiency of the business system.
[0142] In yet another optional embodiment, the acquisition module 301 described above is further configured to:
[0143] After the above-mentioned calling module 303 calls the preset database of the business system through the calling parameters and returns the target serial number, the business status of the target serial number is obtained. The business status is used to indicate the business status of the business associated with the target serial number.
[0144] And, such as Figure 4 As shown, the device also includes:
[0145] The judgment module 305 is used to determine in real time whether the target sequence number meets the preset recycling conditions based on the business status of the target sequence number;
[0146] The storage module 306 is used to store the target serial number into a predetermined serial number recycling table when the judgment module 305 determines that the target serial number meets the preset recycling conditions.
[0147] It is evident that implementation Figure 4 The described serial number generation device can reclaim and store a target serial number in a serial number recycling table when the target serial number meets the preset recycling conditions. It can also suspend the activation of a serial number and reactivate it when needed for the next business transaction, which helps improve the utilization efficiency of serial numbers and thus improves the intelligence level of the business system. Furthermore, it can promptly detect and reclaim abnormal serial numbers, which helps improve the accuracy of serial numbers and thus improves the business processing efficiency of the business system.
[0148] In another optional embodiment, the method by which the calling module 304 calls the preset database of the business system through calling parameters and returns the target serial number specifically includes:
[0149] The sequence recycling table of the business system is invoked by calling the parameters;
[0150] Check if a first sequence number matching the business request exists in the sequence recycling table;
[0151] If the first sequence number exists in the sequence recycling table, then the first sequence number will be returned as the target sequence number.
[0152] It is evident that implementation Figure 4 The described serial number generation device can call the serial number recycling table of the business system and query whether there is a serial number that matches the user's business request to reactivate the target serial number. This reduces the repeated generation of serial numbers, thereby saving serial number resources and improving the serial number management efficiency of the business system.
[0153] In another optional embodiment, if the first sequence number does not exist in the sequence recycling table, the method by which the calling module 304 calls the preset database of the business system through calling parameters and returns the target sequence number further includes:
[0154] By calling parameters, the system invokes the business system's preset sequence cache and queries whether there is a cache number in the preset sequence cache that matches the business request.
[0155] If a cache number exists in the preset sequence cache, a second sequence number is generated based on the cache number, and the second sequence number is returned as the target sequence number.
[0156] If the cache number is not present in the preset sequence cache, the sequence pre-store table of the business system is called by calling the parameters, and a third sequence number matching the business request is queried in the sequence pre-store table. If the third sequence number exists in the sequence pre-store table, the third sequence number is returned as the target sequence number.
[0157] It is evident that implementation Figure 4 The described serial number generation device can generate a corresponding second serial number when a cache number matching the business request exists in the preset serial number cache, or further query the serial number pre-store table to call a third serial number when the cache number does not exist in the preset serial number cache, and finally return the second or third serial number as the target serial number. This simplifies the serial number return process, thereby improving the efficiency of serial number return and thus improving the business processing efficiency of the business system.
[0158] In another optional embodiment, if the aforementioned preset sequence cache does not contain a cache number and the sequence pre-store table does not contain a third sequence number, the method by which the aforementioned calling module 304 calls the preset database of the business system through calling parameters and returns the target sequence number further includes:
[0159] By calling parameters, the sequence registry of the business system is invoked;
[0160] The first registration condition is obtained by searching the sequence registry and matching it with the business request.
[0161] Based on the first registration condition and the business request, a fourth serial number is generated and returned as the target serial number.
[0162] It is evident that implementation Figure 4 The described serial number generation device can call the serial number registry of the business system to generate a fourth serial number that matches the user's business request and return it as the target serial number. This ensures the uniqueness of the generated serial number and provides a unique numbering certificate for subsequent business, thereby ensuring the accuracy and effectiveness of the business system in handling business.
[0163] Example 4
[0164] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of another serial number generation device disclosed in an embodiment of the present invention. For example... Figure 5 As shown, the serial number generation device may include:
[0165] Memory 401 storing executable program code;
[0166] Processor 402 coupled to memory 401;
[0167] The processor 402 calls the executable program code stored in the memory 401 to execute the steps in the serial number generation method described in Embodiment 1 or Embodiment 2 of the present invention.
[0168] Example 5
[0169] This invention discloses a computer storage medium storing computer instructions. When these computer instructions are invoked, they are used to execute the steps in the serial number generation method described in Embodiment 1 or Embodiment 2 of this invention.
[0170] Example 6
[0171] This invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps in the serial number generation method described in Embodiment 1 or Embodiment 2.
[0172] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0173] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0174] Finally, it should be noted that the serial number generation method and apparatus disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A sequence number generating method characterized by comprising: The method includes: Obtain the user's business request, which indicates the user's willingness to process the business. Based on the business request, generate the calling parameters for the business system; The system invokes a preset database of the business system using the aforementioned parameters and returns a target serial number. The preset database includes a serial number recycling table, a serial number pre-storage table, and a serial number registry. The business meaning of the target serial number matches the business request. The step of calling the preset database of the business system through the calling parameters and returning the target serial number includes: The call parameters are used to invoke the sequence recycling table of the business system; Check if a first sequence number matching the business request exists in the sequence recycling table; If the first sequence number exists in the sequence recycling table, then the first sequence number is returned as the target sequence number; If the first sequence number does not exist in the sequence recycling table, the method further includes: Using the aforementioned call parameters, the system invokes the preset sequence cache of the business system and queries whether there exists a cache number in the preset sequence cache that matches the business request. If the cache number exists in the preset sequence cache, then a second sequence number is generated based on the cache number, and the second sequence number is returned as the target sequence number; If the cache number does not exist in the preset sequence cache, the sequence pre-store table of the business system is invoked through the calling parameters, and a third sequence number matching the business request is queried in the sequence pre-store table. If the third sequence number exists in the sequence pre-store table, it is returned as the target sequence number. If the cache number does not exist in the preset sequence cache and the third sequence number does not exist in the sequence pre-store table, the method further includes: The call parameters are used to invoke the sequence registry of the business system; The first registration condition is obtained by searching the sequence registry, and the first registration condition matches the service request. Based on the first registration conditions and the business request, a fourth serial number is generated and returned as the target serial number.
2. The serial number generation method according to claim 1, characterized in that, Prior to obtaining the user's business request, the method further includes: Obtain business information from the business system, wherein the business information includes at least one business type and / or business content of the business system. Based on the business information, the registration conditions matching each of the business types are determined, and the registration conditions include business number, coding rules, and business name; Based on all the aforementioned registration conditions, determine the sequence registry of the business system.
3. The serial number generation method according to claim 2, characterized in that, After determining the sequence registry of the business system based on all the registration conditions, the method further includes: According to the sequence registry, multiple pre-stored serial numbers are generated. The pre-stored serial numbers are unused serial numbers, and each pre-stored serial number has a corresponding business meaning. Based on all the aforementioned pre-stored sequence numbers, determine the sequence pre-store table of the business system.
4. The serial number generation method according to claim 2, characterized in that, After invoking the preset database of the business system through the invocation parameters and returning the target serial number, the method further includes: Obtain the service status of the target serial number, wherein the service status is used to indicate the service status of the service associated with the target serial number; Based on the service status of the target serial number, it is determined in real time whether the target serial number meets the preset recycling conditions; When it is determined that the target serial number meets the preset recycling conditions, the target serial number is stored in a pre-determined serial recycling table.
5. A serial number generation device, characterized in that, The apparatus is used to perform the serial number generation method as described in any one of claims 1-4, and the apparatus comprises: The acquisition module is used to acquire the user's business request, which indicates the user's willingness to process the business. The generation module is used to generate the calling parameters of the business system based on the business request; The calling module is used to call the preset database of the business system through the calling parameters and return the target serial number. The preset database includes a serial number recycling table, a serial number pre-store table, and a serial number registry. The business meaning of the target serial number matches the business request.
6. A serial number generation device, characterized in that, The device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the serial number generation method as described in any one of claims 1-4.
7. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the serial number generation method as described in any one of claims 1-4.