Data routing correctness verification method and device, equipment, medium and product
By obtaining the target data identification of the target routing data from the target key table of the target database, determining the standard routing destination address and the actual routing destination address, and comparing it, the problem of insufficient accuracy and comprehensiveness of data routing accuracy verification in the prior art is solved, and a more efficient verification effect is achieved.
Patent Information
- Application Number
- CN202411880075.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-21
AI Technical Summary
The existing data routing accuracy verification methods have problems with insufficient accuracy and comprehensiveness, especially when there are many routing branches, it is difficult for stress tests to cover all branches.
By obtaining the target data identification of the target routing data from the target key table of the target database, the standard routing destination address and the actual routing destination address are determined, and the comparison is made to verify the correctness of the data routing.
It improves the accuracy and comprehensiveness of data routing accuracy verification, ensures complete verification coverage, and avoids the problem of inaccuracy in traditional methods.
Smart Images

Figure CN119676110A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed technology, and in particular to a method, device, equipment, medium and product for verifying the correctness of data routing. Background Art
[0002] In order to improve the system's disaster tolerance and capacity expansion capabilities, financial distributed systems choose to carry out modular construction. Modular construction means taking the unit as the basic unit of deployment, and deploying most of the key applications or service groups required for important customer services within the unit.
[0003] Among them, the distributed routing module is the core link of the unit construction. The distributed routing module is used to perform data routing operations, that is, the process of transmitting data from the source node to the target node according to specific rules. In order to ensure the orderly operation of the unit, the correctness of the data routing needs to be verified.
[0004] The traditional verification method is usually stress testing. However, when there are many routing branches, some branches may not be fully covered in the stress test, resulting in insufficient accuracy and comprehensiveness of the verification results. Summary of the invention
[0005] The present invention provides a data routing correctness verification method, device, equipment, medium and product to solve the problem that the accuracy and comprehensiveness of the verification results of the existing data routing correctness verification methods are insufficient.
[0006] According to one aspect of the present invention, a method for verifying the correctness of data routing is provided, the method comprising:
[0007] Obtaining a target data identifier of target routing data from a target key table of a target database, and determining a standard routing destination address corresponding to the target routing data according to the target data identifier; wherein the target routing data is routing data routed to the target database;
[0008] Determine a database address corresponding to the target database as an actual routing destination address corresponding to the target routing data;
[0009] The correctness of data routing is verified on the target routing data according to the standard routing destination address and the actual routing destination address.
[0010] According to another aspect of the present invention, a device for verifying the correctness of data routing is provided, the device comprising:
[0011] A standard routing destination address determination module is used to obtain a target data identifier of target routing data from a target key table of a target database, and determine a standard routing destination address corresponding to the target routing data according to the target data identifier; wherein the target routing data is routing data routed to the target database;
[0012] An actual routing destination address determination module, used to determine a database address corresponding to the target database as an actual routing destination address corresponding to the target routing data;
[0013] The data routing verification module is used to verify the correctness of the data routing of the target routing data according to the standard routing destination address and the actual routing destination address.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for verifying the correctness of data routing according to any one of the present inventions.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement any method for verifying the correctness of data routing according to the present invention when the computer instructions are executed.
[0019] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method for verifying the correctness of data routing according to any one of the present inventions.
[0020] The present invention obtains the target data identifier of the target routing data from the target key table of the target database, and determines the standard routing destination address corresponding to the target routing data according to the target data identifier; wherein the target routing data is the routing data routed to the target database; determines the database address corresponding to the target database as the actual routing destination address corresponding to the target routing data; and performs a data routing correctness check on the target routing data according to the standard routing destination address and the actual routing destination address, thereby achieving the effect of improving the accuracy and comprehensiveness of the data routing correctness check.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 A flowchart of a method for verifying the correctness of data routing provided in Embodiment 1 of the present invention;
[0024] Figure 2 A flowchart of a method for verifying the correctness of data routing provided in Embodiment 2 of the present invention;
[0025] Figure 3 A schematic diagram of the structure of a device for verifying the correctness of data routing provided in Embodiment 3 of the present invention;
[0026] Figure 4 It is a structural schematic diagram of an electronic device for implementing the method for verifying the correctness of data routing according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "standard", "actual", "candidate", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1 This is a flow chart of a method for verifying the correctness of data routing provided in the first embodiment of the present invention. This embodiment is applicable to the case where the correctness of data routing is verified for routing data in a database. The method can be executed by a device for verifying the correctness of data routing. The device for verifying the correctness of data routing can be implemented in the form of hardware and / or software. Figure 1 As shown, the method includes:
[0031] S101. Obtain a target data identifier of target routing data from a target key table of a target database, and determine a standard routing destination address corresponding to the target routing data according to the target data identifier.
[0032] Among them, the target database refers to the database deployed in the financial distributed system. It can be understood that the target database refers to any database deployed in the financial distributed system, rather than a specific database. The target routing data is the routing data routed to the target database, that is, through the distributed routing module of the financial distributed system, the target routing data is routed from the source node to the target database for the target database to store the target routing data. The types of target routing data include but are not limited to any type of financial data such as transaction data, market data, customer data, financial data, risk data, compliance data, etc. It can be understood that whether the target routing data is correctly routed to the target database needs further verification.
[0033] The key tables of a database refer to the tables that play a core role in the database. They usually contain the most important business data and ensure the integrity, consistency and efficient management of the data through reasonable structure and relationship design. There is a corresponding relationship between the key tables and the database. It can be understood that the target key table refers to the key table corresponding to the target database. In this embodiment, when the target routing data is routed to the target database, the target data identifier corresponding to the target routing data is stored in the target key table. The target data identifier refers to a unique identifier assigned to the target routing data in the target database to ensure the uniqueness and integrity of the target routing data. For example, when the target routing data is the report data of a certain customer, the target data identifier can be the customer information number corresponding to the customer, etc.
[0034] The standard routing destination address can be understood as the correct routing destination address of the target routing data, that is, the database address of the database to which the target routing data should theoretically be routed. The standard routing destination address can be represented by the partition value of the partition to which the database belongs and the shard value of the shard to which it belongs.
[0035] In one embodiment, a target key table of a target database is obtained, and the target key table is scanned to obtain the target data identifier of the target routing data stored therein. Further, calculation is performed based on the target data identifier to determine the standard routing destination address corresponding to the target routing data.
[0036] Optionally, a hash function is used to calculate the target data identifier, and a standard routing destination address corresponding to the target routing data is determined based on the hash calculation result.
[0037] Optionally, the target data identifier is input into a pre-trained address prediction model, and the address prediction capability of the address prediction model is used to output a standard routing destination address corresponding to the target routing data.
[0038] S102: Determine a database address corresponding to the target database as the actual routing destination address corresponding to the target routing data.
[0039] Among them, the actual routing destination address can be understood as the actual routing destination address of the target routing data, that is, the database address of the database (target database) to which the target routing data is actually routed. The actual routing destination address can be represented by the database address corresponding to the target database, such as the partition value of the partition to which the target database belongs, and the shard value of the shard to which it belongs.
[0040] In one implementation, a database configuration file of a target database is obtained, and information is searched in the database configuration file to obtain a database address corresponding to the target database from the database configuration file as an actual routing destination address corresponding to the target routing data.
[0041] In another implementation, the data management tool is connected to the target database, and the database address corresponding to the target database is obtained through the data management tool as the actual routing destination address corresponding to the target routing data.
[0042] In another embodiment, the database address corresponding to the target database is predetermined, and the database address corresponding to the target database is written into the name of the instance corresponding to the target database. Further, when the correctness of the target routing data in the target database needs to be verified, the database address corresponding to the target database is directly parsed from the name of the instance as the actual routing destination address corresponding to the target routing data.
[0043] S103: According to the standard routing destination address and the actual routing destination address, the correctness of the data routing is verified for the target routing data.
[0044] In one embodiment, the standard routing destination address and the actual routing destination address are compared. It can be understood that if the standard routing destination address and the actual routing destination address are the same, that is, the actual routing destination address of the target routing data is the same as the correct routing destination address, then the data routing of the target routing data is determined to be correct; if the standard routing destination address and the actual routing destination address are different, that is, the actual routing destination address of the target routing data is different from the correct routing destination address, then the data routing of the target routing data is determined to be incorrect.
[0045] The embodiment of the present invention obtains the target data identifier of the target routing data from the target key table of the target database, and determines the standard routing destination address corresponding to the target routing data according to the target data identifier; wherein the target routing data is the routing data routed to the target database; determines the database address corresponding to the target database as the actual routing destination address corresponding to the target routing data; and performs a data routing correctness check on the target routing data according to the standard routing destination address and the actual routing destination address. The beneficial effects are:
[0046] Firstly, since the correctness of data routing is verified for routing data in various databases deployed in the financial distributed system, it can ensure that the verification coverage is complete, thereby improving the comprehensiveness of the data routing correctness verification.
[0047] Secondly, since the problem of verifying whether the data routing is correct is essentially the problem of verifying whether the routing destination address is accurate, the correctness of the data routing is verified by verifying the standard routing destination address and the actual routing destination address of the routing data in each database. This can fundamentally ensure the accuracy of the data routing correctness verification and avoid the problem of inaccurate verification that is prone to occur in traditional stress testing methods.
[0048] Embodiment 2
[0049] Figure 2 This is a flow chart of a method for verifying the correctness of data routing provided in the second embodiment of the present invention. This embodiment further optimizes and expands the above embodiment and can be combined with the above optional implementations. Figure 2 As shown, the method includes:
[0050] S201. Determine a target storage field for storing a target data identifier from at least one candidate storage field included in a target key table; and obtain a target data identifier from the target key table according to a target field address corresponding to the target storage field.
[0051] The target data identifier is stored in a preset target storage field in the target key table, and the stored target data identifier can be subsequently obtained according to a known target storage field.
[0052] In one embodiment, a target field identifier of a target storage field for storing a target data identifier is matched with a candidate field identifier of each candidate storage field included in a target key table, and a target storage field is determined from each candidate storage field according to a matching result of the field identifier. Further, data is extracted from the target key table according to a target field address corresponding to the target storage field, so as to obtain the target data identifier from the target field address of the target key table.
[0053] By determining a target storage field for storing a target data identifier from at least one candidate storage field included in a target key table; and obtaining the target data identifier from the target key table according to a target field address corresponding to the target storage field, since the target data identifier is stored in a specific target storage field in the target key table, when it is necessary to perform a data routing correctness check on the target routing data, the target data identifier can be directly extracted from the target storage field for calculating the standard routing destination address, thereby improving the efficiency of obtaining the target data identifier and indirectly improving the efficiency of the data routing correctness check.
[0054] S202: Use the target data identifier as an input value of the target hash function, and use the target hash function to perform hash calculation on the target data identifier; determine the standard routing destination address corresponding to the target routing data according to the hash calculation result of the target hash function.
[0055] In one embodiment, a preset target hash function is obtained, and the target hash function includes but is not limited to MD5, SHA-1 or SHA-256. The target data identifier is used as an input value of the target hash function, and the target data identifier is hashed using the target hash function to generate a hash calculation result. From the database deployed by the financial distributed system, a standard database corresponding to the hash calculation result is determined, and according to the database address of the standard database, a standard routing destination address corresponding to the target routing data is determined.
[0056] The target data identifier is used as the input value of the target hash function, and the target data identifier is hashed using the target hash function; the standard routing destination address corresponding to the target routing data is determined according to the hash calculation result of the target hash function, thereby achieving the effect of determining the standard routing destination address, ensuring that the subsequent data routing correctness verification of the target routing data according to the standard routing destination address can be performed smoothly and orderly, thereby ensuring the integrity of the method implementation.
[0057] S203, determining the target database instance corresponding to the target database, and obtaining the target instance name corresponding to the target database instance; performing word segmentation processing on the target instance name, and determining the database address corresponding to the target database according to the word segmentation processing result as the actual routing destination address corresponding to the target routing data.
[0058] The database instance is a running instance in the database management system, responsible for managing and operating the data in the database, and the target database instance refers to the database instance responsible for managing and operating the target database. The target instance name refers to the name of the target database instance.
[0059] In this embodiment, the database address corresponding to the target database is written into the target instance name of the corresponding target database instance in advance, so that when the correctness of the data routing needs to be verified for the target routing data, the database address can be directly extracted from the target instance name. For example, assuming that the database address corresponding to the target database is "partition value 01" and "shard value 07", the target instance name can be set to "app_pay_rz01_07", where "01" represents the partition value 01 and "07" represents the shard value 07.
[0060] In one embodiment, the target database instance corresponding to the target database is determined according to the association relationship between the database instance and the database, and the target instance name of the target database instance is obtained. Further, the target instance name is segmented to obtain a segmentation result, and according to a pre-set segmentation order, the database address corresponding to the target database is extracted from the segmentation result as the actual routing destination address corresponding to the target routing data. For example, assuming the pre-set segmentation order "3" and "4", the segmentation results of the order "3" and "4" are used as the database address corresponding to the target database.
[0061] By determining the target database instance corresponding to the target database and obtaining the target instance name corresponding to the target database instance; performing word segmentation processing on the target instance name, and determining the database address corresponding to the target database according to the word segmentation processing result, as the actual routing destination address corresponding to the target routing data, since the database address corresponding to the target database is pre-written into the target instance name, when it is necessary to perform data routing correctness verification on the target routing data, the database address corresponding to the target database can be directly extracted from the target instance name as the actual routing destination address, thereby improving the efficiency of obtaining the actual routing destination address, and indirectly improving the efficiency of data routing correctness verification.
[0062] S204: According to the standard routing destination address and the actual routing destination address, the correctness of the data routing is verified for the target routing data.
[0063] Optionally, the standard routing destination address includes a standard partition value and a standard fragment value, and the actual routing destination address includes an actual partition value and an actual fragment value.
[0064] The standard partition value and standard shard value refer to the partition value of the database partition to which the target routing data should theoretically be routed, and the shard value of the shard to which it belongs. The actual partition value and actual shard value refer to the partition value of the database partition (target database) to which the target routing data is actually routed, and the shard value of the shard to which it belongs. The partition value refers to the partition number of the partition, and the shard value refers to the shard number of the shard. For example, for partition No. 01, the partition value is "01"; for shard No. 07, the shard value is "07".
[0065] Optionally, based on the standard routing destination address and the actual routing destination address, the correctness of the data routing is verified for the target routing data, including:
[0066] The standard partition value and the actual partition value, as well as the standard shard value and the actual shard value are compared respectively; when the standard partition value and the actual partition value, as well as the standard shard value and the actual shard value are the same, it is determined that the data routing of the target routing data is correct.
[0067] Exemplarily, assuming that the standard partition value is "01", the standard shard value is "07", the actual partition value is "02", and the actual shard value is "07", since the standard partition value and the actual partition value are different, it is determined that the data routing of the target routing data is wrong.
[0068] Exemplarily, assuming that the standard partition value is "01", the standard shard value is "07", the actual partition value is "01", and the actual shard value is "05", since the standard shard value and the actual shard value are different, it is determined that the data routing of the target routing data is wrong.
[0069] Exemplarily, assuming that the standard partition value is "01", the standard shard value is "07", the actual partition value is "01", and the actual shard value is "07", since the standard partition value and the actual partition value are the same, it is determined that the data routing of the target routing data is correct.
[0070] By comparing the standard partition value and the actual partition value, as well as the standard shard value and the actual shard value respectively; when the standard partition value and the actual partition value, as well as the standard shard value and the actual shard value are the same, it is determined that the data routing of the target routing data is correct, and the comparison based on the dual address dimensions of "partition" and "shard" is realized. The correctness of the data routing of the target routing data is verified, and the accuracy of the data routing correctness verification is further improved.
[0071] Optionally, the method further includes:
[0072] It is determined whether each candidate shard of each candidate partition has record information of routing data; if any candidate shard does not have record information of routing data, it is determined that the data routing of the candidate shard is wrong.
[0073] The recorded information of routing data reflects whether the candidate shard has ever stored routing data. That is, if any candidate shard has recorded information of routing data, it means that the candidate shard has ever stored routing data; if any candidate shard does not have recorded information of routing data, it means that the candidate shard has never stored routing data. Since data routing requires load balancing, each candidate shard should receive routing data. Therefore, if any candidate shard does not have recorded information of routing data, it is determined that the data routing of the candidate shard is wrong.
[0074] By determining whether each candidate shard of each candidate partition has record information of routing data; if any candidate shard does not have record information of routing data, it is determined that the data routing of the candidate shard is wrong, thereby achieving the effect of identifying the candidate shards with missing routing data, which is conducive to timely correction of the data routing strategy.
[0075] Optionally, the method further includes:
[0076] According to the routing data volume corresponding to each candidate shard in each candidate partition, the routing data volume difference between each candidate shard in each candidate partition is determined; if the routing data volume difference between at least two candidate shards in any candidate partition is greater than the data volume threshold, it is determined that the data routing of the candidate partition is wrong.
[0077] In one embodiment, the difference calculation is performed based on the routing data volume corresponding to each candidate shard in each candidate partition to determine the routing data volume difference between each candidate shard in each candidate partition. Further, the routing data volume difference between each candidate shard in each candidate partition is compared with the data volume threshold, and if the routing data volume difference between at least two candidate shards in any candidate partition is greater than the data volume threshold, it is determined that the data routing of the candidate partition is wrong; if the routing data volume difference between each candidate shard in any candidate partition is less than or equal to the data volume threshold, it is determined that the data routing of the candidate partition is correct.
[0078] It can be understood that since data routing requires load balancing, the routing data volume of each candidate shard in any candidate partition should be close. If the difference in routing data volume between at least two candidate shards in any candidate partition is greater than the data volume threshold, it means that the data routing of the candidate partition does not meet the load balancing requirements, so the data routing of the candidate partition is determined to be wrong.
[0079] By determining the routing data volume difference between each candidate shard in each candidate partition according to the routing data volume corresponding to each candidate shard in each candidate partition; if the routing data volume difference between at least two candidate shards in any candidate partition is greater than the data volume threshold, it is determined that the data routing of the candidate partition is wrong, thereby achieving the effect of identifying candidate partitions with unbalanced routing data volume, which is conducive to timely correction of data routing strategies.
[0080] Embodiment 3
[0081] Figure 3 The schematic diagram of the structure of a data routing correctness verification device provided in the third embodiment of the present invention is applicable to the case where the correctness of the data routing is verified for the routing data in the database, such as Figure 3 As shown, the device comprises:
[0082] The standard routing destination address determination module 31 is used to obtain the target data identifier of the target routing data from the target key table of the target database, and determine the standard routing destination address corresponding to the target routing data according to the target data identifier; wherein the target routing data is the routing data routed to the target database;
[0083] An actual routing destination address determination module 32 is used to determine a database address corresponding to the target database as an actual routing destination address corresponding to the target routing data;
[0084] The data routing verification module 33 is used to verify the correctness of the data routing of the target routing data according to the standard routing destination address and the actual routing destination address.
[0085] Optionally, the standard routing destination address determination module 31 is specifically used to:
[0086] Determine a target storage field for storing the target data identifier from at least one candidate storage field included in the target key table;
[0087] The target data identifier is obtained from the target key table according to the target field address corresponding to the target storage field.
[0088] Optionally, the standard routing destination address determination module 31 is further configured to:
[0089] Using the target data identifier as an input value of a target hash function, and performing a hash calculation on the target data identifier using the target hash function;
[0090] According to the hash calculation result of the target hash function, a standard routing destination address corresponding to the target routing data is determined.
[0091] Optionally, the actual routing destination address determination module 32 is specifically configured to:
[0092] Determine a target database instance corresponding to the target database, and obtain a target instance name corresponding to the target database instance;
[0093] The target instance name is segmented, and a database address corresponding to the target database is determined according to the segmentation result.
[0094] Optionally, the standard routing destination address includes a standard partition value and a standard fragmentation value, and the actual routing destination address includes an actual partition value and an actual fragmentation value;
[0095] The data routing verification module 33 is specifically used for:
[0096] Compare the standard partition value and the actual partition value, and the standard shard value and the actual shard value respectively;
[0097] In a case where the standard partition value and the actual partition value, and the standard shard value and the actual shard value are all the same, it is determined that the data routing of the target routing data is correct.
[0098] Optionally, the device further includes a first verification module, specifically configured to:
[0099] Determine whether each candidate shard of each candidate partition has record information of routing data;
[0100] If any of the candidate slices does not have the record information of the routing data, it is determined that the data routing of the candidate slice is wrong.
[0101] Optionally, the device further includes a second verification module, specifically configured to:
[0102] Determine, according to the routing data volume corresponding to each candidate shard in each candidate partition, the routing data volume difference between each candidate shard in each candidate partition;
[0103] If the difference in routing data volume between at least two of the candidate shards in any of the candidate partitions is greater than the data volume threshold, it is determined that the data routing of the candidate partition is incorrect.
[0104] The device for verifying the correctness of data routing provided by the embodiment of the present invention can execute the method for verifying the correctness of data routing provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0105] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0106] Embodiment 4
[0107] Figure 4 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0108] like Figure 4As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0109] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0110] The processor 41 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as a method for verifying the correctness of data routing.
[0111] In some embodiments, the method for verifying the correctness of data routing may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the method for verifying the correctness of data routing described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the method for verifying the correctness of data routing by any other appropriate means (e.g., by means of firmware).
[0112] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0113] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0114] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0115] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0116] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0117] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0118] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0119] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for verifying the correctness of data routing, characterized in that: The method comprises: Obtaining a target data identifier of target routing data from a target key table of a target database, and determining a standard routing destination address corresponding to the target routing data according to the target data identifier; wherein the target routing data is routing data routed to the target database; Determine a database address corresponding to the target database as an actual routing destination address corresponding to the target routing data; The correctness of data routing is verified on the target routing data according to the standard routing destination address and the actual routing destination address.
2. The method according to claim 1, characterized in that The step of obtaining the target data identifier of the target routing data from the target key table of the target database includes: Determine a target storage field for storing the target data identifier from at least one candidate storage field included in the target key table; The target data identifier is obtained from the target key table according to the target field address corresponding to the target storage field.
3. The method according to claim 1, characterized in that The step of determining the standard routing destination address corresponding to the target routing data according to the target data identifier includes: Using the target data identifier as an input value of a target hash function, and performing a hash calculation on the target data identifier using the target hash function; According to the hash calculation result of the target hash function, a standard routing destination address corresponding to the target routing data is determined.
4. The method according to claim 1, characterized in that: The determining of the database address corresponding to the target database includes: Determine a target database instance corresponding to the target database, and obtain a target instance name corresponding to the target database instance; The target instance name is segmented, and a database address corresponding to the target database is determined according to the segmentation result.
5. The method according to claim 1, characterized in that The standard routing destination address includes a standard partition value and a standard fragment value, and the actual routing destination address includes an actual partition value and an actual fragment value; The correctness checking of the data routing of the target routing data according to the standard routing destination address and the actual routing destination address includes: Compare the standard partition value and the actual partition value, and the standard shard value and the actual shard value respectively; In a case where the standard partition value and the actual partition value, and the standard shard value and the actual shard value are all the same, it is determined that the data routing of the target routing data is correct.
6. The method according to claim 1, further comprising: Determine whether each candidate shard of each candidate partition has record information of routing data; If any of the candidate slices does not have the record information of the routing data, it is determined that the data routing of the candidate slice is wrong.
7. The method according to claim 1, further comprising: Determine, according to the routing data volume corresponding to each candidate shard in each candidate partition, the routing data volume difference between each candidate shard in each candidate partition; If the difference in routing data volume between at least two of the candidate shards in any of the candidate partitions is greater than the data volume threshold, it is determined that the data routing of the candidate partition is incorrect.
8. A device for verifying the correctness of data routing, characterized in that: The device comprises: A standard routing destination address determination module is used to obtain a target data identifier of target routing data from a target key table of a target database, and determine a standard routing destination address corresponding to the target routing data according to the target data identifier; wherein the target routing data is routing data routed to the target database; An actual routing destination address determination module, used to determine a database address corresponding to the target database as an actual routing destination address corresponding to the target routing data; The data routing verification module is used to verify the correctness of the data routing of the target routing data according to the standard routing destination address and the actual routing destination address.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for verifying the correctness of data routing according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method for verifying the correctness of data routing according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method for verifying the correctness of data routing according to any one of claims 1 to 7.
Citation Information
Patent Citations
Database instance access method, device and system, storage medium and equipment
CN108093094A
Data verification method and device, server and computer readable storage medium
CN115185962A
Routing method and device of distributed database and computer storage medium
CN116186157A
Database fragmentation data processing method and device, computer equipment and storage medium
CN116450744A
Data storage method and device, electronic equipment and computer readable storage medium
CN117951110A