Table data processing method and device, equipment and medium
By using the method of user ID and self -incremental ID to generate an order number during the database migration of the financial industry, the problem of insufficient seminars data aggregation and dependent on external ID generation services were used to improve the efficiency and system stability.
Patent Information
- Application Number
- CN202411515302.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-01-28
AI Technical Summary
During the database migration process of the financial industry, the data aggregation of sub-tables is insufficient, the number of queries is large, and relying on external ID generation services increases risks.
By obtaining the user ID of the target user and the self -incremental ID in the local cache, generate the order number according to the preset rules, and store it into the subcontractor as the number of new data numbers.
The uniqueness of the order number in multiple sub -forms, avoiding multiple check -ups, reducing the dependence on external ID generation services, and improving the system's anti -risk ability and query efficiency.
Smart Images

Figure CN119377331A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to a table data processing method, device, equipment and medium. Background Art
[0002] In the financial industry, such as banks, insurance companies, securities companies and other financial institutions, user information needs to be saved for easy search. For example, the user rights system of the insurance industry stores the rights information of each user so that it can be searched according to the user's identity document (ID).
[0003] Traditional commercial database software Oracle is mainly based on centralized architecture. The biggest feature of these traditional database software is that all data is concentrated in one database, relying on large high-end equipment to provide high processing power and scalability. There are deficiencies in scalability and maintenance costs.
[0004] Therefore, many institutions have begun to migrate their database systems from Oracle to MySQL databases. As we all know, a single MySQL table should not store too much data. Generally, after reaching millions of data, special attention should be paid to the growth of data. If necessary, database and table divisions should be required. However, many tables in Oracle of existing financial institutions have data exceeding 100 million. Therefore, these super large tables need to be split into multiple sub-tables during migration.
[0005] In the prior art, there are a series of management problems for the sub-tables after migration and splitting, such as insufficient data aggregation. In order to query the data of a certain user, it is necessary to query multiple sub-tables multiple times, resulting in low efficiency. Or, in order to prevent the overlap of data IDs between different sub-tables, it is necessary to introduce a third-party ID generation service to manage the newly added data, which increases the risk of financial institutions.
[0006] Therefore, the above problems existing in the prior art have yet to be solved. Summary of the invention
[0007] The present invention provides a table data processing method, device, equipment and medium to solve the technical problems of insufficient aggregation of sub-table data after migration and splitting, large number of queries, and dependence of ID generation on external services.
[0008] On the first aspect, a table data processing method is provided for processing sub-tables after migration splitting, including: obtaining the user ID of the target user, the target user being the user who adds new data in the sub-table; obtaining an auto-increment identity identification number ID from the local cache, the auto-increment ID being the currently available ID of the sub-table; generating an order number according to the user ID and the auto-increment ID through preset rules, and storing the order number in the sub-table as the numbering data of the new data.
[0009] In some embodiments, generating the order number according to the user ID and the self-increment ID by using a preset rule includes:
[0010] An identification number of preset digits is obtained from the user ID and combined with the self-incrementing ID to form the order number.
[0011] In some embodiments, generating the order number according to the user ID and the self-increment ID by using a preset rule includes:
[0012] The identification number of the preset digits obtained from the user ID is used as the last digit of the order number.
[0013] In some embodiments, generating the order number according to the user ID and the self-increment ID by using a preset rule includes:
[0014] The order number is formed by multiplying the self-increment ID by a preset coefficient and adding it to the user ID.
[0015] In some embodiments, obtaining the auto-increment ID from the local cache includes:
[0016] Obtain the latest auto-increment ID from the local cache at every preset time interval and save it locally;
[0017] The generating of the order number according to the user ID and the self-incrementing ID by using a preset rule includes:
[0018] The order number is generated according to the user ID and the latest self-incrementing ID stored locally using preset rules.
[0019] In some embodiments, the method further comprises:
[0020] Obtaining a table query request, wherein the table query request includes a user ID of a user to be searched;
[0021] Query the order number containing the user ID of the user being searched;
[0022] Display the data corresponding to the found order number.
[0023] In some embodiments, the sub-table is a MySQL table, and the MySQL table is obtained by splitting through Oracle table migration.
[0024] In a second aspect, a table data processing device is provided, which is used to process the sub-tables after migration and splitting, including:
[0025] A first acquisition module is used to acquire a user identity ID of a target user, wherein the target user is a user whose data is newly added in the sub-table;
[0026] A second acquisition module is used to acquire a self-incrementing identity identification number ID from a local cache, where the self-incrementing ID is a currently available ID of the sub-table;
[0027] A processing module is used to generate an order number according to the user ID obtained by the first acquisition module and the self-increment ID obtained by the second acquisition module through a preset rule, and store the order number in the sub-table as the numbering data of the newly added data.
[0028] In some embodiments, the processing module is used to obtain an identification number of preset digits from the user ID and a self-incrementing ID to form an order number.
[0029] In some embodiments, the processing module is used to use the identification number of preset digits obtained from the user ID as the last digit of the order number.
[0030] In some embodiments, the processing module is used to multiply the self-increment ID by a preset coefficient and the resultant multiplied sum is combined with the user ID to form an order number.
[0031] In some embodiments, the second acquisition module obtains the latest auto-increment ID from the local cache at every preset time interval and saves it locally; the processing module is used to generate an order number according to the user ID and the latest auto-increment ID saved locally through preset rules.
[0032] In some embodiments, a query module is also included, wherein the query module is used to obtain a table query request, the table query request includes the user ID of the user being searched; query the order number including the user ID of the user being searched; and display the data corresponding to the found order number.
[0033] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned table data processing method when executing the computer program.
[0034] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned table data processing method are implemented.
[0035] The scheme implemented by the above table data processing method, device, computer equipment and storage medium is used to process the sub-table after migration and splitting, including: obtaining the user ID of the target user, the target user is the user of the newly added data in the sub-table; obtaining the self-increment ID from the local cache, the self-increment ID is the currently available ID of the sub-table; generating an order number according to the user ID and the self-increment ID through preset rules, and storing the order number in the sub-table as the numbering data of the newly added data. By combining the local self-increment ID of the sub-table with the user ID according to the preset rules to generate the order number, the uniqueness of the order number between multiple sub-tables is guaranteed. As a result, there is no need to introduce a third-party ID generation service, and no additional external risks are introduced to the data system. At the same time, since the order number itself contains the content of the user ID, each time an order is queried, the corresponding sub-table can be directly queried according to the user ID, avoiding the process of multiple table lookups and ensuring query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0037] Figure 1 is a schematic diagram of an application environment of a table data processing method in one embodiment of the present invention;
[0038] Figure 2 is a flow chart of a table data processing method in one embodiment of the present invention;
[0039] Figure 3 yes Figure 2 A schematic flow chart of a specific implementation of step S30;
[0040] Figure 4 yes Figure 2 Another specific implementation flow diagram of step S30;
[0041] Figure 5 yes Figure 2 Another specific implementation flow diagram of step S30;
[0042] Figure 6 is a structural schematic diagram of a table data processing device in one embodiment of the present invention;
[0043] Figure 7 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;
[0044] Figure 8 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] In the process of migrating the database system of the financial industry from Oracle to MySQL, since the data stored in a single MySQL table should not be too much, the original super-large table needs to be split during the migration. In the prior art, the business primary key of the table data is hashed and then routed to a sub-table. For example, in the order table data, if the order number is 1234 and the hash is 9, it is divided into order table 9. In actual use, this table splitting method has great disadvantages.
[0047] First, there was a problem with data aggregation. Take the order table as an example. If you want to check all orders of a user, because the orders of this user are hashed into all sub-tables, you need to check all sub-tables for this user's order data, and then aggregate them together for operation. In this way, the number of table lookups has changed from one table lookup before migration to N table lookups after migration (N is the number of sub-tables).
[0048] In this regard, an improved method of routing rules has emerged in the prior art, which uniformly routes to sub-tables according to the user's identity document (ID), that is, the orders of the same user must be in the same table. However, although the order data of the same user are all in the same table, when the front-end request comes, the system does not know which table the user's order data is in, so it is necessary to maintain another user-sub-table association table, first find out which sub-table it is from this table, and then check the specific order data, which is actually checked twice. There is still the problem of an increase in the number of table checks compared to the original.
[0049] Secondly, after the table is sharded, the auto-increment ID of the database can no longer be used, because it is impossible to determine the uniqueness of the auto-increment ID of each shard in all shards. A third-party ID generation service is required. Every time new order data is generated, the latest available ID must be queried through the interface before it can be stored. This virtually introduces other services, which increases the risk compared to the original situation where no third-party services were required, and also needs to be optimized.
[0050] Therefore, in order to overcome the above problems, the present invention provides a table data processing method, device, equipment and medium, which forms an order number by combining the user ID and the self-incrementing ID, and solves the problem of multiple table lookups and reliance on external ID generation services. The following is a detailed description.
[0051] The table data processing method, device, equipment and medium provided by the embodiments of the present invention can be applied in the following aspects: Figure 1 In the application environment, the client communicates with the server through the network. The sub-tables are stored on the server, and the data maintenance personnel send relevant information to the server through the client to manage and maintain the sub-tables.
[0052] The client is generally a device set up in a bank or other financial institution specifically for data management and maintenance, and may be, but not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server may be implemented with an independent server or a server cluster consisting of multiple servers. The present invention is described in detail below through specific embodiments.
[0053] See also Figure 2 As shown, Figure 2 A flowchart of a table data processing method provided by an embodiment of the present invention includes the following steps:
[0054] S10. Obtain the user identification number ID of the target user.
[0055] In this embodiment, the target user is the user who adds data in the sub-table. When a group of user data is added to the database, the user ID of the user needs to be obtained. For example, in the insurance rights system, the user with the user ID 00012 adds a new data that needs to be entered into the current sub-table, and the user ID of the user is obtained: 00012.
[0056] S20. Obtain a self-incrementing identity number ID from the local cache.
[0057] In this embodiment, the self-incrementing ID is the currently available ID of the sub-table. The self-incrementing ID is obtained from the local cache and does not require the introduction of a third-party ID generation service. It is the same as the original table data processing method and does not increase the risk of financial institutions.
[0058] Optionally, the latest auto-increment ID is obtained from the local cache at a preset interval and saved locally. In this way, whenever new data needs to be written to the sub-table, the order number is directly generated according to the user ID and the latest auto-increment ID saved locally through the preset rules. The processing speed is faster and the efficiency is higher.
[0059] S30. Generate an order number according to the user ID and the self-increment ID through preset rules, and store the order number in a sub-table as the numbering data of the newly added data.
[0060] In this embodiment, the order number is used as the number corresponding to the current transaction, and is composed of two parts: the user ID and the self-incrementing ID. This has the following technical effects.
[0061] 1. No need to look up the table multiple times. Taking user ID 00012 as an example, all the data of the user can be maintained in the same sub-table. When the order number corresponding to the user ID 00012 needs to be queried, since the order number is composed of the user ID, it can be directly found once through the user ID 00012 without multiple table lookups.
[0062] 2. No need to introduce external ID generation service. By combining the auto-increment ID in the local cache with the user ID, the probability of duplicate order numbers between different sub-tables is greatly reduced. In this way, the uniqueness of the generated order number can be guaranteed without the need for external ID generation service.
[0063] Through the above two points, the overall system's risk resistance, stability, table lookup speed and system performance have been greatly improved.
[0064] It should be noted that the preset rules for generating order numbers through user IDs and self-incrementing IDs are not limited in the present embodiment. The more clever the preset rules are, the lower the probability of duplication of the generated order numbers is, and the more stable the system is. Therefore, for ease of understanding, the present embodiment provides the following preferred preset rules.
[0065] Embodiment 1.
[0066] The order number is composed of a preset number of digits obtained from the user ID and the auto-increment ID.
[0067] In this embodiment, since the actual user ID may be very long, a recognizable number of digits is obtained as the identification number and the auto-increment ID to form the order number, for example Figure 3 As shown, take the last N digits of the user ID. For example, if the user ID is 00012, take the last two digits "12" and the auto-increment ID to form the order number.
[0068] Embodiment 2.
[0069] The identification number of preset digits obtained from the user ID is used as the last digit of the order number.
[0070] In this embodiment, for example, the last two digits of the user ID are taken as the last digits of the order number, for example Figure 4As shown, assuming that the user ID is 00012 and the auto-increment ID is 1234, the final generated order number is the auto-increment ID + the last two digits of the user ID, that is, the order number = 123412.
[0071] Furthermore, in order to further avoid the risk of duplication of order numbers, the present invention further provides the following solution in real time.
[0072] Embodiment three.
[0073] The order number is formed by multiplying the auto-increment ID by the preset coefficient and adding it to the user ID.
[0074] In this embodiment, by multiplying the auto-increment ID with the preset coefficient, the difference between different auto-increment IDs is further magnified, and duplication between auto-increment IDs is further prevented. As shown in Example 5, the order number = auto-increment ID multiplied by the preset coefficient 31 + the last two digits of the user ID. In this way, only the auto-increment ID in the local cache is used to achieve a highly unique order number. At the same time, since the last two digits of the order number are the last digits of the user ID, when it is necessary to query the sub-table corresponding to the user with ID 00012, only the last digit 12 needs to be entered to find the corresponding order.
[0075] From the above, it can be seen that the table data processing method provided by the embodiment of the present invention includes obtaining the user identity identification number ID of the target user, the target user is the user who adds new data in the sub-table; obtaining the self-incrementing identity identification number ID from the local cache, the self-incrementing ID is the currently available ID of the sub-table; generating an order number according to the user ID and the self-incrementing ID through preset rules, and storing the order number in the sub-table as the numbering data of the newly added data. By combining the local self-incrementing ID of the sub-table with the user ID according to the preset rules to generate the order number, the uniqueness of the order number among multiple sub-tables is guaranteed, thereby, there is no need to introduce a third-party ID generation service, and no additional external risks are introduced to the data system. At the same time, since the order number itself contains the content of the user ID, each time an order is queried, the corresponding sub-table can be directly queried according to the user ID, avoiding the process of multiple table lookups and ensuring query efficiency.
[0076] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0077] In one embodiment, a table data processing device is provided, which corresponds one-to-one to the table data processing method in the above embodiment. Figure 6 As shown, the table data processing device includes:
[0078] The first acquisition module 101 is used to acquire the user identity ID of the target user, where the target user is the user whose data is newly added in the sub-table;
[0079] The target user is the user who adds new data in the sub-table. When a set of user data is added to the database, the user ID of the user needs to be obtained. For example, in the insurance rights system, the user with the user ID 00012 adds a new data that needs to be entered into the current sub-table, so the user ID of the user is obtained: 00012.
[0080] The second acquisition module 102 is used to acquire a self-incrementing identity ID from a local cache, where the self-incrementing ID is a currently available ID for the sub-table;
[0081] Among them, the self-increment ID is the currently available ID of the sub-table. The self-increment ID is obtained from the local cache and does not require the introduction of a third-party ID generation service. It is the same as the original table data processing method and will not increase the risk of financial institutions.
[0082] Optionally, the latest auto-increment ID is obtained from the local cache at a preset interval and saved locally. In this way, whenever new data needs to be written to the sub-table, the order number is directly generated according to the user ID and the latest auto-increment ID saved locally through the preset rules. The processing speed is faster and the efficiency is higher.
[0083] The processing module 103 is used to generate an order number according to a preset rule based on the user ID obtained by the first obtaining module 101 and the self-incrementing ID obtained by the second obtaining module 102, and store the order number in a sub-table as the numbering data of the newly added data.
[0084] Among them, the order number is used as the number corresponding to the current transaction, which consists of two parts: the user ID and the self-increment ID. This has the following technical effects.
[0085] 1. No need to look up the table multiple times. Taking user ID 00012 as an example, all the data of the user can be maintained in the same sub-table. When the order number corresponding to the user ID 00012 needs to be queried, since the order number is composed of the user ID, it can be directly found once through the user ID 00012 without multiple table lookups.
[0086] 2. No need to introduce external ID generation service. By combining the auto-increment ID in the local cache with the user ID, the probability of duplicate order numbers between different sub-tables is greatly reduced. In this way, the uniqueness of the generated order number can be guaranteed without the need for external ID generation service.
[0087] Through the above two points, the overall system's risk resistance, stability, table lookup speed and system performance have been greatly improved.
[0088] It should be noted that the preset rules for generating order numbers through user IDs and self-incrementing IDs are not limited in the present embodiment. The more clever the preset rules are, the lower the probability of duplication of the generated order numbers is, and the more stable the system is. Therefore, for ease of understanding, the present embodiment provides the following preferred preset rules.
[0089] Embodiment 1.
[0090] The order number is composed of a preset number of digits obtained from the user ID and the auto-increment ID.
[0091] In this embodiment, since the actual user ID may be very long, a recognizable number of digits is obtained as the identification number and the auto-increment ID to form the order number, for example Figure 3 As shown, take the last N digits of the user ID. For example, if the user ID is 00012, take the last two digits "12" and the auto-increment ID to form the order number.
[0092] Embodiment 2.
[0093] The identification number of preset digits obtained from the user ID is used as the last digit of the order number.
[0094] In this embodiment, for example, the last two digits of the user ID are taken as the last digits of the order number, for example Figure 4 As shown, assuming that the user ID is 00012 and the auto-increment ID is 1234, the final generated order number is the auto-increment ID + the last two digits of the user ID, that is, the order number = 123412.
[0095] Furthermore, in order to further avoid the risk of duplication of order numbers, the present invention further provides the following solution in real time.
[0096] Embodiment three.
[0097] The order number is formed by multiplying the auto-increment ID by the preset coefficient and adding it to the user ID.
[0098] In this embodiment, by multiplying the auto-increment ID with the preset coefficient, the difference between different auto-increment IDs is further magnified, and duplication between auto-increment IDs is further prevented. As shown in Example 5, the order number = auto-increment ID multiplied by the preset coefficient 31 + the last two digits of the user ID. In this way, only the auto-increment ID in the local cache is used to achieve a highly unique order number. At the same time, since the last two digits of the order number are the last digits of the user ID, when it is necessary to query the sub-table corresponding to the user with ID 00012, only the last digit 12 needs to be entered to find the corresponding order.
[0099] In some embodiments, the processing module 103 is used to obtain an identification number of preset digits from the user ID and a self-incrementing ID to form an order number.
[0100] In some embodiments, the processing module 103 is used to use the identification number of preset digits obtained from the user ID as the last digit of the order number.
[0101] In some embodiments, the processing module 103 is used to multiply the self-increment ID by a preset coefficient and add the resultant to the user ID to form an order number.
[0102] In some embodiments, the second acquisition module 102 is used to obtain the latest auto-increment ID from the local cache at every preset time interval and save it locally; the processing module 103 is used to generate an order number according to the user ID and the latest auto-increment ID saved locally through preset rules.
[0103] In some embodiments, a query module 104 is also included, and the query module 104 is used to obtain a table query request, which includes the user ID of the user being searched; query the order number that includes the user ID of the user being searched; and display the data corresponding to the found order number.
[0104] The present invention provides a table data processing device for processing sub-tables after migration and splitting, including: obtaining a user identity identification number ID of a target user, the target user being a user of newly added data in the sub-table; obtaining a self-incrementing identity identification number ID from a local cache, the self-incrementing ID being a currently available ID of the sub-table; generating an order number according to a preset rule based on the user ID and the self-incrementing ID, and storing the order number in the sub-table as the numbering data of the newly added data. By combining the local self-incrementing ID of the sub-table with the user ID according to the preset rules to generate an order number, the uniqueness of the order number among multiple sub-tables is guaranteed, thereby eliminating the need to introduce a third-party ID generation service and introducing no additional external risks to the data system. At the same time, since the order number itself contains the content of the user ID, each time an order is queried, the corresponding sub-table can be directly queried according to the user ID, thus avoiding the process of multiple table lookups and ensuring query efficiency.
[0105] The specific definition of the table data processing device can be found in the definition of the table data processing method above, which will not be repeated here. Each module in the above table data processing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0106] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a table data processing method server side.
[0107] In some embodiments, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server through a network connection. When the computer program is executed by the processor, it implements a function or step on the client side of a table data processing method
[0108] In some embodiments, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0109] Acquire the video information of the user, the video information includes an audio stream and a video stream, wherein the audio stream includes the voice information spoken by the user; the video stream includes the picture information when the user speaks the voice information;
[0110] The first timestamp when the user's spoken voice information is obtained from the audio stream;
[0111] Obtaining a second timestamp of the screen information when the user is speaking from the video stream;
[0112] When the time recorded by the first timestamp and the second timestamp coincides or the error is less than a preset value, it is determined that the voice information is dictated by the user recorded in the picture information.
[0113] In some embodiments, when the processor executes the step of generating an order number according to a preset rule based on a user ID and a self-incrementing ID, it is specifically used to:
[0114] The order number is composed of a preset number of digits obtained from the user ID and the auto-increment ID.
[0115] In some embodiments, when the processor executes the step of generating an order number according to a preset rule based on a user ID and a self-incrementing ID, it is specifically used to:
[0116] The identification number of preset digits obtained from the user ID is used as the last digit of the order number.
[0117] In some embodiments, when the processor executes the step of generating an order number according to a preset rule based on a user ID and a self-incrementing ID, it is specifically used to:
[0118] The order number is formed by multiplying the auto-increment ID by the preset coefficient and adding it to the user ID.
[0119] In some embodiments, when the processor executes the step of obtaining the self-incrementing ID from the local cache, it is specifically used to:
[0120] Get the latest auto-increment ID from the local cache at every preset interval and save it locally;
[0121] At this time, when the processor executes the step of generating an order number according to a preset rule based on the user ID and the self-increment ID, it is specifically used to:
[0122] Generate an order number based on the user ID and the latest auto-increment ID saved locally using preset rules.
[0123] In some embodiments, the processor is further configured to:
[0124] Get a table query request, which contains the user ID of the user being searched;
[0125] Query the order number that contains the user ID of the user being searched;
[0126] Display the data corresponding to the found order number.
[0127] In some embodiments, the sub-table is a MySQL table, which is obtained by splitting the MySQL table through Oracle table migration.
[0128] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0129] Get the user ID of the target user, the target user is the user who added new data in the sub-table;
[0130] Get the auto-increment ID from the local cache. The auto-increment ID is the currently available ID of the sub-table.
[0131] Generate an order number according to the preset rules based on the user ID and the auto-increment ID, and store the order number in a sub-table as the numbering data for the newly added data.
[0132] In some embodiments, the order number is generated according to the user ID and the auto-increment ID by using preset rules, including:
[0133] The order number is composed of a preset number of digits obtained from the user ID and the auto-increment ID.
[0134] In some embodiments, the order number is generated according to the user ID and the auto-increment ID by using preset rules, including:
[0135] The identification number of preset digits obtained from the user ID is used as the last digit of the order number.
[0136] In some embodiments, the order number is generated according to the user ID and the auto-increment ID by using preset rules, including:
[0137] The order number is formed by multiplying the auto-increment ID by the preset coefficient and adding it to the user ID.
[0138] In some embodiments, obtaining the auto-increment ID from the local cache includes:
[0139] Get the latest auto-increment ID from the local cache at every preset interval and save it locally;
[0140] Generate order numbers based on user ID and auto-increment ID using preset rules, including:
[0141] Generate an order number based on the user ID and the latest auto-increment ID saved locally using preset rules.
[0142] In some embodiments, when the computer program is executed by the processor, the following steps are also implemented:
[0143] Get a table query request, which contains the user ID of the user being searched;
[0144] Query the order number that contains the user ID of the user being searched;
[0145] Display the data corresponding to the found order number.
[0146] In some embodiments, the sub-table is a MySQL table, which is obtained by splitting the MySQL table through Oracle table migration.
[0147] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0148] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention 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. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0149] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0150] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A table data processing method, used to process the sub-tables after migration and splitting, characterized in that: include: Obtaining a user ID of a target user, where the target user is a user who has newly added data in the sub-table; Obtain an auto-increment ID from the local cache, where the auto-increment ID is the currently available ID of the sub-table; An order number is generated according to the user ID and the self-increment ID by a preset rule, and the order number is stored in the sub-table as the numbering data of the newly added data.
2. The table data processing method according to claim 1, characterized in that: Generating the order number according to the user ID and the self-incrementing ID by using a preset rule includes: An identification number of preset digits is obtained from the user ID and combined with the self-incrementing ID to form the order number.
3. The table data processing method according to claim 2, characterized in that: The generating of the order number according to the user ID and the self-incrementing ID by using a preset rule includes: The identification number of the preset digits obtained from the user ID is used as the last digit of the order number.
4. The table data processing method according to claim 2 or 3, characterized in that: Generating the order number according to the user ID and the self-incrementing ID by using a preset rule includes: The order number is formed by multiplying the self-increment ID by a preset coefficient and adding it to the user ID.
5. The table data processing method according to claim 1, characterized in that: The step of obtaining the auto-increment ID from the local cache includes: Obtain the latest auto-increment ID from the local cache at every preset time interval and save it locally; Generating the order number according to the user ID and the self-incrementing ID by using a preset rule includes: The order number is generated according to the user ID and the latest self-incrementing ID stored locally using preset rules.
6. The table data processing method according to claim 1, characterized in that: The method further comprises: Obtaining a table query request, wherein the table query request includes a user ID of a user to be searched; Query the order number containing the user ID of the user being searched; Display the data corresponding to the found order number.
7. The table data processing method according to claim 1, characterized in that: The sub-table is a MySQL table, and the MySQL table is obtained by splitting through Oracle table migration.
8. A table data processing device, used for processing the sub-tables after migration and splitting, characterized in that: include: A first acquisition module is used to acquire a user ID of a target user, where the target user is a user whose data is newly added in the sub-table; A second acquisition module is used to acquire a self-incrementing ID from a local cache, where the self-incrementing ID is a currently available ID of the sub-table; A processing module is used to generate an order number according to the user ID obtained by the first acquisition module and the self-increment ID obtained by the second acquisition module through a preset rule, and store the order number in the sub-table as the numbering data of the newly added data.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the table data processing method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the table data processing method according to any one of claims 1 to 7 are implemented.