CN113934726A - Random smooth sub-table method, terminal and storage medium - Google Patents
Random smooth sub-table method, terminal and storage medium Download PDFInfo
- Publication number
- CN113934726A CN113934726A CN202111165294.XA CN202111165294A CN113934726A CN 113934726 A CN113934726 A CN 113934726A CN 202111165294 A CN202111165294 A CN 202111165294A CN 113934726 A CN113934726 A CN 113934726A
- Authority
- CN
- China
- Prior art keywords
- sub
- database
- updating
- configuration
- random
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000013507 mapping Methods 0.000 claims abstract description 48
- 238000007639 printing Methods 0.000 claims description 7
- 230000008859 change Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 3
- 238000011161 development Methods 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000002688 persistence Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000013508 migration Methods 0.000 description 2
- 230000005012 migration Effects 0.000 description 2
- 235000010627 Phaseolus vulgaris Nutrition 0.000 description 1
- 244000046052 Phaseolus vulgaris Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007717 exclusion Effects 0.000 description 1
- 230000001939 inductive effect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000013024 troubleshooting Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a random smooth table dividing method, a terminal and a storage medium, wherein the random smooth table dividing method associates annotation configuration and a database table to be mapped in a configuration file in advance, and specifically comprises the following steps: scanning the database table according to the annotation configuration item; judging whether the scanned object accords with the sub-table configuration, if not, checking whether the database attributes are different in a multi-thread parallel mode, if not, finishing, and if so, generating SQL for updating the database and executing the SQL until finishing; if the configuration of the sub-tables is met, the names of the sub-tables are automatically given, whether the sub-table mapping tables exist is judged, if the sub-table mapping tables exist, whether the attributes of the database are different is checked in a multi-thread parallel mode, if the sub-table mapping tables do not exist, SQL for updating the database is generated and executed till the end. The invention provides a random smooth table dividing method, which can be used for automatically and multithread parallel updating of a database table structure and automatic table division, and remarkably improves the development efficiency.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a random smooth table splitting method, a terminal, and a storage medium.
Background
Most of the service end application data based on Java are persisted by mybatis or Hibernate. Mybatis in the two persistence frameworks does not support automatic table structure updating, and the specific line number of the class calling the persistence method and the final SQL cannot be printed out; hibernate supports automatic table building, but does not support table building, has low single thread speed, and cannot print out the specific line number of the class calling the persistence method and the final SQL.
In the third-party table splitting scheme or plug-in the market, single thread execution is slow, the number of the sub-tables is specified in advance, the sub-tables are manually migrated for the first time, and the specific routing of data to which sub-table is manually inquired during service development, so that the rapid development is not facilitated.
Disclosure of Invention
The invention aims to provide a random smooth table dividing method, which can be used for automatically and multithread parallel updating of a database table structure and automatically dividing tables, and remarkably improving the development efficiency.
The invention discloses a random smooth sub-table method, which adopts the technical scheme that:
a random smooth table dividing method associates annotation configuration and a database table to be mapped in a configuration file in advance, and specifically comprises the following steps:
scanning the database table according to the annotation configuration item;
judging whether the scanned object accords with the sub-table configuration, if not, checking whether the database column attribute and the index attribute are different in a multithreading parallel mode, if not, ending, and if so, generating an SQL statement for updating the database and executing updating to end;
if the configuration of the sub-tables is met, automatically giving names to the sub-tables, judging whether the sub-table mapping table exists or not, checking whether the database column attribute and the index attribute are different or not in a multithreading parallel mode if the sub-table mapping table exists, and generating an SQL statement for updating the database and executing the updating till the end if the sub-table mapping table does not exist.
As a preferred scheme, the step of generating an SQL statement for updating the database and performing the update to the end further includes whether to generate a sub-table mapping table for the first time: and if the branch table mapping table is not generated for the first time, the multithreading parallel execution is updated to the end, and if the branch table mapping table is generated for the first time, the multithreading parallel addition mapping is performed to the branch table mapping table.
As a preferred scheme, the specific steps of generating an SQL statement for updating a database and executing the update are as follows:
calling built-in add, delete, check and change interfaces;
judging whether the sub-table configuration exists, if not, directly generating an SQL statement for updating the database to execute updating, if so, inquiring whether a sub-table record exists in the sub-table mapping table, if so, acquiring the recorded sub-table name to generate the SQL statement for updating the database to execute updating, if a newly added sub-table name is obtained, inserting the record into the sub-table mapping, and randomly calling a weighted random sub-table method to generate the SQL statement for updating the database to execute updating.
Preferably, the calling of the built-in steps of adding, deleting, checking and changing the interface needs to be followed by judging whether the operation is a batch operation, if not, the operation is kept unchanged, and if the operation is a batch operation, whether the step of configuring the sub-tables needs to be grouped according to sub-table keys and is executed circularly according to the groups.
Preferably, the method for randomly classifying the weights comprises the following steps:
generating an array of numbers according to the indications according to the number of the sub-tables;
dividing into three groups according to an optional weight parameter notAllow (not allowed) highestLowest (low probability), which are defaultTarr (designated default group) highestArr (high probability group) loweatArr (low probability group);
taking the absolute value of the Hash value by the sub-table key value;
taking a random number of an absolute value, and generating a default value and a low-probability interval starting number;
a generation list name is randomly acquired in the selected group.
Preferably, the P6Spy component is loaded in the above steps, and automatic printing is realized by intercepting the function of the SQL statement.
The present application further provides a terminal, the terminal including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a random smooth-tabulation method as previously described.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a random smooth sub-table method as described above.
The invention discloses a random smooth sub-table method, which has the beneficial effects that: the annotation configuration and the database table to be mapped are associated in the configuration file in advance for scanning. The database tables are randomly scanned by annotating configuration items. Judging whether the scanned object accords with the sub-table configuration, if not, checking whether the database column attribute and the index attribute are different in a multithreading parallel mode, if not, ending, and if so, generating an SQL statement for updating the database and executing updating to the end. If the configuration of the sub-tables is met, automatically giving names to the sub-tables, judging whether the sub-table mapping table exists or not, checking whether the database column attribute and the index attribute are different or not in a multithreading parallel mode if the sub-table mapping table exists, and generating an SQL statement for updating the database and executing the updating till the end if the sub-table mapping table does not exist. The database table (entity class) is scanned through the associated annotation configuration items, the full-automatic multithreading parallel updating of the database table structure is achieved, tables are automatically sorted, and the development efficiency is remarkably improved.
Drawings
FIG. 1 is a schematic diagram of a directory file of a random smooth table-splitting method according to the present invention.
FIG. 2 is a diagram of the usage of the random smooth table-splitting method to automatically update the tables.
FIG. 3 is a diagram of the introduction of a random smooth table-splitting method according to the present invention.
FIG. 4 is a flow chart of the method for establishing the sub-table mapping according to the present invention.
FIG. 5 is a flow chart of automatic sub-tabulation of a random smooth sub-tabulation method of the present invention.
FIG. 6 is a flow chart of a weighted random table-dividing method in the random smooth table-dividing method of the present invention.
FIG. 7 is a diagram illustrating the effect of the method in the P6Spy component called to print the log in the random smooth table-splitting method according to the present invention.
Detailed Description
The invention will be further elucidated and described with reference to the embodiments and drawings of the specification:
referring to fig. 1, a random smooth table partitioning method associates annotation configuration and a database table to be mapped in a configuration file in advance. Under the database path, the BaseAutoUpdateTable updates the table structure for automatic table creation. BaseTable, BaseColumn is a table configuration attribute annotation, BaseIndex is an index attribute definition annotation, BaseShardingTable is a sub-table configuration attribute annotation, BaseSQL builder is a weighted random sub-table algorithm class and a Sql construction class, and BaseApper is a built-in method interface.
The annotation configuration specifically comprises a custom annotation BaseTable according to an annotation automatic update table structure, wherein the attribute of the custom annotation BaseTable comprises name (corresponding to a table name of a database), indexes (corresponding to an index of the database, which comprises name: an index name, columns: an index column, indexType: an index type), shardingTable (attribute of a sublist, which comprises column: a sublist field, size: a sublist field, notAllow: a sublist not allowed to be newly added, highest: a sublist with high priority, lowest: a sublist with low priority), and the attribute of eCoomn comprises datatype (corresponding to a database data type), defaultValue (default value), allowNull (can be empty), comment (remark), and length (data length).
Please refer to fig. 2 to note that, when configuring a database table (entity class) to be mapped, in a configuration file, a quick code.
Please refer to fig. 3, the item is added with the code, that is, the method provided in the present embodiment is executed, and the specific steps of the random smooth table splitting method are as follows (refer to fig. 4):
the database tables are scanned according to the annotation configuration items.
Judging whether the scanned object accords with the sub-table configuration, if not, checking whether the database column attribute and the index attribute are different in a multithreading parallel mode, if not, ending, and if so, generating an SQL statement for updating the database and executing updating to the end.
If the configuration of the sub-tables is met, automatically giving names to the sub-tables, judging whether the sub-table mapping table exists or not, checking whether the database column attribute and the index attribute are different or not in a multithreading parallel mode if the sub-table mapping table exists, and generating an SQL statement for updating the database and executing the updating till the end if the sub-table mapping table does not exist.
The database table (entity class) is scanned through the associated annotation configuration items, the full-automatic multithreading parallel updating of the database table structure is achieved, tables are automatically sorted, and the development efficiency is remarkably improved.
Preferably, the step of generating the SQL statement for updating the database and performing the update to the end step further includes the step of whether to generate the table mapping table for the first time: and if the branch table mapping table is not generated for the first time, the multithreading parallel execution is updated to the end, and if the branch table mapping table is generated for the first time, the multithreading parallel addition mapping is performed to the branch table mapping table. The mapping is automatically established by the primary sub-table without manual migration, and the error probability can be reduced on the basis of integration.
Referring to fig. 5, the specific steps of generating an SQL statement for updating a database and performing the update are as follows:
and calling built-in add, delete, check and change interfaces.
Judging whether the sub-table configuration exists, if not, directly generating an SQL statement for updating the database to execute updating, if so, inquiring whether a sub-table record exists in the sub-table mapping table, if so, acquiring the recorded sub-table name to generate the SQL statement for updating the database to execute updating, if a newly added sub-table name is obtained, inserting the record into the sub-table mapping, and randomly calling a weighted random sub-table method to generate the SQL statement for updating the database to execute updating. The newly added records are automatically calculated according to the weight, and the routing table is automatically used in a non-sensitive way in other data operations.
Preferably, whether the interface is a batch operation needs to be judged after the built-in steps of adding, deleting, checking and changing the interface are called, if the interface is not the batch operation, the interface is kept unchanged, and if the interface is the batch operation, whether the sub-table configuration step exists or not needs to be grouped according to sub-table keys and is executed circularly according to the group.
The steps are specifically executed as follows:
when the Bean writesqlSessionsFactory is loaded at project startup, it is automatically called:
the method includes the steps of obtaining all classes through a scanning path specified by a quick code.scan.package in a configuration file, then judging whether a BaseTable annotation exists or not in a circulating and one-by-one mode, skipping if the BaseTable annotation exists, judging whether a subordinate name of the subordinate name meets a naming specification or not if the subordinate name does not meet the naming specification, reporting an error to prompt that an abnormal table name is illegal, obtaining all field attributes configured according to the annotation if the subordinate name does not meet the naming specification, indexing the attributes, placing the attributes into a TableProperty object for temporary storage, and placing a TableProperty set list.
And then judging whether the branch tables are started or not according to the shardingTable attribute (the number of the branch tables is more than one and the fields of the branch tables are not empty), if the branch tables are started, reading notAllow, highest and lowest attributes, if the repeated attributes exist in the middle of the low attributes, reporting errors and prompting that the repeated configuration is not allowed, if the configured number is more than the maximum number, the specified branch tables are larger than the maximum branch tables, if the fields selected for the branch tables are not in the effective attributes, reporting errors and prompting that the branch table keys do not exist, constructing the tablepreference attribute of each branch table, simultaneously putting the tablepreference set list into the tablepreference list, and adding a record in the shardingtablelame.
Judging whether the shardingTableName is empty or not after the scanning of all paths is finished,
if not, the configuration sub-table exists, if the configuration sub-table exists, the built-in sub-table mapping table BaseSharding TableMaping is read, a TableProperty attribute is constructed, and a TableProperty set list is also put in.
According to the number of the common thread pool threads CorePoolSize built in the system, dividing the TableProperty set list into TableProperty set lists sharinglist with the number of CorePoolSize groups, and then dividing the TableProperty set lists into the TableProperty set lists with the number of CorePoolSize groups in the sharinglist to execute in parallel: circulating the TableProperty set list, firstly querying the corresponding table attribute in the database by a single TableProperty, directly constructing a complete table creating command if the table does not exist in the database, then sequentially judging whether the current configuration of the index is consistent with that of the database if the table exists in the database, constructing a deleting command and then constructing an adding command if the current configuration of the index is inconsistent with that of the database, and directly constructing an adding command if the current configuration of the index is inconsistent with that of the database and different names of the index are different from each other.
And judging whether the database column attribute is completely consistent with the Basecolumn (basic field) annotation configuration (whether the database column attribute is null, data type, default value, remark and data length), if not, constructing a modification command, and if the database column attribute is not consistent with the Basecolumn attribute, constructing a single attribute adding command, wherein the adding position is behind the last attribute in the class attributes excluding all parent classes.
After all the commands are constructed, grouping is carried out according to a newly added database column, a deleted index and a newly added index of a created table, then parallel execution is carried out in sequence (the data are divided into SQL command set lists with the quantity of CorePoolSize (core connection pool size) groups for parallel execution), and after the execution is finished, the table structure is automatically updated, and the table division is automatically established. And for the data which exist in the built-in branch table mapping table, if the data do not exist in the built-in branch table mapping table and the data in the branch table are not zero, inserting the data into the built-in branch table mapping table after the duplication elimination is inquired according to a branch table key so as to finish the automatic data migration of the primary branch table (constructing the branch table mapping).
The newly added records automatically calculate the sub-tables according to the weight, automatically use the routing tables in a non-inductive manner through other data operations, acquire specific attributes configured by the BaseTable through the class designated by the current Mapper (mapping) general type, judge whether the sub-tables are started according to the shardingTable (the number of the sub-tables is more than one and the fields of the sub-tables are not empty), firstly inquire in the sub-table mapping table if the sub-tables are started, return to the specific routing sub-tables if the sub-tables are started, and call the weight random sub-table algorithm if the sub-tables are not started.
It should be noted that the non-newly added operation does not call the step of randomly dividing the weight table, and for batch addition, batch modification and batch deletion, the operation is divided into groups by the table-dividing key values and executed circularly according to each group. So that the specific routing operation of the branch table is not required to be concerned when the branch table is called.
Referring to fig. 6, the method for randomly assigning weights includes the following steps:
and generating an array of numbers according to the indication according to the number of the sub-tables.
The selectable weight parameter notAllow high probability lowest is divided into three groups, defaultArr (as a designated default group) highestArr (high probability group) loweartar (low probability group).
And the absolute value of the Hash value is taken as the sub-table key value.
The absolute random number is taken and a default, low probability interval start number is generated (specific decision conditions are shown in fig. 6).
A generation list name is randomly acquired in the selected group.
The specific method comprises the following steps: firstly, according to the specified number of the branch tables from 0 to-1 and according to the exclusion specified by notAllow, sequentially putting the candidate arrays into the candidate array, if the candidate array is empty, reporting an error to indicate that the branch tables cannot be calculated, and then putting the candidate into the list highestArr according to the branch tables specified by highest and lowest and putting the rest of the unspecified branch tables into the defaultAlr.
Taking the value of the current to-be-newly-added record list key to obtain the hash code value, and calculating the absolute value of the record (taking the remainder value/list key value), then calculating the random number random (random number) by the search, calculating the maximum interval starting number highestInt (search 0.8), calculating the intermediate value defaultInt (search 0.5),
when random is larger than defaultInt, if random is also larger than highestInt, selecting lowestArr if highestArr is not empty, if yes, judging whether highestArr is empty or not, otherwise, selecting defaulttarr, if random is not larger than defaultInt, selecting defaulttarr, otherwise, sequentially judging empty and selecting highestArr and lowestArr; when random is not more than defaultInt, the highestArr is not selected as null, otherwise, lowestArr and defaultAlr are selected in sequence, then one element is obtained through the selected Arr through random numbers, the random scoring is the weight random scoring at the final calculation position, when the number of the elements in the highestArr, lowestArr and defaultAlrr is the same, according to 100 ten thousand random tests, highests is assigned to be 50%, lowests is assigned to be 15%, and the remaining unspecified (defaultAlrr) is 35%. And after the branch table name is obtained, newly added SQL is constructed according to the branch table name, and then the newly added operation is completed through JDBC calling. The weight ratio coping strategy is configured as shown in fig. 2, and the write-in amount of sub-table data is convenient to control under the condition of large data volume in a main application scene, so that the pressure of a database table is greatly reduced.
Referring to fig. 7, in the implementation step (as shown in fig. 3) provided in this embodiment, a P6Spy component is further loaded, and automatic printing is realized by a function of intercepting an SQL statement. The automatic printing method calls a specific line number, and the automatic printing error-reporting method requests parameters to facilitate on-line problem troubleshooting. In other words, the automatic printing capability acquisition is introduced, and the visual operation mode can facilitate the error checking process of operation and maintenance personnel.
Specifically, the specific line number of the execution of the automatic printing operation intercepts the SQL statement function through the P6Spy component, and before the execution, the current thread calling stack information array is obtained: currentthread (). getStackTrace (), the SQL statement of mybatis is implemented by a dynamic proxy of Jdk.
Therefore, the specific class name and the line number of the calling Mapper method can be obtained only by intercepting the array subscript of the calling class name JdkDynamicAopProxy and moving back by two bits.
The present application further provides a terminal, the terminal including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a random smooth-tabulation method as previously described.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a random smooth sub-table method as described above.
The invention provides a random smooth table dividing method, which associates annotation configuration and a database table to be mapped in a configuration file in advance for scanning. The database tables are randomly scanned by annotating configuration items. Judging whether the scanned object accords with the sub-table configuration, if not, checking whether the database column attribute and the index attribute are different in a multithreading parallel mode, if not, ending, and if so, generating an SQL statement for updating the database and executing updating to the end. If the configuration of the sub-tables is met, automatically giving names to the sub-tables, judging whether the sub-table mapping table exists or not, checking whether the database column attribute and the index attribute are different or not in a multithreading parallel mode if the sub-table mapping table exists, and generating an SQL statement for updating the database and executing the updating till the end if the sub-table mapping table does not exist. The database table (entity class) is scanned through the associated annotation configuration items, the full-automatic multithreading parallel updating of the database table structure is achieved, tables are automatically sorted, and the development efficiency is remarkably improved.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the protection scope of the present invention, although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims (8)
1. A random smooth table dividing method is characterized in that annotation configuration and a database table to be mapped are associated in a configuration file in advance, and the method specifically comprises the following steps:
scanning the database table according to the annotation configuration item;
judging whether the scanned object accords with the sub-table configuration, if not, checking whether the database column attribute and the index attribute are different in a multithreading parallel mode, if not, ending, and if so, generating an SQL statement for updating the database and executing updating to end;
if the configuration of the sub-tables is met, automatically giving names to the sub-tables, judging whether the sub-table mapping table exists or not, checking whether the database column attribute and the index attribute are different or not in a multithreading parallel mode if the sub-table mapping table exists, and generating an SQL statement for updating the database and executing the updating till the end if the sub-table mapping table does not exist.
2. The random smooth table splitting method according to claim 1, wherein between the steps of generating SQL statements for updating the database and performing updating to the end, further comprising the step of whether to generate the table splitting mapping table for the first time: and if the branch table mapping table is not generated for the first time, the multithreading parallel execution is updated to the end, and if the branch table mapping table is generated for the first time, the multithreading parallel addition mapping is performed to the branch table mapping table.
3. The random smooth table splitting method according to claim 2, wherein the specific steps of generating an SQL statement for updating the database and performing the update are as follows:
calling built-in add, delete, check and change interfaces;
judging whether the sub-table configuration exists, if not, directly generating an SQL statement for updating the database to execute updating, if so, inquiring whether a sub-table record exists in the sub-table mapping table, if so, acquiring the recorded sub-table name to generate the SQL statement for updating the database to execute updating, if a newly added sub-table name is obtained, inserting the record into the sub-table mapping, and randomly calling a weighted random sub-table method to generate the SQL statement for updating the database to execute updating.
4. The method according to claim 3, wherein the step of calling the built-in add, delete, check, and change interface is followed by determining whether the operation is a batch operation, if not, the operation is kept unchanged, and if the operation is a batch operation, the step of determining whether the configuration of the sub-table exists needs to be grouped by sub-table keys and executed circularly by groups.
5. The random smooth tabulation method of claim 4, wherein the weighted random tabulation method includes the steps of:
generating an array of numbers according to the indications according to the number of the sub-tables;
dividing into three groups according to an optional weight parameter notAllow (not allowed) highestLowest (low probability), which are defaultTarr (designated default group) highestArr (high probability group) loweatArr (low probability group);
taking the absolute value of the Hash value by the sub-table key value;
taking a random number of an absolute value, and generating a default value and a low-probability interval starting number;
a generation list name is randomly acquired in the selected group.
6. The method according to any one of claims 1 to 5, wherein a P6Spy component is loaded in the above steps, and automatic printing is realized by a function of intercepting SQL statements.
7. A terminal, characterized in that the terminal comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the random smooth sub-table method of any one of claims 1-6.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the random smooth sub-table method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111165294.XA CN113934726A (en) | 2021-09-30 | 2021-09-30 | Random smooth sub-table method, terminal and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111165294.XA CN113934726A (en) | 2021-09-30 | 2021-09-30 | Random smooth sub-table method, terminal and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113934726A true CN113934726A (en) | 2022-01-14 |
Family
ID=79277587
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111165294.XA Pending CN113934726A (en) | 2021-09-30 | 2021-09-30 | Random smooth sub-table method, terminal and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113934726A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115587095A (en) * | 2022-10-08 | 2023-01-10 | 广州市玄武无线科技股份有限公司 | Database sub-table creating method and device and storage medium |
-
2021
- 2021-09-30 CN CN202111165294.XA patent/CN113934726A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115587095A (en) * | 2022-10-08 | 2023-01-10 | 广州市玄武无线科技股份有限公司 | Database sub-table creating method and device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112559554B (en) | Query statement optimization method and device | |
US6681218B1 (en) | System for managing RDBM fragmentations | |
CN112148509A (en) | Data processing method, device, server and computer readable storage medium | |
CN111143368B (en) | Relational database data comparison method and system | |
CN103020089A (en) | Method and device for importing data in EXCEL file to database | |
US11573987B2 (en) | System for detecting data relationships based on sample data | |
CN113934726A (en) | Random smooth sub-table method, terminal and storage medium | |
CN111159020B (en) | Method and device applied to synchronous software test | |
CN112445702A (en) | Automatic testing method and system based on ant colony algorithm | |
CN111581236A (en) | Data query method and device | |
CN114328612A (en) | Data processing method and device of query optimizer and electronic equipment | |
CN108549666B (en) | Data table sorting method, device, equipment and storage medium | |
CN104636471A (en) | Procedure code finding method and device | |
US8145988B2 (en) | Command line testing | |
US10810196B2 (en) | Materialized view generation | |
CN116955341A (en) | Database integrity evaluation method, system and application thereof | |
CN116610694A (en) | Rule verification method and system based on relation between columns and access sentences | |
CN115543966A (en) | Concurrent migration method, device, equipment and storage medium of database structure | |
CN114356404A (en) | Interface document generating method, system and computer readable storage medium | |
CN115114325A (en) | Data query method and device, electronic equipment and storage medium | |
CN110413617B (en) | Method for dynamically adjusting hash table group according to size of data volume | |
CN114579530A (en) | Table space migration method and device, electronic equipment and computer readable storage medium | |
CN115757083A (en) | Distributed database detection method and device | |
CN114443625A (en) | Database processing method and device | |
CN111078197B (en) | Method and device for generating executable file |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |