Data numbering method, apparatus, system, electronic device, and storage medium
By performing dual lookups in the number caching layer and the number persistence layer, combined with the number generation mode, the redundancy problem when multiple users or systems simultaneously request data numbers is solved, achieving efficient and accurate data number generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU DBAPPSECURITY CO LTD
- Filing Date
- 2022-09-16
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, when multiple users or distributed systems request data numbers simultaneously, it can easily lead to problems such as number redundancy and low usability.
By performing a dual lookup in the numbering cache layer and the numbering persistence layer, the maximum number is obtained and the target data number result is generated. The numbering redundancy problem is solved by combining numbering generation modes (such as comparison mode and efficiency mode), ensuring the accuracy and efficiency of numbering.
It improves the accuracy and efficiency of data numbering, avoids number redundancy, and achieves efficient data numbering generation.
Smart Images

Figure CN115455055B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to data numbering methods, apparatus, systems, electronic devices, and storage media. Background Technology
[0002] In scenarios involving data generation or storage, such as generating information entries, reports, or storing information, data needs to be numbered. Without a reusable and efficient automatic numbering generation solution, the result will be low numbering efficiency and high development costs. Therefore, a reusable and efficient numbering generation solution is required.
[0003] Currently, the common approach in related technologies is to obtain a new ID by retrieving the maximum ID from the cache server and incrementing it. However, this method has limitations. When multiple users or distributed systems simultaneously request new IDs, all users or systems will receive the same ID. This can lead to errors when referencing the ID later, resulting in redundancy and low usability.
[0004] There is currently no effective solution to the problems of redundant generated numbers and low practicality in related technologies. Summary of the Invention
[0005] This embodiment provides a data numbering method, apparatus, system, electronic device, and storage medium to solve the problems of redundant and low practicality of generated numbers in related technologies.
[0006] Firstly, this embodiment provides a data numbering method, including:
[0007] Obtain the data to be numbered and the numbering type of the data to be numbered;
[0008] Search the cache type lookup result corresponding to the number type in the numbered cache layer;
[0009] Based on the cache type lookup result, obtain the maximum number in the number persistence layer corresponding to the number type; obtain the target data number result based on the maximum number, and store the target data number result in the number cache layer and the number persistence layer.
[0010] In some embodiments, after searching for the cache type lookup result corresponding to the number type in the number cache layer, and before storing the target data numbering result in the number cache layer and the number persistence layer, the method further includes:
[0011] If the cache type lookup result indicates that the number type was successfully found in the number cache layer, the current data number result corresponding to the number type in the number cache layer is obtained;
[0012] The target data number result is generated based at least on the current data number result.
[0013] In some embodiments, generating the target data number result based on the current data number result includes:
[0014] Get the preset number generation pattern;
[0015] The target data numbering result is obtained at least based on the numbering generation pattern and the current data numbering result.
[0016] In some embodiments, the numbering generation mode includes a comparison mode; obtaining the target data numbering result based at least on the numbering generation mode and the current data numbering result includes:
[0017] When the number generation mode is the comparison mode, the maximum number in the number persistence layer corresponding to the number type is obtained according to the cache type lookup result, and the target data number result is generated according to the current data number result and the maximum number and stored in the number persistence layer.
[0018] In some embodiments, the numbering generation mode includes an efficient mode; obtaining the target data numbering result based at least on the numbering generation mode and the current data numbering result includes:
[0019] When the numbering generation mode is the efficient mode, the target data numbering result is generated based on the current data numbering result.
[0020] In some embodiments, the number persistence layer is categorized and set in a preset database according to the regular expression rules of the number type; wherein the preset database includes relational databases and non-relational databases.
[0021] Secondly, this embodiment provides a data numbering device, including: an acquisition module, a search module, and a numbering module;
[0022] The acquisition module acquires the data to be numbered and the numbering type of the data to be numbered;
[0023] The search module searches for the cache type search result corresponding to the number type in the number cache layer;
[0024] The numbering module retrieves the maximum number in the number persistence layer corresponding to the numbering type based on the cache type lookup result; obtains the target data numbering result based on the maximum number, and stores the target data numbering result in the numbering cache layer and the number persistence layer.
[0025] Thirdly, this embodiment provides a data numbering system, including: terminal equipment, transmission equipment, and server equipment;
[0026] The server device is used to execute the data numbering method described in any of the first aspects above;
[0027] The transmission device is used to transmit the target data numbering result to the terminal device;
[0028] The terminal device is used to display the target data numbering result.
[0029] Fourthly, this embodiment provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data numbering method described in the first aspect above.
[0030] Fifthly, this embodiment provides a storage medium on which a computer program is stored, which, when executed by a processor, implements the data numbering method described in the first aspect above.
[0031] Compared with related technologies, the data numbering method, apparatus, system, electronic device, and storage medium provided in this embodiment solve the problems of redundant and low practicality of generated numbers by obtaining the data to be numbered and the numbering type of the data to be numbered; searching for the cache type lookup result corresponding to the numbering type in the numbering cache layer; obtaining the maximum number in the number persistence layer corresponding to the numbering type based on the cache type lookup result; and obtaining and storing the target data numbering result based on the maximum number.
[0032] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0033] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0034] Figure 1This is a diagram illustrating an application scenario of the data numbering method in one embodiment;
[0035] Figure 2 This is a flowchart illustrating a data numbering method in one embodiment;
[0036] Figure 3 This is a flowchart illustrating the data numbering method in another embodiment;
[0037] Figure 4 This is a structural block diagram of a data numbering device in one embodiment;
[0038] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0039] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0040] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.
[0041] The data numbering method provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal device 102 communicates with server device 104 via a network. Server device 104 obtains the data to be numbered and the numbering type of the data; server device 104 searches for the cache type lookup result corresponding to the numbering type in the numbering cache layer; based on the cache type lookup result, server device 104 obtains the maximum number in the number persistence layer corresponding to the numbering type; based on the maximum number, it obtains the target data numbering result and stores the target data numbering result in the numbering cache layer and the number persistence layer. Terminal device 102 displays the target data numbering result. Terminal device 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, and server device 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0042] This embodiment provides a data numbering method. Figure 2 This is a flowchart of the data numbering method in this embodiment, as follows: Figure 2 As shown, the process includes the following steps:
[0043] Step S202: Obtain the data to be numbered and the numbering type of the data to be numbered. The data to be numbered includes structured data and unstructured data; the numbering type refers to the data type of the data to be numbered, which can be text data, image / video data, audio data, etc.
[0044] Step S204: Search for the cache type lookup result corresponding to the number type in the number cache layer. Here, the number cache layer refers to the cache layer that acquires and updates the data number corresponding to the number type; the cache type lookup result refers to the lookup result indicating the existence status of the data number obtained by searching for the data number based on the number type.
[0045] Step S206: Based on the cache type lookup result, obtain the maximum number in the number persistence layer corresponding to the number type; obtain the target data number result based on the maximum number, and store the target data number result in the number cache layer and the number persistence layer.
[0046] Here, the persistent numbering layer refers to the database used for long-term storage of the data to be numbered; the maximum number refers to the code with the largest value among the stored numbers in the persistent numbering layer; the target data numbering result refers to the result obtained by incrementing or decrementing the number of the data to be numbered according to the numbering rules based on the maximum number; the incrementing operation of the numbering rules can be +1, even number increment, or other reasonable incrementing methods, which will not be elaborated here; storing the target data numbering result in the numbering cache layer means replacing the current data numbering result corresponding to the cache type in the numbering cache layer with the target data numbering result; storing the target data numbering result in both the numbering cache layer and the persistent numbering layer means continuously storing the target data numbering result in the same category as the numbering type, so as to achieve the purpose of storing the numbered data in the persistent numbering layer.
[0047] It should be noted that the above-mentioned method of obtaining the maximum number in the number persistence layer corresponding to the number type based on the cache type lookup result can be executed either when the cache type lookup result indicates that the number type was successfully found in the number cache layer, or when it fails. When the number type is successfully found in the number cache layer, step S206 obtains the maximum number in the number persistence layer for the number type that already exists in the current number cache layer to obtain the target data number result. When the number type is not found in the number cache layer, the current number cache layer has not yet generated and cached numbers for the data to be processed with the same number type. Therefore, step S206 directly obtains the maximum number in the number persistence layer corresponding to the number type to obtain the target data number result.
[0048] Through the above steps, in the data number generation method of this embodiment, for the acquired data to be numbered, the cache type lookup result is searched in the current number cache layer according to the number type of the data to be numbered, and the corresponding maximum number in the number persistence layer is searched according to the cache type lookup result, and the target data number result is further obtained and stored. Compared with the related technology, which increments the number based on the maximum number in the cache server, this embodiment adopts a two-step search method of number cache layer and number persistence layer. When multiple users simultaneously request to add numbers, or multiple distributed systems simultaneously request to add numbers, the server device 104 determines the maximum number through two searches. Thus, when a user or system generates a first number, the number persistence layer will store the first number, and another user or system will obtain the maximum number including the first number in the number persistence layer, and further obtain the target data number result. This solves the problems of number redundancy and low practicality, and improves the accuracy of data numbering.
[0049] In some embodiments, after searching for the cache type lookup result corresponding to the number type in the number cache layer, and before storing the target data numbering result in the number cache layer and the number persistence layer, the method further includes:
[0050] If the lookup result for this cache type indicates that the lookup for this number type was successful in the cache layer with this number, then retrieve the current data number result corresponding to this number type in the cache layer with this number.
[0051] At least the target data number result should be generated based on the current data number result.
[0052] Here, the current data number result refers to the data number result for this number type stored in the number cache layer, which generally indicates the previous target data number result of the previous data to be numbered; in the case of this embodiment, the current data number result can be directly used as the maximum number.
[0053] Through the above steps, if the cache type lookup result indicates that the number type was successfully found in the number cache layer, the target data number result can be directly generated based on the current data number result. Compared with the technical solution of obtaining the maximum number in the number persistence layer and further generating the target data number result based on the maximum number, the technical solution in this embodiment can directly obtain the target data cache result based on the current data number result corresponding to the obtained cache type lookup result, without needing to obtain the maximum number again, thereby reducing the time for generating the data number and improving the efficiency of data number generation.
[0054] In some embodiments, generating the target data number result based on the current data number result includes:
[0055] Get the preset number generation pattern;
[0056] The target data number result can be obtained at least based on the number generation pattern and the current data number result.
[0057] The number generation mode refers to the method of performing data numbering on the data to be numbered. For example, in the case of duplicate numbers, the number generation mode can generate the target data number result by replacing the current data number result; or in the case of multiple users or multiple systems, the number generation mode can generate the target data number result by comparing the current data number result with a preset number. The number generation mode can be obtained from the terminal device 102 or the server device 104. Specifically, the server device 104 can obtain the user's number change operation from the terminal device 102, for example, based on the user's number change operation sent by the server device 104. The second number entered based on the duplicate numbering reminder (e.g., the value of the second number is 5) replaces the current data numbering result (value is 2), and the corresponding numbering generation mode is obtained based on the numbering change operation; or, the user identification record on the server device 104 is obtained. If the result of the user identification record is multi-user or multi-system, a preset number is obtained, and the current data numbering result of multi-user or multi-system is compared with the preset number to determine the target data numbering result for each user or each system. Here, the preset number refers to a static number set by the user in advance, or it can be a dynamic number set by the user according to certain numbering rules.
[0058] By following the steps above and obtaining the number generation pattern, situations involving multiple users, multiple systems, or duplicate numbers can be identified. Different data numbering methods can be implemented based on the identified situations, thereby avoiding data number redundancy and solving the problems of number redundancy and low practicality.
[0059] In some embodiments, the numbering generation mode includes a comparison mode; obtaining the target data numbering result based at least on the numbering generation mode and the current data numbering result includes:
[0060] When the number generation mode is the comparison mode, the maximum number in the number persistence layer corresponding to the number type is obtained according to the cache type lookup result. The target data number result is generated according to the current data number result and the maximum number and stored in the number persistence layer.
[0061] Specifically, in the comparison mode of this embodiment, the preset number can be the maximum number corresponding to the number type in the number persistence layer; the current data number result is compared with the maximum number to obtain the larger number result, and the target data number result is obtained by incrementing according to the numbering rules based on the larger number result; wherein, the incrementing operation of the numbering rules can be +1 increment, even number increment, or other reasonable incrementing methods, which will not be elaborated here.
[0062] Through the above steps, the current data numbering result in the numbering cache layer can be compared with the maximum number in the numbering persistence layer to determine the larger numbering result among the numbered data, and the target data numbering result can be obtained based on the larger numbering result. In this process, since the number generated for each data to be numbered is compared one by one, the problem of number redundancy caused by multiple users or multiple systems generating duplicate numbers will not occur, thus avoiding the problem of data number redundancy and solving the problems of number redundancy and low practicality.
[0063] In some embodiments, the numbering generation mode includes an efficient mode; obtaining the target data numbering result based at least on the numbering generation mode and the current data numbering result includes:
[0064] When the numbering generation mode is the efficient mode, the target data numbering result is generated based on the current data numbering result.
[0065] The number generation mode of the high-efficiency mode is obtained from the preset mode input by the user on the terminal device 102. In the case of high-efficiency mode, even if there are multiple users, multiple systems or duplicate numbers, the server device 104 directly increases or decreases the target data number result according to the numbering rules based on the current data number result.
[0066] By following the steps above, when the number generation mode is the efficient mode, the target data number result can be generated directly based on the current data number result, thereby reducing the data number generation time and improving the data number generation efficiency.
[0067] In some embodiments, the persistence layer of the number is classified and set in a preset database according to the regular expression rules of the number type.
[0068] The aforementioned preset database can be a database such as MySQL or Elasticsearch; the regular expression rule can be determined based on the prefix and / or suffix of the type; the server device 104 generates different number persistence layers based on the regular expression rule, the number type, and database attributes (including database type and database storage address, etc.), and these number persistence layers do not interfere with each other; specifically, the server device 104 uses a multi-threaded approach to perform data numbering, and the threads do not interfere with each other. When numbering data to be numbered, due to the independence of threads and number persistence layers, even if multiple users, multiple systems, or duplicate numbering occur, as long as the number persistence layers are different, that is, as long as the number types of the data to be numbered are different, there will be no number redundancy.
[0069] By following the steps above, different persistent numbering layers are obtained based on regular expression rules, numbering types, and database attributes. This avoids numbering redundancy when numbering data, thus solving the problems of numbering redundancy and low usability, and improving the accuracy of data numbering.
[0070] This embodiment also provides a data numbering method. Figure 3 This is a flowchart of another data numbering method in this embodiment, such as... Figure 3 As shown, the process includes the following steps:
[0071] Step S302: Obtain the data to be numbered. This data includes both structured and unstructured data.
[0072] Step S304: Obtain the number type of the data to be numbered, thus obtaining the different types shown in step S305, and proceed to step S306. Here, the number type refers to the data type of the data to be numbered, which can be text data, image / video data, audio data, etc.
[0073] Step S306: Search for the cache type lookup result corresponding to the number type in the number cache layer. Here, the number cache layer refers to the cache layer that acquires and updates the data number corresponding to the number type; the cache type lookup result refers to the lookup result indicating the existence status of the data number obtained by searching for the data number based on the number type.
[0074] Step S308: Determine whether the cache type lookup result was successful. If the lookup is successful, proceed to step S322; if the lookup fails, proceed to step S310.
[0075] Step S310: Find the largest ID in the ID persistence layer that corresponds to the ID type based on regular expression matching. Here, the ID persistence layer refers to the database used for long-term storage of the data to be numbered; the regular expression matching refers to matching based on the prefix and / or suffix of the ID type, as well as the type or path of the storage database.
[0076] Step S312: Obtain the target data numbering result based on the maximum number. This target data numbering result refers to the result obtained by incrementing or decrementing the numbering of the data to be numbered according to the numbering rules based on the maximum number.
[0077] Step S314: Execute steps S316 and S318 based on the target data number result.
[0078] Step S316: Store the target data numbering result in the numbering persistence layer.
[0079] Step S318: Add a new cached number or refresh the cached number of the target data numbering result to the numbering cache layer. Specifically, persistently store the target data numbering result in a category with the same number type to achieve the purpose of storing the numbered data in the number persistence layer.
[0080] Step S322: Obtain the current data number result corresponding to the number type in the number cache layer. Specifically, replace the current data number result corresponding to the cache type in the number cache layer with the target data number result.
[0081] Step S324: Determine the number generation mode. If the number generation mode is comparison mode, proceed to step S326; if the number generation mode is efficiency mode, proceed to step S334.
[0082] Step S326: The number generation mode is comparison mode, proceed to step S328.
[0083] Step S328: Determine whether the maximum number is greater than the current data number result. If the maximum number is greater than the current data number result, execute step S330 to replace the value of the current data number result with the value of the maximum number, and obtain the target data number result based on the replaced current data number result, then continue to execute step S314; if the maximum number is less than or equal to the current data number result, execute step S312.
[0084] In step S334, the number generation mode is the high-efficiency mode. Execute step S332 to directly generate the target data number result based on the obtained current data number result, and continue to execute step S314.
[0085] Through the above steps, in the data number generation method of this embodiment, for the acquired data to be numbered, the cache type lookup result is searched in the current number cache layer according to the number type of the data to be numbered, and the corresponding maximum number in the number persistence layer is searched according to the cache type lookup result, and the target data number result is further obtained and stored, which solves the problems of number redundancy and low practicality, and improves the accuracy of data numbering.
[0086] It should be understood that, although Figure 2-3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2-3At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0087] This embodiment also provides a data numbering device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. The terms "module," "unit," "subunit," etc., used below refer to combinations of software and / or hardware that perform a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0088] Figure 4 This is a structural block diagram of the data numbering device in this embodiment, as shown below. Figure 4 As shown, the device includes: an acquisition module 10, a search module 20, and a numbering module 30;
[0089] The acquisition module 10 acquires the data to be numbered and the numbering type of the data to be numbered.
[0090] The lookup module 20 searches for the cache type lookup result corresponding to the number type in the number cache layer;
[0091] The numbering module 30 retrieves the maximum number in the number persistence layer corresponding to the numbering type based on the cache type lookup result; obtains the target data numbering result based on the maximum number, and stores the target data numbering result in the numbering cache layer and the number persistence layer.
[0092] For specific limitations regarding the data numbering device, please refer to the limitations on the data numbering method above, which will not be repeated here. Each module in the aforementioned data numbering device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.
[0093] This embodiment also provides a data numbering system, which includes: a terminal device 102, a transmission device, and a server device 104;
[0094] The server device 104 is used to implement any of the data numbering methods in the above embodiments;
[0095] The transmission device is used to transmit the target data numbering result to the terminal device 102;
[0096] The terminal device 102 is used to display the result of the target data numbering.
[0097] This embodiment also provides an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0098] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0099] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0100] S1, obtain the data to be numbered and the numbering type of the data to be numbered;
[0101] S2, search for the cache type lookup result corresponding to the number type in the number cache layer;
[0102] S3. Based on the lookup result of the cache type, obtain the maximum number in the number persistence layer corresponding to the number type; obtain the target data number result based on the maximum number, and store the target data number result in the number cache layer and the number persistence layer.
[0103] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.
[0104] Furthermore, in conjunction with the data numbering methods provided in the above embodiments, this embodiment can also provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the data numbering methods described in the above embodiments.
[0105] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores target data numbering result data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a data numbering method.
[0106] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0108] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0109] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.
[0110] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0111] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.
Claims
1. A data numbering method, characterized in that, include: Obtain the data to be numbered and the numbering type of the data to be numbered; Search the cache type lookup result corresponding to the number type in the number cache layer; wherein, the cache type lookup result refers to the lookup result indicating the existence status of the data number obtained by searching the data number according to the number type; Based on the cache type lookup result, obtain the maximum number in the number persistence layer corresponding to the number type; If the cache type lookup result indicates that the number type lookup in the number cache layer failed, the target data number result is obtained based on the maximum number; If the cache type lookup result indicates that the number type was successfully found in the number cache layer, the current data number result corresponding to the number type in the number cache layer is obtained; When the number generation mode is comparison mode, a larger number result is obtained based on the larger value between the current data number result and the maximum number, and the target data number result is generated based on the larger number result; wherein, the current data number result refers to the maximum number for the number type stored in the number cache layer; The target data numbering result is stored in the numbering cache layer and the numbering persistence layer.
2. The data numbering method according to claim 1, characterized in that, The method further includes: When the numbering generation mode is the efficient mode, the target data numbering result is generated based on the current data numbering result.
3. The data numbering method according to claim 1 or 2, characterized in that, According to the regular expression rules of the number type, the number persistence layer is classified and set in a preset database; wherein, the preset database includes relational databases and non-relational databases.
4. A data numbering device, characterized in that, include: The module includes an acquisition module, a search module, and a numbering module. The acquisition module acquires the data to be numbered and the numbering type of the data to be numbered; The search module searches for a cache type search result corresponding to the number type in the number cache layer; wherein, the cache type search result refers to the search result indicating the existence status of the data number obtained by searching for the data number according to the number type; The numbering module retrieves the maximum number in the number persistence layer corresponding to the numbering type based on the cache type lookup result; If the cache type lookup result indicates that the number type lookup in the number cache layer failed, the numbering module obtains the target data numbering result based on the maximum number; If the cache type lookup result indicates that the number type was successfully found in the number cache layer, the numbering module obtains the current data numbering result corresponding to the number type in the number cache layer. When the numbering generation mode is comparison mode, the numbering module obtains a larger number result based on the larger value between the current data numbering result and the maximum number, and generates the target data numbering result based on the larger number result; wherein, the current data numbering result refers to the maximum number for the number type stored in the numbering cache layer; The numbering module stores the target data numbering result in the numbering cache layer and the numbering persistence layer.
5. A data numbering system, characterized in that, include: Terminal equipment, transmission equipment, and server equipment; The server device is used to execute the data numbering method according to any one of claims 1 to 3; The transmission device is used to transmit the target data numbering result to the terminal device; The terminal device is used to display the target data numbering result.
6. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the data numbering method according to any one of claims 1 to 3.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the data numbering method according to any one of claims 1 to 3.