WO2020042427A1 - 基于数据分片的对账方法、装置、计算机设备及存储介质 - Google Patents
基于数据分片的对账方法、装置、计算机设备及存储介质 Download PDFInfo
- Publication number
- WO2020042427A1 WO2020042427A1 PCT/CN2018/120316 CN2018120316W WO2020042427A1 WO 2020042427 A1 WO2020042427 A1 WO 2020042427A1 CN 2018120316 W CN2018120316 W CN 2018120316W WO 2020042427 A1 WO2020042427 A1 WO 2020042427A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- underwriting
- shard
- financial
- target
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/12—Accounting
- G06Q40/125—Finance or payroll
Definitions
- the present application relates to the field of financial technology, and in particular, to a method, an apparatus, a computer device, and a storage medium for reconciliation based on data fragmentation.
- the current insurance wealth management systems include underwriting systems and financial systems. Underwriting systems are used for insurance.
- Business personnel enter the policy data.
- the policy data includes the policy number and the premium amount.
- the financial system is used for statistical calculation of the policy data.
- the reconciliation check of the data of the underwriting system and the financial system is mainly performed manually. Due to the large amount of data in the reconciliation check, manual reconciliation is likely to result in low accuracy and low efficiency of the reconciliation results.
- the embodiments of the present application provide a data reconciliation method, device, computer equipment, and storage medium based on data slicing to solve the problems that manual reconciliation easily results in low accuracy and low efficiency of the reconciliation result.
- a data reconciliation method based on data sharding includes the following steps performed by a central server:
- each of the underwriting shard data block and the financial shard data block corresponding to the underwriting shard data block as one target task information to obtain N target task information;
- the node server set includes a preset number of node servers
- a data reconciliation method based on data sharding includes the following steps performed by a node server:
- the target task information sent by the central server is received, the target task information is saved to a data pool, where the target task information includes underwriting shard data blocks and financial shard data corresponding to the underwriting shard data blocks. Piece;
- a data reconciliation device based on data fragments includes a central server.
- the central server includes:
- a data acquisition module for acquiring underwriting change data in an underwriting system and obtaining financial change data in a financial system
- a data sharding module is configured to shard the underwriting change data and the financial change data respectively according to a preset dimension to obtain N underwriting shard data blocks and N financial shard data blocks, and establish each A mapping relationship between the underwriting fragment data block and each of the financial fragment data blocks, where N is a positive integer;
- a task generation module configured to use each of the underwriting shard data block and the financial shard data block corresponding to the underwriting shard data block as a target task information according to the mapping relationship, to obtain N targets Mission information
- a task sharding module configured to select a target node server from a set of node servers according to a preset load balancing distribution method, and assign N target task information to the target node server, so that the target node server Performing a consistency reconciliation check, wherein the node server set includes a preset number of node servers;
- the result receiving module is configured to receive the execution results sent by the target node server, and summarize the execution results to obtain a target result.
- a data sharding-based reconciliation device includes a node server, and the node server includes:
- a data storage module configured to save the target task information to a data pool if the target task information sent by the central server is received, wherein the target task information includes an underwriting fragment data block and the underwriting fragment data block The corresponding financial shard data block;
- the reconciliation check module is configured to perform a consistent reconciliation check on the target task information in the data pool by using a preset timed task script to obtain an execution result;
- a result sending module configured to send the execution result to the central server.
- a computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor implements the data-based fragmentation when executing the computer-readable instructions. Steps of the reconciliation method.
- One or more non-volatile readable storage media storing computer-readable instructions that, when executed by one or more processors, cause the one Or multiple processors execute the steps of the data sharding-based reconciliation method.
- FIG. 1 is a schematic diagram of an application environment of a data fragmentation-based reconciliation method according to an embodiment of the present application
- FIG. 2 is a flowchart of implementing a method of reconciliation based on data fragments according to an embodiment of the present application
- FIG. 3 is a flowchart of implementing step S20 in a data fragment-based reconciliation method according to an embodiment of the present application
- FIG. 4 is a flowchart of implementing step S40 in a data fragment-based reconciliation method according to an embodiment of the present application
- FIG. 5 is a flowchart of implementing step S60 in a data fragment-based reconciliation method according to an embodiment of the present application
- FIG. 6 is a schematic diagram of a data reconciliation device based on a data fragment according to an embodiment of the present application.
- FIG. 7 is a schematic diagram of a computer device according to an embodiment of the present application.
- FIG. 1 illustrates an application environment of a data reconciliation method based on data sharding provided by an embodiment of the present application.
- the data sharding-based reconciliation method is applied in the insurance-based data sharding-based reconciliation scenario.
- the recording scenario includes a central server, a node server, a client, and a monitoring terminal. Among them, the central server and the client, the central server and the monitoring terminal, and the central server and the node server are connected through a network.
- the server provides underwriting change data and financial change data.
- the central server obtains target task information by slicing the underwriting change data and financial change data and sends it to the node server.
- the node server performs a consistency reconciliation check on the target task information, and The obtained results are sent to the central server, and when the central server receives the abnormal results, it pushes the abnormal results to the monitoring personnel at the monitoring end.
- the client and the monitoring end can be, but are not limited to, various microphones, microphones, mobile phones, and smart devices with recording functions.
- the central server and the node server can be implemented by independent servers or a server cluster composed of multiple servers.
- each of the underwriting shard data block and the financial shard data block corresponding to the underwriting shard data block as one target task information to obtain N target task information;
- the node server set includes a preset number of node servers
- the target task information sent by the central server is received, the target task information is saved to a data pool, where the target task information includes underwriting shard data blocks and financial shard data corresponding to the underwriting shard data blocks. Piece;
- FIG. 2 illustrates a method for reconciliation based on data sharding provided by an embodiment of the present application.
- the method is applied to the central server and the node server in FIG. 1 as an example, and the details are as follows:
- the central server obtains the underwriting change data in the underwriting system, and obtains the financial change data in the financial system.
- the central server obtains underwriting change data from the underwriting system through the network transmission protocol, and obtains financial change data from the financial system.
- the underwriting change data refers to underwriting data in the underwriting system where the data content has changed within a preset time range.
- financial change data refers to financial data in which the data content has changed within a preset time range in the financial system.
- financial data There is a corresponding relationship between financial data and underwriting data, that is, for any piece of underwriting data, one can always be found. financial data.
- the network transmission protocol includes, but is not limited to: Internet Control Message Protocol (ICMP), Address Resolution Protocol (ARP), Protocol (File), File Transfer Protocol (FTP), and so on.
- ICMP Internet Control Message Protocol
- ARP Address Resolution Protocol
- FTP File Transfer Protocol
- the preset time range of the underwriting system and the financial system are consistent.
- the specific preset time range can be set according to actual needs.
- the preset time range is 0 on the day before the current time. : 00 to 23:59 the day before the current time.
- S20 The central server shards the underwriting change data and financial change data respectively according to a preset dimension, and obtains N underwriting shard data blocks and N financial shard data blocks, and establishes each underwriting shard data block and each The mapping relationship between the financial shard data blocks, where N is a positive integer.
- underwriting change data and financial change data are large.
- a sharding strategy is required. Fragmentation of underwriting change data and financial change data will get N underwriting shard data blocks and N financial shard data blocks, and underwriting shard data blocks and financial shards that need to be checked for consistency Data blocks are mapped.
- the sharding strategy includes, but is not limited to: the average allocation algorithm strategy, the job name hash value parity algorithm strategy, the rotation sharding strategy, the modular sharding strategy, and the partition sharding strategy, etc., which can be selected according to the actual situation. There are no specific restrictions.
- the sharding strategy adopted in the embodiment of the present application is a partitioned sharding strategy, that is, by presetting the interval range of different shard partitions, and then determining the interval range to which the underwriting change data and financial change data belong, to obtain the underwriting change Sharding interval for data and financial changes.
- the central server uses each insured shard data block and the financial shard data block corresponding to the insured shard data block as one target task information to obtain N target task information.
- the shard data needs to be distributed to multiple node servers for consistency reconciliation check.
- the The underwriting shard data blocks and underwriting shard data blocks having a mapping relationship are allocated as the same target task information, thereby obtaining N target task information.
- the central server selects the target node server from the set of node servers according to a preset load balancing distribution method, and assigns N target task information to the target node server, so that the target node server performs a consistency reconciliation check.
- the node server collection contains a preset number of node servers.
- the central server and the node server set form a cluster.
- a qualified node server is selected as the target node server, and the preset load balancing (Load Balancing) distribution method is used , Sending N target task information to each target node server, so that the target node server performs consistency reconciliation check.
- Load Balancing Sending N target task information to each target node server, so that the target node server performs consistency reconciliation check.
- load balancing is divided into local load balancing (Global Load Balancing) and global load balancing (also called regional load balancing) from the geographic structure of its application.
- the load balancing distribution method used in this embodiment can be specifically Local load balancing distribution method. Local load balancing reasonably allocates access requests to the node servers in the cluster through a flexible and diverse balancing strategy.
- the qualified node server may be an active node server, or a node server with parameters of memory and processors that reach preset standards, and may be set according to actual needs, and is not specifically limited here.
- the target task information sent to the node server may be one or more, which may be determined according to the distribution situation of the load balancing performed by the central server, which is not specifically limited here.
- the target task information is saved to the data pool, where the target task information includes the underwriting fragment data block and the financial fragment data block corresponding to the underwriting fragment data block.
- the node server after receiving the target task information sent by the central server through the network transmission protocol, the node server saves the target task information to the data pool.
- the node server Consistent reconciliation of target task information.
- the node server uses a preset scheduled task script to periodically perform consistency reconciliation check on the target task information in the data pool to obtain the execution result.
- the node server in the embodiment of the present application uses a preset scheduled task script to periodically trigger a consistency check task to perform a consistency check on the target task information in the data pool.
- the scheduled task script refers to a script used to submit and manage tasks that the user needs to perform periodically.
- the script types of the scheduled task script include, but are not limited to, shell scripts, JavaScript scripts, Lua scripts, and python scripts.
- consistency check refers to checking the data content of underwriting change data and financial change data to check whether the data in underwriting change data and financial change data are consistent.
- the node server sends the execution result obtained in step S60 to the central server through a network transmission protocol.
- S80 The central server receives the execution results sent by the target node server, and summarizes the execution results to obtain the target results.
- the central server summarizes the execution results after receiving the execution results sent by the node server, and after all the execution results are summarized, the aggregated results are used as the target results.
- the central server obtains the change data in the underwriting system as the underwriting change data, and obtains the change data in the financial system as the financial change data, and further divides the underwriting change data and the financial change data according to a preset dimension.
- Multiple target task information is distributed to multiple target node servers for execution, which improves the efficiency and stability of reconciliation.
- the node server After receiving the target task information sent by the central server, the node server stores the target task information into the data. Timed logarithm in the pool through preset scheduled task scripts Objectives and tasks information pool to perform consistency reconciliation, and get the results, this automatic reconciliation of consistency, improve the accuracy and efficiency of reconciliation.
- a specific embodiment is used to segment the underwriting change data and financial change data according to a preset dimension mentioned in step S20 to obtain N underwritings.
- the specific implementation method of sharding data blocks and N financial sharding data blocks and establishing a mapping relationship between each insured sharding data block and each financial sharding data block will be described in detail. This method is applied to a central server.
- FIG. 3 illustrates a specific implementation process of step S20 provided by an embodiment of the present application, which is detailed as follows:
- S21 Obtain the smallest policy number from the underwriting change data as the starting policy number, and determine the policy scope of each slicing interval based on the starting policy number and the preset slicing interval interval.
- the smallest policy number is obtained as the starting policy number, and the policy range of each segment interval is obtained according to a preset interval of each segment interval.
- the preset segment interval refers to the number of policy numbers included from the start policy number of the segment interval to the end policy number of the segment interval.
- the number of the policy numbers can be based on actual needs. Set it, there is no specific limitation here.
- the smallest policy number obtained from the underwriting change data is 5200006326006, and the preset minimum allocation interval is 1000, so the policy range of the first fragment interval is [5200006326006, 5200006327005], The policy range of the second fragment interval is [5200006327006, 5200006328005]. According to this calculation method, the policy range of any fragment interval can be obtained.
- the policy number of each underwriting change data is determined, and the shard interval to which the policy number belongs is determined as the shard interval to which the underwriting change data belongs, and The underwriting change data in the same shard interval is used as one underwriting shard data block to obtain N underwriting shard data blocks.
- step S21 five underwriting change data were obtained.
- the policy numbers were 5200006326033, 5200006326102, 5200006326553, 5200006327031, and 5200006329678.
- the policy numbers 5200006326033, 5200006326102, and 5200006326553 belong to the policy scope [5200006326006, 5200006327005.
- 5200006327031 belongs to the fragment interval with the policy scope of [5200006327006, 5200006328005]
- 5200006329678 belongs to the fragment interval with the policy scope of [5200006329006, 5200006330005]. It will also belong to the three fragment intervals of [5200006326006, 5200006327005].
- the underwriting change data is used as an underwriting shard data block, and one underwriting change data belonging to the [5200006327006, 5200006328005] sharding interval is used as an underwriting shard data block, and the underwriting change data belonging to [5200006329006, 5200006330005] sharding interval is used as One underwriting shard data block gets three underwriting shard data blocks.
- the policy number of each financial change data is determined, and the segment interval to which the policy number belongs is determined as the segment interval to which the financial change data belongs.
- the financial change data in the same shard interval as one underwriting shard data block is obtained.
- the obtained financial fragment data block is the same as the number of underwriting fragment data blocks obtained in step S22.
- step S22 and step S23 do not necessarily have a sequential execution order, and may be a relationship of parallel execution, which is not limited here.
- mapping relationship is established between the underwriting shard data block and the financial shard data block belonging to the same shard interval, so as to facilitate subsequent consistency During reconciliation, the mapping relationship is used for comparison.
- the smallest policy number is obtained from the underwriting change data as the starting policy number, and the policy range of each slicing interval is determined according to the starting policy number and the preset slicing interval interval.
- the policy scope of each shard interval and the policy number of each underwriting change data determine the shard interval to which each underwriting change data belongs, and use the underwriting change data belonging to the same shard interval as an underwriting shard data block to obtain N
- Each underwriting segment data block according to the policy scope of each segment interval and the policy number of each financial change data, determine the segment interval to which each financial change data belongs, and use the financial change data belonging to the same segment interval as One financial shard data block, get N financial shard data blocks, and then establish a mapping relationship between the underwriting shard data block and financial shard data block with the same shard interval, so that the underwriting change data and financial change data are in accordance with The same dimension is divided into multiple shard data, and a mapping relationship is established, which is beneficial to the
- a specific embodiment is used below to select the target node server from the node server set according to the preset load balancing distribution method mentioned in step S40, and set N
- a specific implementation method of allocating target task information to a target node server is described in detail, and the method is applied to a central server.
- FIG. 4 illustrates a specific implementation process of step S40 provided by an embodiment of the present application, which is detailed as follows:
- S41 Use a preset detection mechanism to detect each node server in the node server set, obtain the status of the node server, and determine the node server whose status is active as the target node server.
- each node server in the node server set is detected through a preset detection mechanism, a node server whose status is active is found, and the node server is determined as a target node server.
- the preset detection mechanism refers to an attempt to use the probes to periodically provide availability to each node server.
- the specific implementation method may be to send a ping or curl command to each node server through the central server. If the returned result is normal, it indicates that The node server status is active. If an exception is returned, the node server status is down.
- the usage status of each target node server is different, that is, the hardware configuration of different target node servers is different.
- the hardware configuration includes, but is not limited to, a central processor model and a memory model, and the current disk space.
- the size is also different, and the usage status of the target node server determines its data storage and processing capabilities. Therefore, for each target node server, it is necessary to first obtain the usage status of the target node server, that is, the central processor model of the target server. , Disk space parameters and memory model.
- J 1 is a preset weight corresponding to the CPU model Q 1
- J 2 is a preset weight corresponding to the disk space parameter Q 2
- J 3 is a preset weight corresponding to the memory model Q 3 .
- the models of the central processing unit include: E3-1231v3, E5-2620v4, and E5-2680v2, and the corresponding preset weights are: 0.1, 0.3, and 0.6, and the memory model Including: KVR24N17D8 / 8-SP and KVR26N19S8 / 8, the corresponding preset weights are 0.4 and 0.6, the preset threshold of disk space parameters is 0.5, and the model of the central processor that obtained a target node server is E5-2620v4
- the disk space parameter is 0.8 Terabyte (TB)
- the memory model is KVR24N17D8 / 8-SP
- S44 Calculate the task allocation ratio of each target node server according to the status score.
- the status scores of all target node servers are accumulated to obtain the sum of the status scores of all target node servers, and the target is calculated for each target node server.
- the ratio of the status score of a node server to the sum of the status scores of all target node servers is used as the task allocation ratio of the target node server.
- the status score of the first target node server is 3, and the status score of the second target node server is The value is 7, according to the above description, the task allocation ratio of the first target node server is calculated to be 30%, and the task allocation ratio of the first target node server is 70%.
- S45 Send N target task information to the target node server according to the task allocation ratio.
- N target task information is distributed to the target node server.
- a preset detection mechanism is used to detect each node server in the node server set, obtain the status of the node server, and determine the active node server as the target node server.
- the server obtains the central processor model, disk space parameters, and memory model of the target node server, and calculates each target node server according to the status score through a preset number of company segments corresponding to each target node server.
- N target task information is sent to the target node server, so that the N target task information is loaded to each target node server through this load balancing method.
- the operation status of the target is reasonably assigned to the target task information to ensure the stability of the central server and the node server.
- this allocation method also improves the efficiency of task processing.
- a specific embodiment is used to perform a consistency reconciliation check on the target task information in the data pool mentioned in step S60 to obtain a specific implementation method of the execution result.
- the method is applied to a node server.
- FIG. 5 illustrates a specific implementation process of step S60 provided by an embodiment of the present application, which is detailed as follows:
- the timing script will trigger a consistency reconciliation check on the target task information of the data pool. Before performing the consistency reconciliation check, it is necessary to add a pending status identifier to each of the underwriting change data. After the consistency check is performed subsequently, the status identifier is updated to be processed to avoid repeated checks on the same data.
- the status identifier is used to identify the current processing status of the underwriting change data, and the status identifier includes pending and processed.
- S62 From the underwriting change data whose status identifier is pending, randomly select one piece of underwriting change data as the basic data, and obtain the policy number of the basic data as the target policy number.
- random selection can be implemented using random number generator random.
- the financial change data having the same policy number as the target policy number is obtained from the financial change data of the financial slice data block, as comparison data, which is used for subsequent consistency with the basic data. Account.
- the target policy number is 5200006327031.
- the character string is searched to obtain the financial change data with the policy number as the character string, which is used as the basic data. Comparative data.
- the data contents of the preset data included in the basic data and the comparison data are compared to obtain a comparison result.
- the status identifier of the basic data is updated to be processed to avoid subsequent repeated operations of performing comparison operations on the basic data.
- the preset type data refers to the data types that need to be compared in the policy data, for example: premium amount
- the preset type data can be one item or multiple items, which can be set according to actual needs.
- the preset type data includes a name, an ID number, and a premium amount
- the basic data and the name of the comparison data are compared respectively, and it is confirmed that the names are sufficient for the same customer name, and the ID numbers are compared. Confirm whether the same ID number, and compare the premium amount to determine whether the premium amount is the same.
- traversal refers to the access to the information of all nodes in the node tree that holds the underwriting change data, that is, each node in the node tree is visited once and only once.
- Traversing methods include, but are not limited to, preorder traversal, middle order traversal, and postorder traversal.
- the traversal method used in the embodiment of the present application is a preorder traversal.
- the order of the preorder traversal includes NLR or NRL, where N refers to the root (Node), L refers to the left subtree of the root, and R refers to The right node of the root (Right subtree).
- the traversal operation in this step is to find out the underwriting change data containing the status identifier as pending, and to perform consistency reconciliation checks on it. Therefore, the embodiment of the present application provides a preferred solution. After finding any underwriting change data whose status is identified as pending, the traversal is ended, and the underwriting change data is used as the result of the traversal as the basic data in step S66, and subsequent consistency reconciliation operations are performed.
- step S65 when there is underwriting change data whose status is identified as pending, that is, underwriting change data requiring consistent reconciliation also exists. At this time, the underwriting change data whose status is identified as pending is randomly selected. Select one piece of underwriting change data as the basic data, and return to step S62 to continue execution.
- step S66 and step S67 do not necessarily have a sequential execution order, and may be a relationship of parallel execution, which is not limited here.
- a pending status identifier is added to each piece of underwriting change data in the underwriting shard data block.
- a piece of underwriting change data is randomly selected as the basic data, and Obtain the policy number of the basic data as the target policy number, and obtain the financial change data with the same policy number as the target policy number from the financial slice data block.
- the comparison data compare the basic data and the comparison data to obtain the comparison result.
- the status identifier of the basic data is updated to be processed, the status identifier of the underwriting change data is traversed, and the traversal result is obtained.
- the execution is returned from the status identifier to pending Among the underwriting change data of the company, a piece of underwriting change data is randomly selected as the basic data, and the policy number of the basic data is obtained as the step of the target policy number. If the traversal result is that there is no underwriting change data identified as pending, the The results of each comparison are summarized to obtain the execution results, so that Underwriting and financial data change change data with the same number of policy consistency reconciliation check and get test results, avoid artificial way low reconciliation of omission and efficiency, improve the efficiency and stability of the consistency of reconciliation.
- the data fragmentation-based reconciliation method further includes the following steps performed by the central server:
- the inconsistent change data is pushed to the monitoring end.
- the central server summarizes the execution results sent by each node server to obtain the target results
- the recorded inconsistent underwriting change data and corresponding financial change data are obtained.
- the monitoring staff of the monitoring end can timely find and correct the cause of the inconsistent data.
- the abnormal information can be pushed through email or system message.
- the central server pushes the inconsistent change data to the monitoring end, so that the monitoring staff at the monitoring end can grasp the relevant abnormal information in time and verify and correct it, avoiding underwriting the change data.
- the loss caused by inconsistency with financial change data improves the timeliness of reconciliation based on data shards.
- FIG. 6 shows a principle block diagram of a data fragment-based reconciliation device that corresponds to the data fragment-based reconciliation method in the one-to-one embodiment.
- the data sharding-based reconciliation device includes a central server and a node server, for convenience of explanation. Only parts related to the embodiment of the present application are shown.
- the central server of the data sharding-based reconciliation device includes a data acquisition module 10, a data sharding module 20, a task generation module 30, a task sharding module 40, and a result receiving module 50.
- the detailed description of each function module is as follows:
- a data acquisition module 10 configured to acquire underwriting change data in an underwriting system, and to obtain financial change data in a financial system
- a data sharding module 20 is configured to shard the underwriting change data and financial change data according to a preset dimension, obtain N underwriting shard data blocks and N financial shard data blocks, and establish each underwriting shard.
- a task generating module 30, configured to use each insured shard data block and the financial shard data block corresponding to the insured shard data block as one target task information according to the mapping relationship to obtain N target task information;
- the task sharding module 40 is configured to select a target node server from a set of node servers according to a preset load balancing distribution method, and assign N target task information to the target node server, so that the target node server performs consistent reconciliation. Check, where the node server set contains a preset number of node servers;
- the result receiving module 50 is configured to receive the execution results sent by the target node server, and summarize the execution results to obtain the target results.
- the data fragmentation module 20 includes:
- the range determining unit 21 is configured to obtain the smallest policy number from the underwriting change data as the starting policy number, and determine the policy range of each slicing interval according to the starting policy number and the preset slicing interval interval;
- the first sharding unit 22 is used to determine the shard interval to which each piece of underwriting change data belongs according to the policy scope of each shard interval and the policy number of each underwriting change data, and to change the underwriting changes belonging to the same shard interval.
- the data is used as one underwriting shard data block, and N underwriting shard data blocks are obtained;
- the second sharding unit 23 is used to determine the shard interval to which each financial change data belongs according to the policy scope of each shard interval and the policy number of each financial data, and the financial change data belonging to the same shard interval As one financial segment data block, N financial segment data blocks are obtained;
- the data mapping unit 24 is configured to establish a mapping relationship between the underwriting fragment data block and the financial fragment data block having the same fragment interval.
- the task fragmentation module 40 includes:
- the node detection unit 41 is configured to detect each node server in the node server set by using a preset detection mechanism, obtain the status of the node server, and determine the node server whose status is active as the target node server;
- the state obtaining unit 42 is configured to obtain, for each target node server, a central processing unit model Q 1 , a disk space parameter Q 2, and a memory model Q 3 of the target node server;
- the score calculation unit 43 is configured to calculate a status score S corresponding to each target node server according to the following formula:
- J 1 is the preset weight corresponding to the CPU model Q 1
- J 2 is the preset weight corresponding to the disk space parameter Q 2
- J 3 is the preset weight corresponding to the memory model Q 3 ;
- a ratio calculation unit 44 configured to calculate a task allocation ratio of each target node server according to the status score
- the task allocation unit 45 is configured to send N target task information to the target node server according to the task allocation ratio.
- the central server further includes:
- the abnormality processing module 60 is configured to push the inconsistent change data to the monitoring end if the target result is inconsistent change data.
- the node server of the data shard-based reconciliation device includes: a data storage module 70, a reconciliation check module 80, and a result sending module 90.
- the detailed description of each function module is as follows:
- the data storage module 70 is configured to save the target task information to the data pool if the target task information sent by the central server is received, where the target task information includes the underwriting fragment data block and the financial fragment corresponding to the underwriting fragment data block. data block;
- the reconciliation check module 80 is configured to perform a consistent reconciliation check on the target task information in the data pool by using a preset scheduled task script to obtain the execution result;
- the result sending module 90 is configured to send the execution result to the central server.
- the reconciliation check module 80 includes:
- a status identification unit 81 configured to add a pending status identification to each piece of underwriting change data in the underwriting fragment data block;
- the first selecting unit 82 is configured to randomly select one piece of underwriting change data from the underwriting change data whose status is marked as pending, and obtain the policy number of the basic data as a target policy number;
- the second selecting unit 83 is configured to obtain financial change data having the same policy number as the target policy number from the financial segment data block as comparison data;
- a data comparison unit 84 configured to compare the basic data with the comparison data, obtain a comparison result, and update the status identifier of the basic data to be processed;
- the loop execution unit 86 is configured to return and execute the underwriting change data whose status is pending if the traversal result indicates that there is underwriting change data whose status is pending.
- the policy number of the basic data is used as the step of the target policy number;
- the result summary unit 87 is configured to summarize each comparison result if the traversal result is the underwriting change data whose status is identified as pending, and obtain the execution result.
- Each module in the above-mentioned data fragment-based reconciliation device may be implemented in whole or in part by software, hardware, and a combination thereof.
- the above-mentioned modules may be embedded in the hardware form or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor calls and performs the operations corresponding to the above modules.
- FIG. 7 is a schematic diagram of a computer device according to an embodiment of the present application.
- the computer equipment may be a central server or a node server, and its internal structure diagram may be as shown in FIG. 7.
- the computer device includes a processor, a memory, a network interface, and a database connected through a system bus.
- the processor of the computer device is used to provide computing and control capabilities.
- the memory of the computer device includes a non-volatile storage medium and an internal memory.
- the non-volatile storage medium stores an operating system, computer-readable instructions, and a database.
- the internal memory provides an environment for operating the operating system and computer-readable instructions in a non-volatile storage medium.
- the computer equipment database is used to store underwriting change data and financial change data.
- the network interface of the computer device is used to communicate with an external terminal through a network connection.
- the computer-readable instructions are executed by a processor to implement a method of reconciliation based on data sharding.
- a computer device including a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor.
- the processor implements the foregoing embodiments based on data when the processor executes the computer-readable instructions.
- the steps of the fragment reconciliation method are, for example, steps S10 to S80 shown in FIG. 2.
- the functions of the modules / units of the reconciliation device based on data sharding in the above embodiment are implemented, for example, the functions of modules 10 to 50 of the central server shown in FIG. 6 and the node server The functions of modules 70 to 90. To avoid repetition, we will not repeat them here.
- one or more non-volatile readable storage media are provided, and computer-readable instructions are stored on the readable storage media.
- the computer-readable instructions implement the foregoing implementation when executed by one or more processors. Exemplify the steps of the method of reconciliation based on data slicing, or, when the computer-readable instructions are executed by one or more processors, implement the functions of each module / unit in the data reconciliation device based on data slicing of the above embodiment. To avoid repetition, we will not repeat them here.
- the readable storage medium may include: any entity or device capable of carrying the computer-readable instructions, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (Read- Only Memory (ROM), Random Access Memory (RAM), electric carrier signals and telecommunication signals.
- a recording medium a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (Read- Only Memory (ROM), Random Access Memory (RAM), electric carrier signals and telecommunication signals.
- ROM Read- Only Memory
- RAM Random Access Memory
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Development Economics (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- General Engineering & Computer Science (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
一种基于数据分片的对账方法、装置、计算机设备及存储介质,所述方法包括:中心服务器获取承保变更数据和财务变更数据后,按照预设维度对该数据进行分片,得到承保分片数据和财务分片数据,并建立承保分片数据与财务分片数据的映射关系,同时生产目标任务信息,进而按照负载均衡的方式将目标任务信息分配给目标节点服务器执行,使得数据量较大的承保变更数据和财务变更数据被分片分成多个目标任务信息,并分配到多个目标节点服务器中执行,提高了对账的效率和稳定性,节点服务器在接收到中心服务器发送的目标任务信息后,对目标任务信息执行一致性对账,得到执行结果。这种自动进行一致性对账的方式,提高了对账的准确率和效率。
Description
本申请以2018年8月31日提交的申请号为201811010201.4,名称为“基于数据分片的对账方法、装置、计算机设备及存储介质”的中国发明专利申请为基础,并要求其优先权。
本申请涉及金融科技领域,尤其涉及一种基于数据分片的对账方法、装置、计算机设备及存储介质。
随着社会经济的发展,人们越来越关注保险理财产品,保险理财系统的数据量日益增长,保险数据的处理变得越发频繁,当前保险理财系统包括承保系统和财务系统,承保系统用于保险业务人员录入保单数据,保单数据包括保单号和保费金额等,财务系统用于对保单数据进行统计核算。
每个月在承保系统都会新增大量的保单数据,同时也会删除修改一些保单数据,在月底需要对承保系统里面的保单数据和财务系统里面的保单数据进行核对,以便保证承保系统和财务系统中保单数据的一致性。
当前,主要通过人工的方式对承保系统和财务系统的数据进行对账检查,由于对账检查的数据量较大,采用人工的方式进行对账容易导致对账结果准确率低,且效率低。
发明内容
本申请实施例提供一种基于数据分片的对账方法、装置、计算机设备和存储介质,以解决采用人工的方式进行对账容易导致对账结果准确率低和效率低的问题。
一种基于数据分片的对账方法,包括中心服务器执行的如下步骤:
获取承保系统中的承保变更数据,并获取财务系统中的财务变更数据;
按照预设维度分别对所述承保变更数据和所述财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与每个所述财务分片数据块之间的映射关系,其中N为正整数;
根据所述映射关系,将每个所述承保分片数据块和该承保分片数据块对应的所述财务分片数据块作为一个目标任务信息,得到N个所述目标任务信息;
按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器,以使所述目标节点服务器执行一致性对账检查,其中,所述节点服务器集合包含预设数量的节点服务器;
接收所述目标节点服务器发送的执行结果,并对所述执行结果进行汇总,得到目标结果。
一种基于数据分片的对账方法,包括节点服务器执行的如下步骤:
若接收到中心服务器发送的目标任务信息,则将所述目标任务信息保存到数据池,其中,所述目标任务信息包括承保分片数据块和所述承保分片数据块对应的财务分片数据块;
采用预设的定时任务脚本,定时对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果;
将所述执行结果发送给所述中心服务器。
一种基于数据分片的对账装置,包括中心服务器,中心服务器包括:
数据获取模块,用于获取承保系统中的承保变更数据,并获取财务系统中的财务变更数据;
数据分片模块,用于按照预设维度分别对所述承保变更数据和所述财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与每个所述财务分片数据块之间的映射关系,其中N为正整数;
任务生成模块,用于根据所述映射关系,将每个所述承保分片数据块和该承保分片数据块对应的所述财务分片数据块作为一个目标任务信息,得到N个所述目标任务信息;
任务分片模块,用于按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器,以使所述目标节点服务器执行一致性对账检查,其中,所述节点服务器集合包含预设数量的节点服务器;
结果接收模块,用于接收所述目标节点服务器发送的执行结果,并对所述执行结果进行汇总,得到目标结果。
一种基于数据分片的对账装置,包括节点服务器,节点服务器包括:
数据存储模块,用于若接收到中心服务器发送的目标任务信息,则将所述目标任务信息保存到数据池,其中,所述目标任务信息包括承保分片数据块和所述承保分片数据块对应的财务分片数据块;
对账检查模块,用于采用预设的定时任务脚本,定时对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果;
结果发送模块,用于将所述执行结果发送给所述中心服务器。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述基于数据分片的对账方法的步骤。
一个或多个非易失性可读存储介质,所述非易失性可读存储介质存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行所述基于数据分片的对账方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的基于数据分片的对账方法的应用环境示意图;
图2是本申请实施例提供的基于数据分片的对账方法的实现流程图;
图3是本申请实施例提供的基于数据分片的对账方法中步骤S20的实现流程图;
图4是本申请实施例提供的基于数据分片的对账方法中步骤S40的实现流程图;
图5是本申请实施例提供的基于数据分片的对账方法中步骤S60的实现流程图;
图6是本申请实施例提供的基于数据分片的对账装置的示意图;
图7是本申请实施例提供的计算机设备的示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请 中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1,图1示出本申请实施例提供的基于数据分片的对账方法的应用环境。该基于数据分片的对账方法应用在保险领域的基于数据分片的对账场景中。该记录场景包括中心服务器、节点服务器、客户端和监控端,其中,中心服务器和客户端之间、中心服务器和监控端之间、中心服务器和节点服务器之间通过网络进行连接,客户端向中心服务器提供承保变更数据和财务变更数据,中心服务器通过对承保变更数据和财务变更数据进行分片,得到目标任务信息并发送给节点服务器,节点服务器对目标任务信息执行一致性对账检查,并将得到的结果发送给中心服务器,中心服务器在接收到异常结果时,将异常结果推送给监控端的监控人员。客户端和监控端具体可以但不限于是各种话筒、麦克风、手机和带有录音功能的智能设备,中心服务器和节点服务器具体可以用独立的服务器或者多个服务器组成的服务器集群实现。
本申请实施例中的基于数据分片的对账方法具体包括中心服务器执行的如下步骤:
获取承保系统中的承保变更数据,并获取财务系统中的财务变更数据;
按照预设维度分别对所述承保变更数据和所述财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与每个所述财务分片数据块之间的映射关系,其中N为正整数;
根据所述映射关系,将每个所述承保分片数据块和该承保分片数据块对应的所述财务分片数据块作为一个目标任务信息,得到N个所述目标任务信息;
按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器,以使所述目标节点服务器执行一致性对账检查,其中,所述节点服务器集合包含预设数量的节点服务器;
接收所述目标节点服务器发送的执行结果,并对所述执行结果进行汇总,得到目标结果。
本申请实施例中的基于数据分片的对账方法具体包括节点服务器执行的如下步骤:
若接收到中心服务器发送的目标任务信息,则将所述目标任务信息保存到数据池,其中,所述目标任务信息包括承保分片数据块和所述承保分片数据块对应的财务分片数据块;
采用预设的定时任务脚本,定时对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果;
将所述执行结果发送给所述中心服务器。
请参阅图2,图2示出本申请实施例提供的一种基于数据分片的对账方法,以该方法应用在图1中的中心服务器和节点服务器为例进行说明,详述如下:
S10:中心服务器获取承保系统中的承保变更数据,并获取财务系统中的财务变更数据。
具体地,中心服务器通过网络传输协议,从承保系统中获取承保变更数据,从财务系统中获取财务变更数据。
其中,承保变更数据是指在承保系统中,预设时间范围内数据内容发生了变化的承保数据。
其中,财务变更数据是指在财务系统中,预设时间范围内数据内容发生了变化的财务数据,财务数据和承保数据具有对应关系,即针对任意一条承保数据,总能找到一条与之对应的财务数据。
其中,网络传输协议包括但不限于:互联网控制报文协议(Internet Control Message Protocol,ICMP)、地址解析协议(ARP Address Resolution Protocol,ARP)和文件传输协议(File Transfer Protocol,FTP)等。
值得说明的是,承保系统和财务系统的预设时间范围一致,具体预设时间范围可以根据实际需求进行设置,优选地,在本申请实施例中,预设时间范围为当前时间前一天的0:00到当前时间前一天的23:59。
S20:中心服务器按照预设维度分别对承保变更数据和财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个承保分片数据块与每个财务分片数据块之间的映射关系,其中N为正整数。
具体地,由于保险领域每天数据的变更都较频繁,使得承保变更数据和财务变更数据的数据量都较大,为了维护系统的稳定性能和提高一致性对账的效率,需要采用分片策略,对承保变更数据和财务变更数据进行分片处理,将得到N个承保分片数据块和N个财务分片数据块,并对需要进行一致性对账检查的承保分片数据块和财务分片数据块建立映射关系。
分片策略包括但不限于:平均分配算法策略、作业名哈希值奇偶数算法策略、轮转分片策略、取模分片策略和分区分片策略等,具体可根据实际情况来选取,此处不作具体限制。
优选地,本申请实施例采用的分片策略为分区分片策略,即通过预设不同的分片分区的区间范围,进而确定承保变更数据和财务变更数据所属的区间范围,得到该承保变更数据和财务变更数的分片区间。
S30:中心服务器根据映射关系,将每个承保分片数据块和该承保分片数据块对应的财务分片数据块作为一个目标任务信息,得到N个目标任务信息。
具体地,分片之后需要将分片数据分配到多个节点服务器进行一致性对账检查,为确保具有映射关系的承保分片数据块和财务分片数据块分配到同一个节点服务器,需将具有映射关系的承保分片数据块和承保分片数据块作为同一个目标任务信息进行分配,从而得到N个目标任务信息。
S40:中心服务器按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个目标任务信息分配给目标节点服务器,以使目标节点服务器执行一致性对账检查,其中,节点服务器集合包含预设数量的节点服务器。
具体地,中心服务器与节点服务器集合组成了一个集群,根据节点服务器集合中各个节点服务器的当前状态,选取符合条件的节点服务器作为目标节点服务器,并通过预设的负载均衡(Load Balancing)分配方式,将N个目标任务信息发送给各个目标节点服务器,以使目标节点服务器执行一致性对账检查。
其中,负载均衡从其应用的地理结构上分为本地负载均衡(Local Load Balance)和全局负载均衡(Global Load Balance,也叫地域负载均衡),本实施例中采用的负载均衡分配方式具体可以为本地负载均衡分配方式,本地负载均衡通过灵活多样的均衡策略把访问请求合理地分配给集群内的节点服务器共同负担。即使是给现有节点服务器扩充升级,也只需简单地增加一个新的节点服务器到集群中,而不需改变现有网络结构、停止现有的服务,能有效地解决访问请求过多、网络负荷过重的问题,并且不需花费昂贵开支购置性能卓越的服务器,充分利用现有设备,避免节点服务器单点故障造成访问请求丢失的损失。
其中,符合条件的节点服务器,可以是处于活动状态的节点服务器,也可以是内存、处理器的参数达到预设标准的节点服务器,可根据实际需要进行设置,此处不作具体限制。
值得说明的是,发送到节点服务器的目标任务信息可以是一个,也可以是多个,具体可根据中心服务器进行负载均衡后的分配情况来确定,此处不作具体限制。
S50:若节点服务器接收到中心服务器发送的目标任务信息,则将目标任务信息保存到数据池,其中,目标任务信息包括承保分片数据块和承保分片数据块对应的财务分片数据块。
具体地,节点服务器在通过网络传输协议接收到中心服务器发送的目标任务信息之 后,将目标任务信息保存到数据池,在系统空闲时,或接收到一致性对账指令时,对数据池中的目标任务信息进行一致性对账操作。
S60:节点服务器采用预设的定时任务脚本,定时对数据池中的目标任务信息执行一致性对账检查,得到执行结果。
具体地,本申请实施例中的节点服务器采用预设的定时任务脚本,通过定时触发一致性对账检查任务,来对数据池中的目标任务信息执行一致性对账检查。
其中,定时任务脚本是指用来提交和管理用户需要周期性进行执行的任务的脚本,定时任务脚本的脚本类型包括但不限于:shell脚本、JavaScript脚本、Lua脚本和python脚本等。
其中,一致性对账检查是指对承保变更数据和财务变更数据中的数据内容进行核对,检查承保变更数据和财务变更数据中的数据是否一致。
S70:节点服务器将执行结果发送给中心服务器。
具体地,节点服务器通过网络传输协议将步骤S60中得到的执行结果发送给中心服务器。
S80:中心服务器接收目标节点服务器发送的执行结果,并对执行结果进行汇总,得到目标结果。
具体地,中心服务器每次在接收到节点服务器发送的执行结果后,对执行结果进行汇总,在对所有执行结果均进行汇总后,将汇总后的结果作为目标结果。
在本实施例中,中心服务器获取承保系统中的变更数据,作为承保变更数据,并获取财务系统中的变更数据,作为财务变更数据,进而按照预设维度对承保变更数据和财务变更数据进行分片,得到承保分片数据和财务分片数据,并建立每个承保分片数据与每个财务分片数据的映射关系,将每个承保分片数据和对应的财务分片数据作为一个目标任务信息,按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将目标任务信息分配给目标节点服务器执行,使得数据量较大的承保变更数据和财务变更数据被分片分成多个目标任务信息,并分配到多个目标节点服务器中进行执行,提高了对账的效率和稳定性,节点服务器在接收到中心服务器发送的目标任务信息后,将目标任务信息存入到数据池中,通过预设的定时任务脚本,定时对数据池中的目标任务信息执行一致性对账,并得到执行结果,这种自动进行一致性对账的方式,提高了对账的准确率和效率。
在图2对应的实施例的基础之上,下面通过一个具体的实施例来对步骤S20中所提及的按照预设维度分别对承保变更数据和财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个承保分片数据块与每个财务分片数据块之间的映射关系的具体实现方法进行详细说明,该方法应用在中心服务器。
请参阅图3,图3示出了本申请实施例提供的步骤S20的具体实现流程,详述如下:
S21:从承保变更数据中获取最小的保单号,作为起始保单号,并根据起始保单号和预设的分片区间间隔,确定每个分片区间的保单范围。
具体地,从承保变更数据中,获取最小的保单号作为起始保单号,并根据预设的每个分片区间的间隔,得到每个分片区间的保单范围。
其中,预设的分片区间间隔是指从分片区间的起始保单号,到该分片区间终止保单号之间,包含的保单号的个数,该保单号的个数可以根据实际需要进行设置,此处不作具体限制。
例如,在一具体实施方式中,从承保变更数据中获取到的最小的保单号为5200006326006,预设的最小分配区间的1000,则第一个分片区间的保单范围为[5200006326006,5200006327005],第二个分片区间的保单范围为[5200006327006,5200006328005],按照这种计算方法,可得到任意一个分片区间的保单范围。
值得说明的是,在本申请实施例中,针对每条承保变更数据,均有一条保单号与其相 同的财务变更数据相对应,从承保变更数据中获取到的最小的保单号,也即从财务变更数据中获取到的最小的保单号。
S22:根据每个分片区间的保单范围和每条承保变更数据的保单号,确定每条承保变更数据所属的分片区间,将属于同一个分片区间的承保变更数据作为一个承保分片数据块,得到N个承保分片数据块。
具体地,在确定每个分片区间的保单范围后,对每条承保变更数据的保单号进行判断,确定该保单号所属的分片区间,作为该承保变更数据所属的分片区间,并将处于同一个分片区间的承保变更数据作为一个承保分片数据块,得到N个承保分片数据块。
继续以步骤S21中的示例为例,获取到了5个承保变更数据,其保单号分别为5200006326033、5200006326102、5200006326553、5200006327031和5200006329678,其中,保单号5200006326033、5200006326102、5200006326553属于保单范围为[5200006326006,5200006327005]的分片区间,5200006327031属于保单范围为[5200006327006,5200006328005]的分片区间,5200006329678属于保单范围为[5200006329006,5200006330005]的分片区间,将同属于[5200006326006,5200006327005]分片区间的三个承保变更数据作为一个承保分片数据块,将属于[5200006327006,5200006328005]分片区间的一个承保变更数据作为一个承保分片数据块,将属于[5200006329006,5200006330005]分片区间的一个承保变更数据作为一个承保分片数据块,得到三个承保分片数据块。
S23:根据每个分片区间的保单范围和每条财务数据的保单号,确定每条财务变更数据所属的分片区间,将属于同一个分片区间的财务变更数据作为一个财务分片数据块,得到N个财务分片数据块。
具体地,具体地,在确定每个分片区间的保单范围后,对每条财务变更数据的保单号进行判断,确定该保单号所属的分片区间,作为该财务变更数据所属的分片区间,并将处于同一个分片区间的财务变更数据作为一个承保分片数据块,得到N个财务分片数据块。
可以理解的是,针对每条承保变更数据,均有一条保单号与其相同的财务变更数据相对应,因而,得到的财务分片数据块与步骤S22中得到的承保分片数据块数量一致。
需要说明的是,步骤S22和步骤S23没有必然的先后执行顺序,其可以是并列执行的关系,此处不做限制。
S24:对具有相同分片区间的承保分片数据块和财务分片数据块之间建立映射关系。
具体地,在得到承保分片数据块和财务分片数据块之后,对属于同一分片区间的承保分片数据块和财务分片数据块建立一一对应的映射关系,以便后续在进行一致性对账时,通过该映射关系来进行比较。
在本实施例中,从承保变更数据中获取最小的保单号,作为起始保单号,并根据起始保单号和预设的分片区间间隔,确定每个分片区间的保单范围,根据每个分片区间的保单范围和每条承保变更数据的保单号,确定每条承保变更数据所属的分片区间,将属于同一个分片区间的承保变更数据作为一个承保分片数据块,得到N个承保分片数据块,根据每个分片区间的保单范围和每条财务变更数据的保单号,确定每条财务变更数据所属的分片区间,将属于同一个分片区间的财务变更数据作为一个财务分片数据块,得到N个财务分片数据块,进而对具有相同分片区间的承保分片数据块和财务分片数据块之间建立映射关系,使得承保变更数据和财务变更数据按照相同维度被分成多个分片数据,并建立映射关系,有利于后续将这些分片数据分发到多个节点服务器上进行一致性检查。
在图2对应的实施例的基础之上,下面通过一个具体的实施例来对步骤S40中所提及的按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个目标任务信息分配给目标节点服务器的具体实现方法进行详细说明,该方法应用在中心服务器。
请参阅图4,图4示出了本申请实施例提供的步骤S40的具体实现流程,详述如下:
S41:采用预设的探测机制对节点服务器集合中的每个节点服务器进行探测,获取节点服务器的状态,并将状态为激活的节点服务器确定为目标节点服务器。
具体地,通过预设的探测机制,对节点服务器集合中的每个节点服务器进行探测,找到状态为激活的节点服务器,并将该节点服务器确定为目标节点服务器。
其中,预设的探测机制是指使用探针定时的对各个节点服务器进行可用性的尝试,其具体实施方式可以是通过中心服务器向各个节点服务器发送ping或者curl命令,如果返回的结果正常,则说明该节点服务器状态为激活,如果返回异常,则说明该节点服务器状态为宕机。
S42:针对每个目标节点服务器,获取该目标节点服务器的中央处理器型号Q
1、磁盘空间参数Q
2和内存型号Q
3。
具体地,每个目标节点服务器的使用状态不尽相同,即不同的目标节点服务器的硬件配置各不相同,其中,硬件配置包括但不限于:中央处理器型号和内存型号等,当前的磁盘空间大小也不一样,而目标节点服务器的使用状态决定了其数据存储与处理能力,因此,针对每个目标节点服务器,需要先获取该目标节点服务器的使用状态,即该目标服务器的中央处理器型号、磁盘空间参数和内存型号。
S43:按照如下公式计算每个目标节点服务器对应的状态分值S:
S=J
1+Q
2×J
2+J
3
其中,J
1为中央处理器型号Q
1对应的预设权值,J
2为磁盘空间参数Q
2对应的预设权值,J
3为内存型号Q
3对应的预设权值。
具体地,可根据使用状态计算该目标节点服务器的状态分值是指通过当前使用状态所涉及到的各种参数,以及预先设置的各种参数的相应权重,得到目标节点服务器的状态分值,针对不同型号的中央处理器、磁盘空间参数和内存型号,分别预设各自对应的权值,在获取到目标节点服务器的使用状态后,使用公式S=J
1+Q
2×J
2+J
3计算目标节点服务器的状态分值。
例如,在一具体实施方式中,在节点服务器集合中,中央处理器的型号包括:E3-1231v3、E5-2620v4和E5-2680v2,对应的预设权值为:0.1、0.3和0.6,内存型号包括:KVR24N17D8/8-SP和KVR26N19S8/8,对应的预设权值为0.4和0.6,磁盘空间参数的预设阈值为0.5,获取到某个目标节点服务器的中央处理器的型号为E5-2620v4,磁盘空间参数为0.8太字节(Terabyte,TB),内存型号为KVR24N17D8/8-SP,该目标节点服务器的状态分值为:S=0.3+0.8×0.5+0.4=1.1。
S44:根据状态分值计算每个目标节点服务器的任务分配比例。
具体地,计算出每个目标节点服务器的状态分值后,将所有目标节点服务器的状态分值进行累加,得到所有目标节点服务器状态分值之和,进而针对每个目标节点服务器,计算该目标节点服务器的状态分值与所有目标节点服务器状态分值之和的比值,作为该目标节点服务器的任务分配比例。
例如,在一具体实施方式中,存在两个目标节点服务器,分别为第一目标节点服务器和第二目标节点服务器,第一目标节点服务器的状态分值为3,第二目标节点服务器的状态分值为7,根据上述描述,计算得到第一目标节点服务器的任务分配比例为30%,第一 目标节点服务器的任务分配比例为70%。
S45:按照任务分配比例,将N个目标任务信息发送给目标节点服务器。
具体地,按照步骤S44中得到的任务分配比例,将N个目标任务信息分发到目标节点服务器。
在本实施例中,采用预设的探测机制对节点服务器集合中的每个节点服务器进行探测,获取节点服务器的状态,并将状态为激活的节点服务器确定为目标节点服务器,针对每个目标节点服务器,获取该目标节点服务器的中央处理器型号、磁盘空间参数和内存型号,并通过预设的公司几段每个目标节点服务器对应的状态分值,从而根据状态分值计算每个目标节点服务器的任务分配比例,进而按照任务分配比例,将N个目标任务信息发送给目标节点服务器,使得N个目标任务信息通过这种负载均衡的方式加载到每个目标节点服务器,可以根据每个节点服务器的运行状况合理进行目标任务信息的分配,保证了中心服务器和节点服务器的稳定性,同时这种分摊的方式,也提高了任务处理的效率。
在图2对应的实施例的基础之上,下面通过一个具体的实施例来对步骤S60中所提及的对数据池中的目标任务信息执行一致性对账检查,得到执行结果的具体实现方法进行详细说明,该方法应用在节点服务器。
请参阅图5,图5示出了本申请实施例提供的步骤S60的具体实现流程,详述如下:
S61:对承保分片数据块中的每条承保变更数据添加待处理的状态标识。
具体地,在到达指定时间时,定时脚本会触发对数据池的目标任务信息执行一致性对账检查,在执行一致性对账检查之前,需要先对每条承保变更数据添加待处理的状态标识,在后续执行完一致性对账检查之后,将该状态标识更新为已处理,以避免对相同数据执行重复检查。
其中,状态标识用来标识承保变更数据当前的处理状态,状态标识包括待处理和已处理。
S62:从状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取基础数据的保单号,作为目标保单号。
具体地,获取所有状态标识为待处理的承保变更数据,并从该承保变更数据中随机选取一条承保变更数据作为基础数据,并将该基础数据的保单号作为目标保单号。
其中,随机选取可以使用随机数发生器random来实现。
S63:从财务分片数据块中获取与目标保单号具有相同保单号的财务变更数据,作为比较数据。
具体地,通过字符串查找的方式,从财务分片数据块的财务变更数据中,获取与目标保单号具有相同保单号的财务变更数据,作为比较数据,用于后续与基础数据进行一致性对账。
例如,在一具体实施方式中,目标保单号为5200006327031,在财务分片数据块的财务变更数据中,对该字符串进行查找,获得保单号为该字符串的财务变更数据,作为基础数据对应的比较数据。
S64:对基础数据和比较数据进行对比,得到对比结果,并将基础数据的状态标识更新为已处理。
具体地,对基础数据和比较数据中包含的预设类型数据的数据内容进行对比,得到对比结果,同时,将基础数据的状态标识更新为已处理,避免后续重复对该基础数据执行对比操作。
其中,预设类型数据是指保单数据中,需要进行对比的数据类型,例如:保费金额,预设类型数据可以是一项,也可以是多项,具体可以根据实际需要来进行设置,此处不作具体限制。
例如,在一具体实施方式中,预设类型数据包括姓名、身份证号码和保费金额,分别 将基础数据和比较数据的姓名进行对比,确认是够为同一客户姓名,将身份证号码进行对比,确认是否为相同身份证号码,并将保费金额进行对比,确定保费金额是否一致等。
值得说明的是,若预设数据类型超过一项时,存在任意一项不一致,则确认对比结果为存在不一致的变更数据,在存在不一致的变更数据时,记录这些不一致的承保变更数据和对应的财务变更数据的信息。
S65:对承保变更数据的状态标识进行遍历,得到遍历结果。
具体地,在完成一次一致性对账后,需对承保变更数据中,其余的的状态标识为待处理的承保变更数据进行一致性对账,通过对承保变更数据的状态标识进行遍历,来获取状态标识为待处理的承保变更数据,进而对该承保变更数据执行一致性对账。
其中,遍历(Traversal)是指对保存承保变更数据的节点树中所有结点的信息的访问,即依次对节点树中每个结点访问一次且仅访问一次。遍历方式包括但不限于:前序遍历、中序遍历和后序遍历等。
优选地,本申请实施例使用的遍历方式为前序遍历,前序遍历的顺序包括NLR或NRL,其中N是指根(Node),L是指根的左节点(Left subtree),R是指根的右节点(Right subtree)。
值得说明的是,本步骤中的遍历操作,目的是找出包含状态标识为待处理的承保变更数据,并对其进行一致性对账检查,因而,本申请实施例提供一种优选方案,在找到任何一个状态标识为待处理的承保变更数据后,即结束本次遍历,将该承保变更数据作为遍历的结果,作为步骤S66中的基础数据,执行后续一致性对账操作。
S66:若遍历结果为存在状态标识为待处理的承保变更数据,则返回执行从状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取基础数据的保单号,作为目标保单号的步骤。
具体地,步骤S65中遍历结果存在状态标识为待处理的承保变更数据时,即还存在需要进行一致性对账的承保变更数据,此时,将从状态标识为待处理的承保变更数据中随机选取一条承保变更数据作为基础数据,返回到步骤S62继续执行。
S67:若遍历结果为不存在状态标识为待处理的承保变更数据,则将每个对比结果进行汇总,得到执行结果。
具体地,在遍历结果为不存在状态标识为待处理的承保变更数据时,即可确认所有承保变更数据均已完成一致性对账检查,此处,将得到的每个对比结果进行汇总,得到执行结果。
需要说明的是,步骤S66和步骤S67没有必然的先后执行顺序,其可以是并列执行的关系,此处不做限制。
在本实施例中,对承保分片数据块中的每条承保变更数据添加待处理的状态标识,从状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取基础数据的保单号,作为目标保单号,从财务分片数据块中获取与目标保单号具有相同保单号的财务变更数据,作为比较数据,对基础数据和比较数据进行对比,得到对比结果,并将基础数据的状态标识更新为已处理,对承保变更数据的状态标识进行遍历,得到遍历结果,若遍历结果为存在状态标识为待处理的承保变更数据,则返回执行从状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取基础数据的保单号,作为目标保单号的步骤,若遍历结果为不存在状态标识为待处理的承保变更数据,则将每个对比结果进行汇总,得到执行结果,使得具有相同保单号的承保变更数据和财务变更数据进行一致性对账检查,并得到检查结果,避免人工方式进行对账的遗漏和效率低下,提高了一致性对账的效率和稳定性。
在一实施例中,在步骤S80之后,该基于数据分片的对账方法还包括中心服务器执行的如下步骤:
若目标结果为存在不一致的变更数据,则将不一致的变更数据推送给监控端。
具体地,在中心服务器在对各个节点服务器发送的执行结果进行汇总,得到目标结果之后,若目标结果中存在不一致的变更数据,则获取记录的不一致的承保变更数据和对应的财务变更数据的信息,作为异常信息,并将该异常信息推送给监控端,以便监控端的监控人员及时对不一致的数据进行原因查找与纠正。
其中,异常信息的推送方式可以是通过邮件推送或系统消息推送等。
在本实施例中,若目标结果为存在不一致的变更数据,则中心服务器将不一致的变更数据推送给监控端,使得监控端的监控人员可以及时掌握相关异常信息并进行核实纠正,避免了承保变更数据和财务变更数据不一致带来的损失,提高了基于数据分片的对账的及时性。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
图6示出与上述实施例基于数据分片的对账方法一一对应的基于数据分片的对账装置的原理框图。该基于数据分片的对账装置包括中心服务器和节点服务器,为了便于说明。仅示出了与本申请实施例相关的部分。
如图6所示,该基于数据分片的对账装置的中心服务器包括数据获取模块10、数据分片模块20、任务生成模块30、任务分片模块40和结果接收模块50。各功能模块详细说明如下:
数据获取模块10,用于获取承保系统中的承保变更数据,并获取财务系统中的财务变更数据;
数据分片模块20,用于按照预设维度分别对承保变更数据和财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个承保分片数据块与每个财务分片数据块之间的映射关系,其中N为正整数;
任务生成模块30,用于根据映射关系,将每个承保分片数据块和该承保分片数据块对应的财务分片数据块作为一个目标任务信息,得到N个目标任务信息;
任务分片模块40,用于按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个目标任务信息分配给目标节点服务器,以使目标节点服务器执行一致性对账检查,其中,节点服务器集合包含预设数量的节点服务器;
结果接收模块50,用于接收目标节点服务器发送的执行结果,并对执行结果进行汇总,得到目标结果。
进一步地,数据分片模块20包括:
范围确定单元21,用于从承保变更数据中获取最小的保单号,作为起始保单号,并根据起始保单号和预设的分片区间间隔,确定每个分片区间的保单范围;
第一分片单元22,用于根据每个分片区间的保单范围和每条承保变更数据的保单号,确定每条承保变更数据所属的分片区间,将属于同一个分片区间的承保变更数据作为一个承保分片数据块,得到N个承保分片数据块;
第二分片单元23,用于根据每个分片区间的保单范围和每条财务数据的保单号,确定每条财务变更数据所属的分片区间,将属于同一个分片区间的财务变更数据作为一个财务分片数据块,得到N个财务分片数据块;
数据映射单元24,用于对具有相同分片区间的承保分片数据块和财务分片数据块之间建立映射关系。
进一步地,任务分片模块40包括:
节点探测单元41,用于采用预设的探测机制对节点服务器集合中的每个节点服务器进行探测,获取节点服务器的状态,并将状态为激活的节点服务器确定为目标节点服务器;
状态获取单元42,用于针对每个目标节点服务器,获取该目标节点服务器的中央处理器型号Q
1、磁盘空间参数Q
2和内存型号Q
3;
分值计算单元43,用于按照如下公式计算每个目标节点服务器对应的状态分值S:
S=J
1+Q
2×J
2+J
3
其中,J
1为中央处理器型号Q
1对应的预设权值,J
2为磁盘空间参数Q
2对应的预设权值,J
3为内存型号Q
3对应的预设权值;
比例计算单元44,用于根据状态分值计算每个目标节点服务器的任务分配比例;
任务分配单元45,用于按照任务分配比例,将N个目标任务信息发送给目标节点服务器。
进一步地,该中心服务器还包括:
异常处理模块60,用于若目标结果为存在不一致的变更数据,则将不一致的变更数据推送给监控端。
请继续参阅图6,如图6所示,该基于数据分片的对账装置的节点服务器包括:数据存储模块70、对账检查模块80和结果发送模块90。各功能模块详细说明如下:
数据存储模块70,用于若接收到中心服务器发送的目标任务信息,则将目标任务信息保存到数据池,其中,目标任务信息包括承保分片数据块和承保分片数据块对应的财务分片数据块;
对账检查模块80,用于采用预设的定时任务脚本,定时对数据池中的目标任务信息执行一致性对账检查,得到执行结果;
结果发送模块90,用于将执行结果发送给中心服务器。
进一步地,对账检查模块80包括:
状态标识单元81,用于对承保分片数据块中的每条承保变更数据添加待处理的状态标识;
第一选取单元82,用于从状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取基础数据的保单号,作为目标保单号;
第二选取单元83,用于从财务分片数据块中获取与目标保单号具有相同保单号的财务变更数据,作为比较数据;
数据比较单元84,用于对基础数据和比较数据进行对比,得到对比结果,并将基础数据的状态标识更新为已处理;
状态遍历单元85,用于对承保变更数据的状态标识进行遍历,得到遍历结果;
循环执行单元86,用于若遍历结果为存在状态标识为待处理的承保变更数据,则返回执行从状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取基础数据的保单号,作为目标保单号的步骤;
结果汇总单元87,用于若遍历结果为不存在状态标识为待处理的承保变更数据,则将每个对比结果进行汇总,得到执行结果。
关于基于数据分片的对账装置的具体限定可以参见上文中对于基于数据分片的对账方法的限定,在此不再赘述。上述基于数据分片的对账装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
图7是本申请一实施例提供的计算机设备的示意图。该计算机设备可以是中心服务器,也可以是节点服务器,其内部结构图可以如图7所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介 质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储承保变更数据和财务变更数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种基于数据分片的对账方法。
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现上述实施例基于数据分片的对账方法的步骤,例如图2所示的步骤S10至步骤S80。或者,处理器执行计算机可读指令时实现上述实施例基于数据分片的对账装置的各模块/单元的功能,例如图6所示的中心服务器的模块10至模块50的功能,以及节点服务器的模块70至模90的功能。为避免重复,这里不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
在一实施例中,提供一个或多个非易失性可读存储介质,该可读存储介质上存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时实现上述实施例基于数据分片的对账方法的步骤,或者,该计算机可读指令被一个或多个处理器执行时实现上述实施例基于数据分片的对账装置中各模块/单元的功能。为避免重复,这里不再赘述。
可以理解地,所述可读存储介质可以包括:能够携带所述计算机可读指令的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、电载波信号和电信信号等。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。
Claims (20)
- 一种基于数据分片的对账方法,其特征在于,所述基于数据分片的对账方法包括中心服务器执行的如下步骤:获取承保系统中的承保变更数据,并获取财务系统中的财务变更数据;按照预设维度分别对所述承保变更数据和所述财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与每个所述财务分片数据块之间的映射关系,其中,N为正整数;根据所述映射关系,将每个所述承保分片数据块和该承保分片数据块对应的所述财务分片数据块作为一个目标任务信息,得到N个所述目标任务信息;按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器,以使所述目标节点服务器执行一致性对账检查,其中,所述节点服务器集合包含预设数量的节点服务器;接收所述目标节点服务器发送的执行结果,并对所述执行结果进行汇总,得到目标结果。
- 如权利要求1所述的基于数据分片的对账方法,其特征在于,每条所述承保变更数据和每条所述财务变更数据均包括保单号,预设维度为所述保单号,所述按照预设维度对所述承保变更数据和所述财务变更数据进行分片,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与所述财务分片数据块的映射关系包括:从所述承保变更数据中获取最小的保单号,作为起始保单号,并根据所述起始保单号和预设的分片区间间隔,确定每个分片区间的保单范围;根据每个所述分片区间的保单范围和每条所述承保变更数据的保单号,确定每条所述承保变更数据所属的分片区间,将属于同一个分片区间的承保变更数据作为一个承保分片数据块,得到N个承保分片数据块;根据每个所述分片区间的保单范围和每条所述财务变更数据的保单号,确定每条所述财务变更数据所属的分片区间,将属于同一个分片区间的财务变更数据作为一个财务分片数据块,得到N个财务分片数据块;对具有相同分片区间的承保分片数据块和财务分片数据块之间建立映射关系。
- 如权利要求1所述的基于数据分片的对账方法,其特征在于,所述按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器包括:采用预设的探测机制对节点服务器集合中的每个节点服务器进行探测,获取节点服务器的状态,并将所述状态为激活的节点服务器确定为目标节点服务器;针对每个所述目标节点服务器,获取该目标节点服务器的中央处理器型号Q 1、磁盘空间参数Q 2和内存型号Q 3;按照如下公式计算每个所述目标节点服务器对应的状态分值S:S=J 1+Q 2×J 2+J 3其中,J 1为所述中央处理器型号Q 1对应的预设权值,J 2为所述磁盘空间参数Q 2对应的预设权值,J 3为所述内存型号Q 3对应的预设权值;根据所述状态分值计算每个所述目标节点服务器的任务分配比例;按照所述任务分配比例,将N个所述目标任务信息发送给所述目标节点服务器。
- 如权利要求1所述的基于数据分片的对账方法,其特征在于,在所述接收所述目标节点服务器发送的执行结果,并对所述执行结果进行汇总,得到目标结果之后,所述基于数据分片的对账方法还包括:若所述目标结果为存在不一致的变更数据,则将所述不一致的变更数据推送给监控端。
- 一种基于数据分片的对账方法,其特征在于,所述基于数据分片的对账方法包括节点服务器执行的如下步骤:若接收到中心服务器发送的目标任务信息,则将所述目标任务信息保存到数据池,其中,所述目标任务信息包括承保分片数据块和所述承保分片数据块对应的财务分片数据块;采用预设的定时任务脚本,定时对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果;将所述执行结果发送给所述中心服务器。
- 如权利要求5所述的基于数据分片的对账方法,其特征在于,所述对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果包括:对所述承保分片数据块中的每条承保变更数据添加待处理的状态标识;从所述状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取所述基础数据的保单号,作为目标保单号;从所述财务分片数据块中获取与所述目标保单号具有相同保单号的财务变更数据,作为比较数据;对所述基础数据和所述比较数据进行对比,得到对比结果,并将所述基础数据的所述状态标识更新为已处理;对所述承保变更数据的状态标识进行遍历,得到遍历结果;若所述遍历结果为存在状态标识为待处理的所述承保变更数据,则返回执行所述从所述状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取所述基础数据的保单号,作为目标保单号的步骤;若所述遍历结果为不存在状态标识为待处理的承保变更数据,则将每个所述对比结果进行汇总,得到所述执行结果。
- 一种基于数据分片的对账装置,其特征在于,所述基于数据分片的对账装置包括中心服务器,所述中心服务器包括:数据获取模块,用于获取承保系统中的承保变更数据,并获取财务系统中的财务变更数据;数据分片模块,用于按照预设维度分别对所述承保变更数据和所述财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与每个所述财务分片数据块之间的映射关系,其中N为正整数;任务生成模块,用于根据所述映射关系,将每个所述承保分片数据块和该承保分片数据块对应的所述财务分片数据块作为一个目标任务信息,得到N个所述目标任务信息;任务分片模块,用于按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器,以使所述目标节点服务器执行一致性对账检查,其中,所述节点服务器集合包含预设数量的节点服务器;结果接收模块,用于接收所述目标节点服务器发送的执行结果,并对所述执行结果进行汇总,得到目标结果。
- 如权利要求7所述的基于数据分片的对账装置,其特征在于,所述数据分片模块包括:范围确定单元,用于从所述承保变更数据中获取最小的保单号,作为起始保单号,并根据所述起始保单号和预设的分片区间间隔,确定每个分片区间的保单范围;第一分片单元,用于根据每个所述分片区间的保单范围和每条所述承保变更数据的保单号,确定每条所述承保变更数据所属的分片区间,将属于同一个分片区间的承保变更数据作为一个承保分片数据块,得到N个承保分片数据块;第二分片单元,用于根据每个所述分片区间的保单范围和每条所述财务变更数据的保单号,确定每条所述财务变更数据所属的分片区间,将属于同一个分片区间的财务变更数据作为一个财务分片数据块,得到N个财务分片数据块;数据映射单元,用于对具有相同分片区间的承保分片数据块和财务分片数据块之间建立映射关系。
- 一种基于数据分片的对账装置,其特征在于,所述基于数据分片的对账装置包括节点服务器,所述节点服务器包括:数据存储模块,用于若接收到中心服务器发送的目标任务信息,则将所述目标任务信息保存到数据池,其中,所述目标任务信息包括承保分片数据块和所述承保分片数据块对应的财务分片数据块;对账检查模块,用于采用预设的定时任务脚本,定时对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果;结果发送模块,用于将所述执行结果发送给所述中心服务器。
- 如权利要求9所述的基于数据分片的对账装置,其特征在于,所述对账检查模块包括:状态标识单元,用于对所述承保分片数据块中的每条承保变更数据添加待处理的状态标识;第一选取单元,用于从所述状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取所述基础数据的保单号,作为目标保单号;第二选取单元,用于从所述财务分片数据块中获取与所述目标保单号具有相同保单号的财务变更数据,作为比较数据;数据比较单元,用于对所述基础数据和所述比较数据进行对比,得到对比结果,并将所述基础数据的所述状态标识更新为已处理;状态遍历单元,用于对所述承保变更数据的状态标识进行遍历,得到遍历结果;循环执行单元,用于若所述遍历结果为存在状态标识为待处理的所述承保变更数据,则返回执行所述从所述状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取所述基础数据的保单号,作为目标保单号的步骤;结果汇总单元,用于若所述遍历结果为不存在状态标识为待处理的承保变更数据,则将每个所述对比结果进行汇总,得到所述执行结果。
- 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现中心服务器执行的如下步骤:获取承保系统中的承保变更数据,并获取财务系统中的财务变更数据;按照预设维度分别对所述承保变更数据和所述财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与每个所述财务分片数据块之间的映射关系,其中,N为正整数;根据所述映射关系,将每个所述承保分片数据块和该承保分片数据块对应的所述财务分片数据块作为一个目标任务信息,得到N个所述目标任务信息;按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器,以使所述目标节点服务器执行一致性对账 检查,其中,所述节点服务器集合包含预设数量的节点服务器;接收所述目标节点服务器发送的执行结果,并对所述执行结果进行汇总,得到目标结果。
- 如权利要求11所述的计算机设备,其特征在于,每条所述承保变更数据和每条所述财务变更数据均包括保单号,预设维度为所述保单号,所述按照预设维度对所述承保变更数据和所述财务变更数据进行分片,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与所述财务分片数据块的映射关系包括:从所述承保变更数据中获取最小的保单号,作为起始保单号,并根据所述起始保单号和预设的分片区间间隔,确定每个分片区间的保单范围;根据每个所述分片区间的保单范围和每条所述承保变更数据的保单号,确定每条所述承保变更数据所属的分片区间,将属于同一个分片区间的承保变更数据作为一个承保分片数据块,得到N个承保分片数据块;根据每个所述分片区间的保单范围和每条所述财务变更数据的保单号,确定每条所述财务变更数据所属的分片区间,将属于同一个分片区间的财务变更数据作为一个财务分片数据块,得到N个财务分片数据块;对具有相同分片区间的承保分片数据块和财务分片数据块之间建立映射关系。
- 如权利要求11所述的计算机设备,其特征在于,所述按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器包括:采用预设的探测机制对节点服务器集合中的每个节点服务器进行探测,获取节点服务器的状态,并将所述状态为激活的节点服务器确定为目标节点服务器;针对每个所述目标节点服务器,获取该目标节点服务器的中央处理器型号Q 1、磁盘空间参数Q 2和内存型号Q 3;按照如下公式计算每个所述目标节点服务器对应的状态分值S:S=J 1+Q 2×J 2+J 3其中,J 1为所述中央处理器型号Q 1对应的预设权值,J 2为所述磁盘空间参数Q 2对应的预设权值,J 3为所述内存型号Q 3对应的预设权值;根据所述状态分值计算每个所述目标节点服务器的任务分配比例;按照所述任务分配比例,将N个所述目标任务信息发送给所述目标节点服务器。
- 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现节点服务器执行的如下步骤:若接收到中心服务器发送的目标任务信息,则将所述目标任务信息保存到数据池,其中,所述目标任务信息包括承保分片数据块和所述承保分片数据块对应的财务分片数据块;采用预设的定时任务脚本,定时对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果;将所述执行结果发送给所述中心服务器。
- 如权利要求14所述的计算机设备,其特征在于,所述对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果包括:对所述承保分片数据块中的每条承保变更数据添加待处理的状态标识;从所述状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取所述基础数据的保单号,作为目标保单号;从所述财务分片数据块中获取与所述目标保单号具有相同保单号的财务变更数据,作为比较数据;对所述基础数据和所述比较数据进行对比,得到对比结果,并将所述基础数据的所述状态标识更新为已处理;对所述承保变更数据的状态标识进行遍历,得到遍历结果;若所述遍历结果为存在状态标识为待处理的所述承保变更数据,则返回执行所述从所述状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取所述基础数据的保单号,作为目标保单号的步骤;若所述遍历结果为不存在状态标识为待处理的承保变更数据,则将每个所述对比结果进行汇总,得到所述执行结果。
- 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得中心服务器执行的如下步骤:获取承保系统中的承保变更数据,并获取财务系统中的财务变更数据;按照预设维度分别对所述承保变更数据和所述财务变更数据进行分片处理,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与每个所述财务分片数据块之间的映射关系,其中,N为正整数;根据所述映射关系,将每个所述承保分片数据块和该承保分片数据块对应的所述财务分片数据块作为一个目标任务信息,得到N个所述目标任务信息;按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器,以使所述目标节点服务器执行一致性对账检查,其中,所述节点服务器集合包含预设数量的节点服务器;接收所述目标节点服务器发送的执行结果,并对所述执行结果进行汇总,得到目标结果。
- 如权利要求16所述的非易失性可读存储介质,其特征在于,每条所述承保变更数据和每条所述财务变更数据均包括保单号,预设维度为所述保单号,所述按照预设维度对所述承保变更数据和所述财务变更数据进行分片,得到N个承保分片数据块和N个财务分片数据块,并建立每个所述承保分片数据块与所述财务分片数据块的映射关系包括:从所述承保变更数据中获取最小的保单号,作为起始保单号,并根据所述起始保单号和预设的分片区间间隔,确定每个分片区间的保单范围;根据每个所述分片区间的保单范围和每条所述承保变更数据的保单号,确定每条所述承保变更数据所属的分片区间,将属于同一个分片区间的承保变更数据作为一个承保分片数据块,得到N个承保分片数据块;根据每个所述分片区间的保单范围和每条所述财务变更数据的保单号,确定每条所述财务变更数据所属的分片区间,将属于同一个分片区间的财务变更数据作为一个财务分片数据块,得到N个财务分片数据块;对具有相同分片区间的承保分片数据块和财务分片数据块之间建立映射关系。
- 如权利要求16所述的非易失性可读存储介质,其特征在于,所述按照预设的负载均衡分配方式,从节点服务器集合中选取目标节点服务器,并将N个所述目标任务信息分配给所述目标节点服务器包括:采用预设的探测机制对节点服务器集合中的每个节点服务器进行探测,获取节点服务器的状态,并将所述状态为激活的节点服务器确定为目标节点服务器;针对每个所述目标节点服务器,获取该目标节点服务器的中央处理器型号Q 1、磁盘空 间参数Q 2和内存型号Q 3;按照如下公式计算每个所述目标节点服务器对应的状态分值S:S=J 1+Q 2×J 2+J 3其中,J 1为所述中央处理器型号Q 1对应的预设权值,J 2为所述磁盘空间参数Q 2对应的预设权值,J 3为所述内存型号Q 3对应的预设权值;根据所述状态分值计算每个所述目标节点服务器的任务分配比例;按照所述任务分配比例,将N个所述目标任务信息发送给所述目标节点服务器。
- 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得节点服务器执行的如下步骤:若接收到中心服务器发送的目标任务信息,则将所述目标任务信息保存到数据池,其中,所述目标任务信息包括承保分片数据块和所述承保分片数据块对应的财务分片数据块;采用预设的定时任务脚本,定时对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果;将所述执行结果发送给所述中心服务器。
- 如权利要求19所述的非易失性可读存储介质,其特征在于,所述对所述数据池中的所述目标任务信息执行一致性对账检查,得到执行结果包括:对所述承保分片数据块中的每条承保变更数据添加待处理的状态标识;从所述状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取所述基础数据的保单号,作为目标保单号;从所述财务分片数据块中获取与所述目标保单号具有相同保单号的财务变更数据,作为比较数据;对所述基础数据和所述比较数据进行对比,得到对比结果,并将所述基础数据的所述状态标识更新为已处理;对所述承保变更数据的状态标识进行遍历,得到遍历结果;若所述遍历结果为存在状态标识为待处理的所述承保变更数据,则返回执行所述从所述状态标识为待处理的承保变更数据中,随机选取一条承保变更数据,作为基础数据,并获取所述基础数据的保单号,作为目标保单号的步骤;若所述遍历结果为不存在状态标识为待处理的承保变更数据,则将每个所述对比结果进行汇总,得到所述执行结果。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811010201.4A CN109117275B (zh) | 2018-08-31 | 2018-08-31 | 基于数据分片的对账方法、装置、计算机设备及存储介质 |
CN201811010201.4 | 2018-08-31 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020042427A1 true WO2020042427A1 (zh) | 2020-03-05 |
Family
ID=64861755
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/120316 WO2020042427A1 (zh) | 2018-08-31 | 2018-12-11 | 基于数据分片的对账方法、装置、计算机设备及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109117275B (zh) |
WO (1) | WO2020042427A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118227302A (zh) * | 2024-05-27 | 2024-06-21 | 浙江邦盛科技股份有限公司 | 一种中间态时序协调计算方法、装置、设备及存储介质 |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109886795A (zh) * | 2019-01-15 | 2019-06-14 | 网联清算有限公司 | 跨机房分布式对账处理方法及装置 |
CN109885256B (zh) * | 2019-01-23 | 2022-07-08 | 平安科技(深圳)有限公司 | 一种基于数据分片的数据存储方法、设备及介质 |
CN109934712B (zh) * | 2019-01-30 | 2022-07-15 | 网联清算有限公司 | 应用于分布式系统的对账方法、对账装置和电子设备 |
CN110060140A (zh) * | 2019-03-15 | 2019-07-26 | 深圳壹账通智能科技有限公司 | 海量数据对账方法、装置、介质和计算机设备 |
CN110083595A (zh) * | 2019-05-08 | 2019-08-02 | 深圳乐信软件技术有限公司 | 一种离线对账系统、方法及设备 |
CN110363673A (zh) * | 2019-07-23 | 2019-10-22 | 浙江大搜车软件技术有限公司 | 保单分配方法、装置、计算机设备和存储介质 |
CN110618880B (zh) * | 2019-09-19 | 2022-05-27 | 中国银行股份有限公司 | 一种跨系统数据传递系统和方法 |
CN111211989B (zh) * | 2019-12-24 | 2023-04-07 | 浙江云诺通信科技有限公司 | 一种基于宽带电视cdn质量分析方法 |
CN111191794B (zh) * | 2019-12-29 | 2023-03-14 | 广东浪潮大数据研究有限公司 | 一种训练任务处理方法、装置、设备及可读存储介质 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090228446A1 (en) * | 2008-03-06 | 2009-09-10 | Hitachi, Ltd. | Method for controlling load balancing in heterogeneous computer system |
CN102043857A (zh) * | 2010-12-27 | 2011-05-04 | 中国科学院计算技术研究所 | 最近邻查询方法及系统 |
CN105045877A (zh) * | 2015-07-20 | 2015-11-11 | 深圳市深信服电子科技有限公司 | 数据库数据分片存储方法和装置、数据查询方法和装置 |
CN106202278A (zh) * | 2016-07-01 | 2016-12-07 | 武汉泰迪智慧科技有限公司 | 一种基于数据挖掘技术的舆情监测系统 |
CN106951475A (zh) * | 2017-03-07 | 2017-07-14 | 郑州铁路职业技术学院 | 基于云计算的大数据分布式处理方法及系统 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030074288A1 (en) * | 2001-10-11 | 2003-04-17 | Pitney Bowes Incorporated | System and method for electronically reconciling financial accounts |
CN105719182B (zh) * | 2016-01-18 | 2020-03-03 | 北京京东尚科信息技术有限公司 | 一种自动对账方法以及自动对账系统 |
-
2018
- 2018-08-31 CN CN201811010201.4A patent/CN109117275B/zh active Active
- 2018-12-11 WO PCT/CN2018/120316 patent/WO2020042427A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090228446A1 (en) * | 2008-03-06 | 2009-09-10 | Hitachi, Ltd. | Method for controlling load balancing in heterogeneous computer system |
CN102043857A (zh) * | 2010-12-27 | 2011-05-04 | 中国科学院计算技术研究所 | 最近邻查询方法及系统 |
CN105045877A (zh) * | 2015-07-20 | 2015-11-11 | 深圳市深信服电子科技有限公司 | 数据库数据分片存储方法和装置、数据查询方法和装置 |
CN106202278A (zh) * | 2016-07-01 | 2016-12-07 | 武汉泰迪智慧科技有限公司 | 一种基于数据挖掘技术的舆情监测系统 |
CN106951475A (zh) * | 2017-03-07 | 2017-07-14 | 郑州铁路职业技术学院 | 基于云计算的大数据分布式处理方法及系统 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118227302A (zh) * | 2024-05-27 | 2024-06-21 | 浙江邦盛科技股份有限公司 | 一种中间态时序协调计算方法、装置、设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN109117275B (zh) | 2024-05-28 |
CN109117275A (zh) | 2019-01-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020042427A1 (zh) | 基于数据分片的对账方法、装置、计算机设备及存储介质 | |
CN108920272B (zh) | 一种数据处理方法、装置、计算机设备及存储介质 | |
US10496627B2 (en) | Consistent ring namespaces facilitating data storage and organization in network infrastructures | |
US20190220315A1 (en) | Dynamic Adjustment Of Application Resources In A Distributed Computing System | |
US9594801B2 (en) | Systems and methods for allocating work for various types of services among nodes in a distributed computing system | |
CN107395659A (zh) | 一种业务受理及共识的方法及装置 | |
WO2018201103A1 (en) | Iterative object scanning for information lifecycle management | |
US20190243549A1 (en) | Distributed backup system | |
CN112732756B (zh) | 数据查询方法、装置、设备及存储介质 | |
US10715608B2 (en) | Automatic server cluster discovery | |
US11683316B2 (en) | Method and device for communication between microservices | |
CN111580959B (zh) | 一种数据写入方法、数据写入装置、服务器及存储介质 | |
JP2019504415A (ja) | データ格納サービス処理方法及び装置 | |
US20220103500A1 (en) | Method and device for managing group member, and method for processing group message | |
CN110798492B (zh) | 数据存储方法及装置、数据处理系统 | |
CN111475279A (zh) | 用于备份的智能数据负载平衡的系统和方法 | |
US9727457B2 (en) | Minimizing latency due to garbage collection in a distributed system | |
US11036439B2 (en) | Automated management of bundled applications | |
US10303660B2 (en) | File system with distributed entity state | |
US11947822B2 (en) | Maintaining a record data structure using page metadata of a bookkeeping page | |
CN111506790B (zh) | 抽取对象确定及数据刷新方法、系统、设备和存储介质 | |
US10908848B2 (en) | Automated management of bundled applications | |
US20240104073A1 (en) | Storage management methods and apparatuses for distributed database | |
CN114679448A (zh) | 一种资源匹配方法及装置 | |
CN117997905A (zh) | 服务端节点的调度方法、调度装置和服务端 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18932133 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18932133 Country of ref document: EP Kind code of ref document: A1 |