Certificate anti-duplication method, device, equipment and program product
By registering unique keys for vouchers in the database and calling the middleware processing service to prevent duplicate vouchers from being duplicated, the problem of insufficient accuracy in voucher duplication prevention in existing technologies is solved, and more efficient voucher processing is achieved.
Patent Information
- Application Number
- CN202510782730.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2026-01-13
AI Technical Summary
In existing technologies, database credential deduplication prevention methods are limited and difficult to adapt to database upgrades and changes, resulting in insufficient accuracy in credential deduplication prevention.
During the voucher receiving phase, the unique keys of the master order and the detail order of the voucher to be processed are obtained and registered in the voucher deduplication control table and information registration table of the target database, and duplicate detection is performed. During the voucher processing phase, the middle platform processing service is called to prevent duplicate links and ensure the accuracy of the vouchers.
It improves the accuracy of database voucher deduplication prevention. By combining single-database deduplication prevention with transaction link deduplication prevention, it enhances the efficiency and accuracy of voucher processing.
Smart Images

Figure CN121329414A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology, and in particular to a voucher duplicate prevention method, device, equipment and program product. BACKGROUND
[0002] In the database data processing process, voucher duplicate prevention is particularly important. In the prior art, a single-database duplicate prevention method is used for database voucher duplicate prevention. The database voucher duplicate prevention method is relatively single, and it is difficult to adapt to the upgrade and changes of the database, and it is difficult to ensure the accuracy of the database voucher duplicate prevention. SUMMARY
[0003] The present application provides a voucher duplicate prevention method, device, equipment and program product, which improves the accuracy of database voucher duplicate prevention.
[0004] According to an aspect of the present application, a voucher duplicate prevention method is provided, the method comprising:
[0005] In the voucher receiving stage, the voucher to be processed and the voucher duplicate control table of the target database are obtained, the main single unique key of the voucher to be processed is registered in the voucher duplicate control table of the target database, and the detail single unique key and the corresponding detail information of the voucher to be processed are registered in the voucher information registration table of the target database;
[0006] According to the voucher duplicate control table in the target database, the main single unique key of the voucher to be processed is detected for duplication;
[0007] When the main single unique key of the voucher to be processed does not exist, the voucher to be processed is stored in the warehouse;
[0008] When the click submission operation of the voucher to be processed is detected, the asynchronous processing task corresponding to the detail single unique key of the voucher to be processed is registered;
[0009] In the voucher processing stage, after the asynchronous processing task corresponding to the detail single unique key is triggered, the middle office processing service is called, the detail single unique key of the voucher to be processed is passed to the downstream middle office service, and the downstream middle office service is used to detect the detail single unique key for duplication;
[0010] When the detail single unique key of the voucher to be processed does not exist, the middle office processing service is called, and the voucher to be processed is processed according to the detail information in the voucher information registration table.
[0011] According to another aspect of the present application, a voucher duplicate prevention device is provided, the device comprising:
[0012] The voucher receiving module is configured to, in a voucher receiving stage, acquire a to-be-processed voucher and a voucher duplication control table of a target database, register a master single unique key of the to-be-processed voucher into the voucher duplication control table of the target database, and register a detail single unique key of the to-be-processed voucher and corresponding detail information into a voucher information registration table of the target database;
[0013] The single-database duplication detection module is configured to perform duplication detection on the master single unique key of the to-be-processed voucher according to the voucher duplication control table in the target database.
[0014] The voucher storage module is configured to store the to-be-processed voucher when the master single unique key of the to-be-processed voucher does not exist.
[0015] The asynchronous processing task registration module is configured to register an asynchronous processing task corresponding to the detail single unique key of the to-be-processed voucher when a click submission operation of the to-be-processed voucher is detected.
[0016] The link duplication detection module is configured to, in a voucher processing stage, after the asynchronous processing task corresponding to the detail single unique key is initiated, call a middle office processing service, pass the detail single unique key of the to-be-processed voucher to a downstream middle office service, and perform duplication detection on the detail single unique key by using the downstream middle office service.
[0017] The voucher processing module is configured to, when the detail single unique key of the to-be-processed voucher does not exist, call the middle office processing service, and process the to-be-processed voucher according to the detail information in the voucher information registration table.
[0018] According to another aspect of the present application, an electronic device is provided, which comprises:
[0019] at least one processor; and
[0020] a memory connected with the at least one processor in communication; wherein
[0021] 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 to enable the at least one processor to perform the voucher duplication prevention method according to any one of the embodiments of the present application.
[0022] According to another aspect of the present application, a computer program product is provided, which comprises a computer program, and the computer program, when executed by a processor, implements the voucher duplication prevention method according to any one of the embodiments of the present application.
[0023] The technical scheme of the embodiment of the present application, by registering the main single unique key of the to-be-processed voucher into the voucher duplication judgment control table of the target database in the voucher receiving stage, registering the detail single unique key of the to-be-processed voucher and the corresponding detail information into the voucher information registration table of the target database, performing duplication detection on the main single unique key of the to-be-processed voucher according to the voucher duplication judgment control table in the target database, and storing the to-be-processed voucher when there is no duplication of the main single unique key of the to-be-processed voucher, realizes single-database duplication prevention of the to-be-processed voucher through the voucher duplication judgment control table of the target database and the main single unique key of the to-be-processed voucher; by registering the asynchronous processing task corresponding to the detail single unique key of the to-be-processed voucher when the click submission operation of the to-be-processed voucher is detected, after the asynchronous processing task corresponding to the detail single unique key is started in the voucher processing stage, calling the middle office processing service, passing the detail single unique key of the to-be-processed voucher to the downstream middle office service, and using the downstream middle office service to perform duplication detection on the detail single unique key, when there is no duplication of the detail single unique key of the to-be-processed voucher, calling the middle office processing service to process the to-be-processed voucher according to the detail information in the voucher information registration table, on the basis of the single-database duplication prevention of the to-be-processed voucher, the transaction link duplication prevention of the to-be-processed voucher is introduced, thereby improving the accuracy of database voucher duplication prevention.
[0024] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0026] Figure 1 is a flowchart of a voucher duplication prevention method according to the first embodiment of the present application;
[0027] Figure 2 is a flowchart of a voucher duplication prevention method according to the second embodiment of the present application;
[0028] Figure 3 is a flowchart of a voucher duplication prevention method according to the third embodiment of the present application;
[0029] Figure 4 is a structural schematic diagram of a voucher duplication prevention device according to the fourth embodiment of the present application;
[0030] Figure 5Fig. 1 is a structural schematic diagram of an electronic device for implementing a voucher anti-duplication method according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the personnel in the technical field better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the present application.
[0032] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0033] Embodiment one
[0034] Figure 1 Fig. 1 is a flowchart of a voucher anti-duplication method provided for the first embodiment of the present application. The embodiments of the present application can be applicable to the case of business voucher anti-duplication, and the method can be executed by a voucher anti-duplication device, which can be realized in the form of hardware and / or software, and can be configured in an electronic device carrying a voucher anti-duplication function, such as a client or a server.
[0035] Referring to Figure 1 The voucher anti-duplication method shown includes:
[0036] S101, in the voucher receiving stage, obtaining a to-be-processed voucher and a voucher anti-duplication control table of a target database, registering a master single unique key of the to-be-processed voucher into the voucher anti-duplication control table of the target database, and registering a detail single unique key of the to-be-processed voucher and corresponding detail information into a voucher information registration table of the target database.
[0037] The voucher receiving stage can be an entry detection stage for the to-be-processed voucher. The to-be-processed voucher can be a voucher to be processed. The to-be-processed voucher can be used to initiate the to-be-processed business. The target database can be used to store information associated with the to-be-processed business corresponding to the to-be-processed voucher. For example, the target database can include a relational database or an open source relational database. The voucher duplication control table can be used to store the primary unique key of the voucher received by the target database. One target database has one voucher duplication control table. The voucher information registration table can be used to record the detail unique key of the to-be-processed voucher and the corresponding detail information. One voucher information registration table can be used to register the detail information corresponding to one detail unique key. It can be understood that one voucher information registration table corresponds to one detail single. The primary unique key can be used to uniquely identify the primary single of the to-be-processed voucher. For example, the primary unique key can be the voucher number of the to-be-processed voucher. The detail unique key can be used to uniquely identify the detail single corresponding to the primary single of the to-be-processed voucher. For example, the detail unique key can include the voucher number and the voucher detail serial number. Optionally, the primary unique key and the detail unique key can also include at least one of the business year, the administrative division, and the voucher type. The detail information can be the specific detail information of the business processing. For example, the detail information can be a single transaction detail.
[0038] In an optional embodiment of the present application, a single primary unique key corresponds to at least one detail unique key; the primary unique key includes the business year, the administrative division, the voucher type, and the voucher number; and the detail unique key includes the business year, the administrative division, the voucher type, the voucher number, and the voucher detail serial number.
[0039] The business year can be a processing year of a business corresponding to the to-be-processed voucher. The business year can distinguish the voucher from the dimension of processing time. The administrative division can be used to represent an area where a voucher initiator of the to-be-processed voucher is located. The administrative division can distinguish the voucher from the dimension of processing location. The voucher type can be used to represent a type of the to-be-processed business corresponding to the to-be-processed voucher. The voucher type can distinguish the voucher from the dimension of business type. For example, the voucher type can include financial payment or financial refund. The voucher number can be used to uniquely identify a main sheet of the to-be-processed voucher. The voucher detail serial number can be used to uniquely identify a detail sheet corresponding to the main sheet of the to-be-processed voucher. For the to-be-processed voucher with single detail information, the main sheet unique key can correspond to one detail sheet unique key. For the to-be-processed voucher with multiple detail information, the main sheet unique key can correspond to at least two detail sheet unique keys. For example, when the voucher type is financial payment, when the financial payment is one-borrow-one-lend payment, there can be one main sheet and one detail sheet; when the financial payment is one-borrow-multiple-lend payment, there can also be one main sheet and multiple detail sheets. When the financial refund is one main sheet and one detail sheet. Optionally, when the main sheet unique key corresponds to at least two detail sheet unique keys, the main sheet corresponds to the parallel relationship between the detail sheets, and the detail sheets can be processed in parallel.
[0040] The scheme specifically the main sheet unique key as the business year, the administrative division, the voucher type and the voucher number, and specifically the detail sheet unique key as the business year, the administrative division, the voucher type, the voucher number and the voucher detail serial number, introduces the business year, the administrative division and the voucher type when identifying the main sheet and the detail sheet of the to-be-processed voucher, distinguishes the to-be-processed voucher from the dimensions of processing time, processing location and business type, further improves the information of the main sheet unique key and the detail sheet unique key of the to-be-processed voucher, facilitates the anti-duplicate identification and subsequent business processing of the to-be-processed voucher, can improve the applicability and typicality of the voucher anti-duplicate, and thus improves the efficiency of the voucher anti-duplicate.
[0041] Specifically, in the voucher receiving stage, the to-be-processed voucher sent by the voucher initiator can be obtained. The voucher duplicate judgment control table stored in the target database can be obtained. The main sheet unique key of the to-be-processed voucher can be registered in the voucher duplicate judgment control table of the target database, and the detail sheet unique key and the corresponding detail information of the to-be-processed voucher can be registered in the voucher information registration table of the target database.
[0042] S102, according to the voucher duplicate judgment control table in the target database, the main sheet unique key of the to-be-processed voucher is detected for duplication.
[0043] Specifically, the master unique key of the to-be-processed voucher can be compared with other master unique keys in the voucher duplication control table in the target database. If there is a master unique key in the voucher duplication control table in the target database that is consistent with the master unique key of the to-be-processed voucher, the master unique key of the to-be-processed voucher is duplicated. If there is no master unique key in the voucher duplication control table in the target database that is consistent with the master unique key of the to-be-processed voucher, the master unique key of the to-be-processed voucher is not duplicated.
[0044] S103, when the master unique key of the to-be-processed voucher is not duplicated, the to-be-processed voucher is warehoused.
[0045] The master unique key of the to-be-processed voucher being duplicated can be understood as the single-bank duplication detection result of the to-be-processed voucher being duplicated. The master unique key of the to-be-processed voucher not being duplicated can be understood as the single-bank duplication detection result of the to-be-processed voucher not being duplicated.
[0046] Specifically, when the master unique key of the to-be-processed voucher is not duplicated, the to-be-processed voucher can be warehoused. Optionally, when the to-be-processed voucher is warehoused, the detail state of the to-be-processed voucher can be changed to to-be-processed.
[0047] Optionally, when the master unique key of the to-be-processed voucher is duplicated, the master unique key of the to-be-processed voucher can be removed from the voucher duplication control table, and the detail unique key of the to-be-processed voucher and the corresponding detail information can be removed from the voucher information registration table.
[0048] Optionally, after the to-be-processed voucher is warehoused, before the voucher is processed, if it is detected that the to-be-processed voucher fails to be registered in the voucher detail registration table, all the detail information of the to-be-processed voucher can be rolled back, and a receipt failure can be returned. The reason why the to-be-processed voucher fails to be registered in the voucher detail registration table can include that the field type does not match or the field length exceeds the preset field length in the voucher detail registration table. Optionally, all the detail information of a single to-be-processed voucher can have a preset upper limit value of the number of details. For example, the preset upper limit value of the number of details can be 2000.
[0049] S104, when a click submission operation of the to-be-processed voucher is detected, an asynchronous processing task corresponding to the detail unique key of the to-be-processed voucher is registered.
[0050] The click submission operation can be used to click submit the to-be-processed voucher, so that the to-be-processed voucher enters the subsequent processing process. For example, the to-be-processed voucher can be a to-be-paid voucher; accordingly, the click submission operation can be initiated by a teller. The asynchronous processing task can be an asynchronous to-be-processed task corresponding to the to-be-processed voucher. One detail unique key corresponds to one asynchronous processing task.
[0051] Specifically, when detecting the click submission operation of the to-be-processed voucher, the asynchronous processing task corresponding to the unique key of the voucher detail of the to-be-processed voucher can be registered.
[0052] Optionally, when detecting the click submission operation of the to-be-processed voucher, the voucher detail state corresponding to the unique key of the voucher detail of the to-be-processed voucher can be updated from to-be-processed to to-be-paid.
[0053] Optionally, when detecting the click submission operation of the to-be-processed voucher, the asynchronous processing task corresponding to the unique key of the voucher detail of the to-be-processed voucher can be registered through a database lock to avoid repeated submission of the asynchronous processing task corresponding to the unique key of the voucher detail of the to-be-processed voucher.
[0054] S105, in the voucher processing phase, after the asynchronous processing task corresponding to the unique key of the voucher detail is initiated, the middle platform processing service is called, the unique key of the voucher detail of the to-be-processed voucher is passed to the downstream middle platform service, and the downstream middle platform service is used to detect the uniqueness of the unique key of the voucher detail.
[0055] The voucher processing phase can be a phase for processing the to-be-processed voucher. The middle platform processing service can be used to pass the unique key of the voucher detail to the downstream middle platform application and process the to-be-processed voucher. The downstream middle platform service can be used to detect the uniqueness of the unique key of the voucher detail. Optionally, the period of the anti-duplication mechanism of the downstream middle platform service can be 7 days.
[0056] Specifically, in the voucher processing phase, after the asynchronous processing task corresponding to the unique key of the voucher detail is initiated, the middle platform processing service can be called to pass the unique key of the voucher detail of the to-be-processed voucher to the downstream middle platform service. The downstream middle platform service can be used to detect whether there is the same unique key of the voucher detail in the processing or processed asynchronous processing task. If it is detected that there is the same unique key of the voucher detail in the processing or processed asynchronous processing task, it is determined that the unique key of the voucher detail of the to-be-processed voucher is duplicated. If it is detected that there is no same unique key of the voucher detail in the processing or processed asynchronous processing task, it is determined that the unique key of the voucher detail of the to-be-processed voucher is not duplicated. Optionally, when the unique key of the voucher detail of the to-be-processed voucher is duplicated, the to-be-processed voucher is not processed.
[0057] Optionally, in the voucher processing phase, after the asynchronous processing task corresponding to the unique key of the voucher detail is initiated, the database lock can be obtained by updating the voucher detail state corresponding to the unique key of the voucher detail of the to-be-processed voucher to prevent duplication of the asynchronous processing task.
[0058] Optionally, in the credential processing stage, after the asynchronous processing task corresponding to the invoice unique key is initiated, the voucher detail state corresponding to the invoice unique key of the to-be-processed voucher can be updated to processing. For example, the voucher detail state corresponding to the invoice unique key of the to-be-processed voucher can be updated to payment in progress when it is detected that the voucher detail state corresponding to the invoice unique key of the to-be-processed voucher is to be paid and the business anti-duplicate key of the processing task is the invoice unique key. For example, "set state = payment in progress when state = to be paid and business anti-duplicate key = invoice unique key" can be used.
[0059] Optionally, if the update of the voucher detail state corresponding to the invoice unique key of the to-be-processed voucher is successful, the processing continues, and a business detail is registered in the processing detail table. If the update of the voucher detail state corresponding to the invoice unique key of the to-be-processed voucher fails, manual exception processing is landed.
[0060] S106, when the invoice unique key of the to-be-processed voucher does not exist, a middle office processing service is called to process the to-be-processed voucher according to the detail information in the voucher information registration table.
[0061] The invoice unique key of the to-be-processed voucher does not exist can be understood as that the downstream middle office application has not processed the asynchronous processing task corresponding to the invoice unique key of the to-be-processed voucher.
[0062] Specifically, when the invoice unique key of the to-be-processed voucher does not exist, the middle office processing service can be called to process the asynchronous processing task corresponding to the invoice unique key of the to-be-processed voucher according to the detail information in the voucher information registration table. For example, the middle office processing service can be called in the order of advance payment->payment (->payment failure->reverse advance payment) to complete the payment. Optionally, if the middle office processing service fails to process the asynchronous processing task corresponding to the invoice unique key of the to-be-processed voucher, it is collected for manual processing.
[0063] The technical scheme of the embodiment of the present application, by registering the main single unique key of the to-be-processed voucher into the voucher duplication judgment control table of the target database, registering the detail single unique key and the corresponding detail information of the to-be-processed voucher into the voucher information registration table of the target database, performing the duplication detection on the main single unique key of the to-be-processed voucher according to the voucher duplication judgment control table in the target database, and storing the to-be-processed voucher when there is no duplication of the main single unique key of the to-be-processed voucher, realizes the single-database duplication prevention of the to-be-processed voucher through the voucher duplication judgment control table of the target database and the main single unique key of the to-be-processed voucher; by registering the asynchronous processing task corresponding to the detail single unique key of the to-be-processed voucher when the click submission operation of the to-be-processed voucher is detected, after the asynchronous processing task corresponding to the detail single unique key is started in the voucher processing stage, calling the middle office processing service, passing the detail single unique key of the to-be-processed voucher to the downstream middle office service, and using the downstream middle office service to perform the duplication detection on the detail single unique key, calling the middle office processing service to process the to-be-processed voucher according to the detail information in the voucher information registration table when there is no duplication of the detail single unique key of the to-be-processed voucher, introduces the transaction link duplication prevention of the to-be-processed voucher on the basis of the single-database duplication prevention of the to-be-processed voucher, thereby improving the accuracy of the database voucher duplication prevention.
[0064] In an optional embodiment of the present application, the target database includes at least two alternative database shards; each alternative database shard has a corresponding alternative voucher duplication judgment control table and an alternative voucher information registration table; accordingly, registering the main single unique key of the to-be-processed voucher into the voucher duplication judgment control table of the target database, and registering the detail single unique key and the corresponding detail information of the to-be-processed voucher into the voucher information registration table, include: screening the target database shard from the alternative database shards according to the administrative division of the main single unique key of the to-be-processed voucher; registering the main single unique key of the to-be-processed voucher into the target voucher duplication judgment control table of the target database shard; and registering the detail single unique key and the corresponding detail information of the to-be-processed voucher into the target voucher information registration table of the target database shard; accordingly, performing the duplication detection on the main single unique key of the to-be-processed voucher according to the voucher duplication judgment control table in the target database, includes: performing the duplication detection on the main single unique key of the to-be-processed voucher according to the target voucher duplication judgment control table in the target database shard.
[0065] The alternative database shards can be data shards of the target database. Optionally, the target database can be data-sharded according to administrative divisions to obtain at least two alternative database shards. The alternative credential duplication judgment control table can be a credential duplication judgment control table corresponding to the alternative database shard. The alternative credential information registration table can be a credential information registration table corresponding to the alternative database shard. The target database shard can be an alternative database shard corresponding to the administrative division of the master single unique key of the to-be-processed credential. The target credential duplication judgment control table can be a credential duplication judgment control table corresponding to the target database shard. The target credential information registration table can be a credential information registration table corresponding to the target database shard.
[0066] Specifically, according to the administrative division of the master single unique key of the to-be-processed credential, the target database shard corresponding to the administrative division can be screened from the alternative database shards. The master single unique key of the to-be-processed credential can be registered in the target credential duplication judgment control table of the target database shard, and the detail single unique key and the corresponding detail information of the to-be-processed credential can be registered in the target credential information registration table of the target database shard. Accordingly, the master single unique key of the to-be-processed credential can be compared with other master single unique keys in the target credential duplication judgment control table in the target database shard. If there is another master single unique key consistent with the master single unique key of the to-be-processed credential in the target credential duplication judgment control table in the target database shard, the master single unique key of the to-be-processed credential is duplicated. If there is no other master single unique key consistent with the master single unique key of the to-be-processed credential in the target credential duplication judgment control table in the target database shard, the master single unique key of the to-be-processed credential is not duplicated.
[0067] The present scheme shards the target database according to administrative divisions to obtain alternative database shards corresponding to different administrative divisions. Due to the difference between the administrative divisions, there is no master single unique key with the same administrative division between the alternative database shards. Thus, the independence of the target credential duplication judgment control tables corresponding to the alternative database shards is ensured, and the business duplication prevention capability in each alternative database shard of the target database and the low coupling of credential duplication prevention between the database shards are realized.
[0068] In an optional embodiment of the present application, the target database includes at least two alternative database shards; each alternative database shard has a corresponding alternative business duplication prevention table; accordingly, the method further includes: in the credential receiving stage, obtaining the business unique key of the to-be-processed credential, and screening the target database shard from the alternative database shards according to the administrative division of the business unique key of the to-be-processed credential; registering the business unique key of the to-be-processed credential in the target business duplication prevention table of the target database shard; and performing duplication detection on the business unique key of the to-be-processed credential according to the target business duplication prevention table in the target database shard.
[0069] Optionally, after the target database is data-sharded by administrative division, a business anti-duplication table can be added in each candidate database shard of the target database. The business anti-duplication table can be used to store the business unique key associated with each candidate database shard. The business unique key can be used to identify the detail sheet corresponding to the main sheet of the to-be-processed voucher and the processing status of the detail sheet. For example, the business unique key can include business year, administrative division, voucher type, voucher number, voucher detail serial number, and voucher detail status. A single to-be-processed voucher can correspond to at least one business unique key. The candidate business anti-duplication table can be the business anti-duplication table corresponding to the candidate database shard. The target business anti-duplication table can be the business anti-duplication table corresponding to the target database shard.
[0070] Specifically, in the voucher receiving stage, a to-be-processed voucher sent by a voucher initiator can be obtained. Based on the to-be-processed voucher, the business unique key of the to-be-processed voucher can be determined. According to the administrative division of the business unique key of the to-be-processed voucher, the target database shard corresponding to the administrative division can be screened from each candidate database shard. The business unique key of the to-be-processed voucher can be registered in the target business anti-duplication table of the target database shard. The business unique key of the to-be-processed voucher can be compared with other business unique keys in the target business anti-duplication table in the target database shard. If there is a business unique key consistent with the business unique key of the to-be-processed voucher in the target business anti-duplication table in the target database shard, the business unique key of the to-be-processed voucher is duplicated. If there is no business unique key consistent with the business unique key of the to-be-processed voucher in the target business anti-duplication table in the target database shard, the business unique key of the to-be-processed voucher is not duplicated.
[0071] The present scheme adds a target business anti-duplication table in the target database shard, shards the target database by administrative division, and obtains candidate database shards corresponding to different administrative divisions. Due to the difference of administrative divisions, there is no business unique key with the same administrative division between each candidate database shard. Thus, the independence of the target business anti-duplication table corresponding to each candidate database shard is ensured, the decoupling between the target database shard and the original target database is achieved, the business anti-duplication capability in the target database shard is achieved, and the anti-duplication capability optimization of the target database is improved.
[0072] Embodiment Two
[0073] Figure 2A flowchart of a voucher duplicate prevention method provided for the second embodiment of the present application. The second embodiment of the present application further increases, on the basis of the above-mentioned embodiment, after the to-be-processed voucher is warehoused, “calling a global duplicate prevention service of the original database; through the global duplicate prevention service of the original database, according to the inventory duplicate prevention control table and the synchronization duplicate prevention control table of the original database, performing duplicate detection on the main single unique key of the to-be-processed voucher; when the main single unique key of the to-be-processed voucher exists duplication, rejecting processing of the to-be-processed voucher; when the main single unique key of the to-be-processed voucher does not exist duplication, continuing processing of the to-be-processed voucher”, avoiding the influence of database switching on the accuracy of the voucher duplicate prevention, and further improving the accuracy of the voucher duplicate prevention. It should be noted that the parts not described in detail in the second embodiment of the present application can refer to the descriptions of other embodiments.
[0074] Referring to Figure 2 The voucher duplicate prevention method shown in the figure comprises:
[0075] S201, in the voucher receiving stage, obtaining a to-be-processed voucher and a voucher duplicate judgment control table of a target database, registering the main single unique key of the to-be-processed voucher into the voucher duplicate judgment control table of the target database, and registering the detail single unique key and the corresponding detail information of the to-be-processed voucher into the voucher information registration table of the target database.
[0076] S203, according to the voucher duplicate judgment control table in the target database, performing duplicate detection on the main single unique key of the to-be-processed voucher.
[0077] S203, when the main single unique key of the to-be-processed voucher does not exist duplication, warehousing the to-be-processed voucher.
[0078] S204, calling a global duplicate prevention service of the original database.
[0079] The original database can be the database before the database switching. During the database switching, cross-database duplicate prevention will be involved. For example, during the Xinyuan upgrade, the original database can be the O database, and the target database can be the M database. Before the database switching, the business processing is in the original database (i.e., the O database); after the database switching is completed, the business processing is in the target database (i.e., the M database). During the Xinyuan upgrade process, the cross-database duplicate prevention mechanism can be used to perform cross-database duplicate prevention on the to-be-processed voucher. After the database switching is completed, when the target database (i.e., the M database) occurs an extreme situation (for example, a failure), the target database (i.e., the M database) needs to be switched back to the original database (i.e., the O database). Thus, the cross-database duplicate prevention between the target database (i.e., the M database) and the original database (i.e., the O database) will also be involved. In addition, in the case that the voucher initiator repeatedly issues the to-be-processed voucher, the cross-database duplicate prevention mechanism can be used. The global duplicate prevention service can be used to perform cross-database duplicate prevention on the to-be-processed voucher.
[0080] Optionally, after the full transaction of the database after switching and the stability of the transaction, the call of the database before switching can be disconnected through a technical switch. It can be understood that the full transaction of the database after switching and the stability of the transaction are closing conditions of cross-database duplicate prevention. For example, the plan of starting the target database (i.e., the M database) is completed in November 2024. Because the business year of the original database (i.e., the O database) is still 2024, that is, the target database (i.e., the M database) is started from January 1, 2025, at this time, the business year of the target database (i.e., the M database) is not 2024. The cross-database duplicate prevention mechanism needs to be adopted in December 2024. Because the target database (i.e., the M database) is started from January 1, 2025, the target database (i.e., the M database) cannot have the business duplication of the original database (i.e., the O database), so the cross-database duplicate prevention mechanism can be disconnected. It can be understood that the database switching can have been completed in a certain month, but because the main single unique key of the to-be-processed voucher has a business year, the cross-database duplicate prevention mechanism needs to be closed in the next business year. Because for the next business year, the database after switching is completely adopted, the cross-database duplicate prevention can be closed.
[0081] S205, through the full duplicate prevention service of the original database, the main single unique key of the to-be-processed voucher is detected for duplication according to the inventory duplicate prevention control table and the synchronization duplicate prevention control table of the original database.
[0082] The inventory duplicate prevention control table can be used to record the main single unique key processed by the original database. The synchronization duplicate prevention control table can be used to record the main single unique key processed by the newly added target database. The inventory duplicate prevention control table and the synchronization duplicate prevention control table are stored in the original database.
[0083] Specifically, through the full duplicate prevention service of the original database, the main single unique key of the to-be-processed voucher can be compared with other main single unique keys in the inventory duplicate prevention control table and the synchronization duplicate prevention control table of the original database. If there is another main single unique key consistent with the main single unique key of the to-be-processed voucher in the inventory duplicate prevention control table and the synchronization duplicate prevention control table of the original database, the main single unique key of the to-be-processed voucher is duplicated. If there is no other main single unique key consistent with the main single unique key of the to-be-processed voucher in the inventory duplicate prevention control table and the synchronization duplicate prevention control table of the original database, the main single unique key of the to-be-processed voucher is not duplicated.
[0084] In an optional embodiment of the present application, before the main single unique key of the to-be-processed voucher is detected for duplication through the full duplicate prevention service of the original database according to the inventory duplicate prevention control table and the synchronization duplicate prevention control table of the original database, it further includes: synchronizing the voucher duplicate prevention control table and the voucher information registration table of the target database through the full duplicate prevention service of the original database, to generate the synchronization duplicate prevention control table of the original database.
[0085] The original database's synchronization anti-duplicate control table can include the newly added voucher deduplication control table and voucher information registration table of the target database. Optionally, the target database can have multiple alternative database shards. The original database's synchronization anti-duplicate control table includes the voucher deduplication control table and voucher information registration table for each alternative database shard. This can be understood as the original database's synchronization anti-duplicate control table being used to summarize the target database's voucher deduplication control table and voucher information registration table.
[0086] This solution synchronizes the voucher deduplication control table and voucher information registration table in the target database through the global anti-duplicate service of the original database, generating a synchronized anti-duplicate control table in the original database. This achieves data synchronization from the target database to the original database, improves the accuracy of the synchronized anti-duplicate control table in the original database, and thus improves the accuracy of cross-database anti-duplicate protection of the target database by the global anti-duplicate service of the original database.
[0087] S206. If the unique key of the master document of the pending document is duplicated, the pending document shall be rejected.
[0088] If the unique key of the master order of the pending voucher is duplicated, it can be understood that the cross-database deduplication detection result of the pending voucher is duplicated.
[0089] Specifically, if there is a duplicate unique key in the master document of the pending document, the pending document can be rejected, that is, it will not be processed.
[0090] S207. If the unique key of the master document of the pending document does not have duplicates, continue processing the pending document.
[0091] The fact that the unique key of the primary document of the pending document is not duplicated can be understood as the cross-database deduplication detection result of the pending document being non-duplicate.
[0092] Specifically, if there is no duplicate unique key in the master order of the pending voucher, the pending voucher can continue to be processed, that is, the pending voucher can be processed subsequently.
[0093] Optionally, the master unique key of the voucher to be processed can be stored in the synchronous anti-duplicate control table of the original database.
[0094] S208. When a submit operation is detected for a pending voucher, register the asynchronous processing task corresponding to the unique key of the pending voucher's details.
[0095] S209. During the voucher processing stage, after the asynchronous processing task corresponding to the unique key of the detail voucher is initiated, the middle platform processing service is called to pass the unique key of the detail voucher to be processed to the downstream middle platform service, and the downstream middle platform service is used to perform duplicate detection on the unique key of the detail voucher.
[0096] S210, when the primary single unique key of the to-be-processed voucher does not exist in the duplicate, calling a middle office processing service, processing the to-be-processed voucher according to the detail information in the voucher information registration table.
[0097] Since the data synchronization has a second-level delay anti-redundancy gap, it cannot guarantee that the two databases are completely synchronized, and therefore end-to-end anti-redundancy, i.e., transaction link anti-redundancy, can be used. It can be understood that, since the data synchronization has a second-level delay, it will cause that, although the data synchronization between the original database and the target database is performed, the two databases can not be completely the same. That is, within a second, if two to-be-processed vouchers with the same primary single unique key are respectively sent to the target database (M database) and the original database (O database), at this time, end-to-end anti-redundancy can be used for bottom protection.
[0098] For example, the performance capacity evaluation of the global anti-redundancy service of the original database is as follows: the target database (i.e., the M database) has a total of 32 nodes, the asynchronous processing task concurrent upper limit is 10, the average processing time of twice payment processing is 2.5 seconds, and the current business maximum concurrency is 217 / second; the original database (i.e., the O database) has a total of 4 nodes, the average time consumption of the voucher anti-redundancy of the global anti-redundancy service of the original database is less than 100 ms, and the evaluation concurrent upper limit is 10.
[0099] The technical scheme of the embodiment of the application, by calling the global anti-redundancy service of the original database, through the global anti-redundancy service of the original database, according to the inventory anti-redundancy control table and the synchronization anti-redundancy control table of the original database, the primary single unique key of the to-be-processed voucher is detected for duplication, when the primary single unique key of the to-be-processed voucher exists in duplication, the to-be-processed voucher is rejected, when the primary single unique key of the to-be-processed voucher does not exist in duplication, the to-be-processed voucher is continued to be processed, through the global anti-redundancy service of the original database, the inventory anti-redundancy control table and the synchronization anti-redundancy control table of the original database, cross-database anti-redundancy of the to-be-processed voucher received by the target database is realized, the global anti-redundancy service of the original database supports anti-hanging, the influence of database switching on the accuracy of voucher anti-redundancy is avoided, and the accuracy of voucher anti-redundancy is further improved.
[0100] Optionally, when the voucher is received by the original database, the primary single unique key of the to-be-processed voucher can also be detected for duplication according to the inventory anti-redundancy control table and the synchronization anti-redundancy control table of the original database before the voucher is processed in the original database. Thus, the full-database anti-redundancy of the original database is realized.
[0101] Optionally, after the global anti-redundancy service of the original database abnormally causes a transaction to fail, manual processing is performed, and the to-be-processed voucher can be returned or re-paid. Thus, the influence of the global anti-redundancy service of the original database on the outside can be minimized.
[0102] Optionally, if the target database (i.e. M database) processing fails, the original database (i.e. O database) synchronization anti-duplicate control table can be deleted. Thus, the transaction consistency between the target database and the original database can be ensured.
[0103] Embodiment Three
[0104] Figure 3 A flowchart of a voucher anti-duplicate method provided for the third embodiment of the present application. The third embodiment of the present application further adds, on the basis of the above-mentioned embodiments, after the to-be-processed voucher is warehoused, “calling a business anti-duplicate service of the original database; detecting, by the business anti-duplicate service of the original database, a voucher detail state corresponding to the detail single unique key of the to-be-processed voucher according to a transaction detail table of the original database; when the voucher detail state corresponding to the detail single unique key of the to-be-processed voucher is in processing or has been processed, rejecting the transaction of the to-be-processed voucher; and when the voucher detail state corresponding to the detail single unique key of the to-be-processed voucher is not in processing or has not been processed, continuing the transaction of the to-be-processed voucher”, which avoids the influence of database switching on the accuracy of the voucher anti-duplicate, and further improves the accuracy of the voucher anti-duplicate. It should be noted that the parts not described in detail in the third embodiment of the present application can be referred to the descriptions of other embodiments.
[0105] Referring to Figure 3 The voucher anti-duplicate method shown in the figure comprises:
[0106] S301, in the voucher receiving stage, obtaining a to-be-processed voucher and a voucher anti-duplicate control table of a target database, registering the master single unique key of the to-be-processed voucher into the voucher anti-duplicate control table of the target database, and registering the detail single unique key and the corresponding detail information of the to-be-processed voucher into a voucher information registration table of the target database.
[0107] S302, detecting the master single unique key of the to-be-processed voucher for duplication according to the voucher anti-duplicate control table in the target database.
[0108] S303, when the master single unique key of the to-be-processed voucher does not exist in duplication, warehousing the to-be-processed voucher.
[0109] S304, calling a business anti-duplicate service of the original database.
[0110] The business anti-duplicate service can also be used for cross-database anti-duplicate of the to-be-processed voucher.
[0111] S305, detecting, by the business anti-duplicate service of the original database, a voucher detail state corresponding to the detail single unique key of the to-be-processed voucher according to a transaction detail table of the original database.
[0112] The transaction detail table of the original database can be used to record the business unique key of the original database and the target database. The business unique key includes the detail order unique key of the processed voucher of the original database and the target database and the corresponding voucher detail state. The voucher detail state can be used to represent the processing state of the detail order corresponding to the detail order unique key. For example, the voucher detail state can include to be processed, processing, and processed.
[0113] Specifically, by the business anti-duplication service of the original database, the voucher detail state corresponding to the detail order unique key of the to-be-processed voucher in the transaction detail table of the original database is compared.
[0114] Optionally, before detecting the voucher detail state corresponding to the detail order unique key of the to-be-processed voucher according to the transaction detail table of the original database by the business anti-duplication service of the original database, the method further includes: synchronizing the transaction detail table of the target database by the business anti-duplication service of the original database to generate the transaction detail table of the original database.
[0115] The transaction detail table of the original database can include the transaction detail table of the original database and the newly added target database. Optionally, the target database can have multiple alternative database shards. The transaction detail table of the original database includes the transaction detail table of each alternative database shard of the original database and the target database. It can be understood that the transaction detail table of the original database can be used to aggregate the transaction detail table of the target database.
[0116] By the business anti-duplication service of the original database, the transaction detail table of the original database and the target database is synchronized to generate the synchronization anti-duplication control table of the original database, which realizes the data synchronization from the target database to the original database, improves the accuracy of the transaction detail table in the original database, and thus improves the accuracy of the cross-database anti-duplication of the business anti-duplication service of the original database to the target database.
[0117] S306、In the voucher detail state of the detail order unique key of the to-be-processed voucher is in processing or has been processed, the to-be-processed voucher is rejected for transaction.
[0118] When the voucher detail state of the detail order unique key of the to-be-processed voucher is in processing or has been processed, it can be understood that the target database or the original database has processed the detail order corresponding to the detail order unique key of the to-be-processed voucher.
[0119] Specifically, when the voucher detail state of the detail order unique key of the to-be-processed voucher is in processing or has been processed, the to-be-processed voucher is rejected for transaction, that is, the to-be-processed voucher is not processed.
[0120] S307, when the voucher detail state of the voucher detail unique key of the to-be-processed voucher is not in processing or has been processed, continuing transaction of the to-be-processed voucher.
[0121] The voucher detail state of the voucher detail unique key of the to-be-processed voucher is not in processing or has been processed, which can be understood as that the target database or the original database does not process the voucher detail corresponding to the voucher detail unique key of the to-be-processed voucher.
[0122] Specifically, when the voucher detail state of the voucher detail unique key of the to-be-processed voucher is not in processing or has been processed, the transaction of the to-be-processed voucher is continued, that is, the to-be-processed voucher is processed subsequently.
[0123] S308, when the click submission operation of the to-be-processed voucher is detected, registering an asynchronous processing task corresponding to the voucher detail unique key of the to-be-processed voucher.
[0124] S309, in the voucher processing stage, after the asynchronous processing task corresponding to the voucher detail unique key is started, calling the middle office processing service, passing the voucher detail unique key of the to-be-processed voucher to the downstream middle office service, and using the downstream middle office service to detect the voucher detail unique key repeatedly.
[0125] S310, when the voucher detail unique key of the to-be-processed voucher does not exist repeatedly, calling the middle office processing service, and processing the to-be-processed voucher according to the voucher information in the voucher information registration table.
[0126] For example, the performance capacity evaluation of the business anti-repetition service of the original database is as follows: the target database (namely, M database) has a total of 32 nodes, the upper limit of asynchronous processing task concurrency is 10, the average processing time of twice payment processing is 2.5 seconds, and the current business maximum concurrency is 217 per second; the original database (namely, O database) has a total of 4 nodes, the average time consumption of the voucher anti-repetition of the business anti-repetition service of the original database is less than 100 ms, and the evaluation upper limit of concurrency is 10.
[0127] The technical scheme of the embodiment of the application, by calling the business anti-repetition service of the original database, detecting the voucher detail state corresponding to the voucher detail unique key of the to-be-processed voucher according to the transaction detail table of the original database, rejecting the transaction of the to-be-processed voucher when the voucher detail state of the voucher detail unique key of the to-be-processed voucher is in processing or has been processed, continuing the transaction of the to-be-processed voucher when the voucher detail state of the voucher detail unique key of the to-be-processed voucher is not in processing or has been processed, realizing the cross-database anti-repetition of the to-be-processed voucher received by the target database through the global anti-repetition service of the original database, the inventory anti-repetition control table and the synchronous anti-repetition control table of the original database, supporting the anti-hanging of the global anti-repetition service of the original database, avoiding the influence of database switching on the accuracy of voucher anti-repetition, and further improving the accuracy of voucher anti-repetition.
[0128] Optionally, when receiving the voucher from the original database, before processing the voucher in the original database, the main single unique key of the to-be-processed voucher can also be detected for duplication according to the business duplication prevention table of the original database. Thus, full-amount single database duplication prevention of the original database is realized.
[0129] Embodiment Four
[0130] Figure 4 A structural schematic diagram of a voucher duplication prevention device provided for Embodiment Four of the present application. Embodiments of the present application can be applicable to the case of business voucher duplication prevention. The device can execute a voucher duplication prevention method. The device can be realized in the form of hardware and / or software. The device can be configured in an electronic device carrying a voucher duplication prevention function, such as a client or a server.
[0131] Referring to Figure 4 The voucher duplication prevention device shown in the figure comprises a voucher receiving module 401, a single database duplication detection module 402, a voucher warehousing module 403, an asynchronous processing task registration module 404, a link duplication detection module 405, and a voucher processing module 406. The voucher receiving module 401 is configured to, in the voucher receiving stage, acquire a to-be-processed voucher and a voucher duplication prevention control table of a target database, register the main single unique key of the to-be-processed voucher into the voucher duplication prevention control table of the target database, and register the detail single unique key of the to-be-processed voucher and the corresponding detail information into the voucher information registration table of the target database. The single database duplication detection module 402 is configured to detect the main single unique key of the to-be-processed voucher for duplication according to the voucher duplication prevention control table in the target database. The voucher warehousing module 403 is configured to, when the main single unique key of the to-be-processed voucher does not exist, store the to-be-processed voucher. The asynchronous processing task registration module 404 is configured to, when detecting a click submission operation of the to-be-processed voucher, register the asynchronous processing task corresponding to the detail single unique key of the to-be-processed voucher. The link duplication detection module 405 is configured to, in the voucher processing stage, after the asynchronous processing task corresponding to the detail single unique key is initiated, call a middle office processing service, pass the detail single unique key of the to-be-processed voucher to a downstream middle office service, and detect the detail single unique key for duplication by using the downstream middle office service. The voucher processing module 406 is configured to, when the detail single unique key of the to-be-processed voucher does not exist, call the middle office processing service, and process the to-be-processed voucher according to the detail information in the voucher information registration table.
[0132] The technical scheme of the embodiment of the application comprises the following steps: in a voucher receiving stage, a main single unique key of a to-be-processed voucher is registered into a voucher duplication judgment control table of a target database, and a detail single unique key and corresponding detail information of the to-be-processed voucher are registered into a voucher information registration table of the target database; the main single unique key of the to-be-processed voucher is repeatedly detected according to the voucher duplication judgment control table in the target database; when the main single unique key of the to-be-processed voucher does not exist repeatedly, the to-be-processed voucher is stored; through the voucher duplication judgment control table of the target database and the main single unique key of the to-be-processed voucher, single-database duplication prevention of the to-be-processed voucher is realized; when a click submission operation of the to-be-processed voucher is detected, an asynchronous processing task corresponding to the detail single unique key of the to-be-processed voucher is registered; in a voucher processing stage, after the asynchronous processing task corresponding to the detail single unique key is started, a middle office processing service is called, the detail single unique key of the to-be-processed voucher is transmitted to a downstream middle office service, and the downstream middle office service is used to repeatedly detect the detail single unique key; when the detail single unique key of the to-be-processed voucher does not exist repeatedly, the middle office processing service is called, and the to-be-processed voucher is processed according to the detail information in the voucher information registration table; on the basis of the single-database duplication prevention of the to-be-processed voucher, transaction link duplication prevention of the to-be-processed voucher is introduced, so that the accuracy of database voucher duplication prevention is improved.
[0133] In an optional embodiment of the application, the device further comprises: a global duplication prevention service calling module, configured to call a global duplication prevention service of an original database after the to-be-processed voucher is stored; a first cross-database duplication prevention module, configured to repeatedly detect the main single unique key of the to-be-processed voucher according to an inventory duplication prevention control table and a synchronization duplication prevention control table of the original database through the global duplication prevention service of the original database; a first voucher rejection processing module, configured to reject processing of the to-be-processed voucher when the main single unique key of the to-be-processed voucher exists repeatedly; and a first voucher continuous processing module, configured to continuously process the to-be-processed voucher when the main single unique key of the to-be-processed voucher does not exist repeatedly.
[0134] In an optional embodiment of the application, the device further comprises: a first data synchronization module, configured to synchronize the voucher duplication judgment control table and the voucher information registration table of the target database through the global duplication prevention service of the original database before repeatedly detecting the main single unique key of the to-be-processed voucher according to the inventory duplication prevention control table and the synchronization duplication prevention control table of the original database through the global duplication prevention service of the original database, and generating the synchronization duplication prevention control table of the original database.
[0135] In an optional embodiment of the present application, the device further comprises: a service anti-duplication service calling module, configured to call a service anti-duplication service of the original database after the to-be-processed voucher is stored; a second cross-database anti-duplication module, configured to detect a voucher detail state corresponding to the unique key of the detail sheet of the to-be-processed voucher according to a transaction detail table of the original database through the service anti-duplication service of the original database; a second voucher rejection processing module, configured to reject the transaction of the to-be-processed voucher when the voucher detail state of the unique key of the detail sheet of the to-be-processed voucher is in processing or has been processed; and a second voucher continuous processing module, configured to continue the transaction of the to-be-processed voucher when the voucher detail state of the unique key of the detail sheet of the to-be-processed voucher is not in processing or has been processed.
[0136] In an optional embodiment of the present application, the target database comprises at least two alternative database shards; each of the alternative database shards has a corresponding alternative voucher anti-duplication control table; correspondingly, the voucher receiving module 401 comprises: a target database shard screening unit, configured to screen a target database shard from the alternative database shards according to the administrative division of the unique key of the main sheet of the to-be-processed voucher; a main sheet unique key registration unit, configured to register the unique key of the main sheet of the to-be-processed voucher into the target voucher anti-duplication control table of the target database shard; and a detail sheet unique key registration unit, configured to register the unique key of the detail sheet of the to-be-processed voucher and the corresponding detail information into the target voucher information registration table of the target database shard; and correspondingly, the single-database anti-duplication detection module 402 comprises: a single-database anti-duplication detection unit, configured to perform repeated detection on the unique key of the main sheet of the to-be-processed voucher according to the target voucher anti-duplication control table in the target database shard.
[0137] In an optional embodiment of the present application, the target database comprises at least two alternative database shards; each of the alternative database shards has a corresponding alternative service anti-duplication table; correspondingly, the device further comprises: a service unique key obtaining module, configured to obtain the service unique key of the to-be-processed voucher in the voucher receiving stage, and screen a target database shard from the alternative database shards according to the administrative division of the service unique key of the to-be-processed voucher; a service unique key registration module, configured to register the service unique key of the to-be-processed voucher into the target service anti-duplication table of the target database shard; and a single-database anti-duplication module, configured to perform repeated detection on the service unique key of the to-be-processed voucher according to the target service anti-duplication table in the target database shard.
[0138] In an alternative embodiment of the present application, the single main single unique key corresponds to at least one detailed single unique key; the main single unique key comprises business year, administrative division, certificate type and certificate number; and the detailed single unique key comprises business year, administrative division, certificate type, certificate number and certificate detail serial number.
[0139] The certificate duplication prevention device provided by the embodiments of the present application can execute the certificate duplication prevention method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0140] In the technical solution of the embodiments of the present application, the collected information is information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with relevant laws, regulations and standards of the country and region, necessary security measures are taken, public order and good customs are not violated, and corresponding operation portals are provided for the user to select authorization or refusal.
[0141] Embodiment five
[0142] According to the embodiments of the present application, the present application further provides an electronic device, a readable storage medium and a computer program product.
[0143] Figure 5 A structural schematic diagram of an electronic device 500 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.
[0144] As Figure 5As shown, the electronic device 500 includes at least one processor 501, and a memory, such as a read-only memory (ROM) 502, a random access memory (RAM) 503, etc., connected to the at least one processor 501 in communication. The memory stores computer programs executable by the at least one processor. The processor 501 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 502 or loaded into the random access memory (RAM) 503 from the storage unit 508. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0145] Various components in the electronic device 500 are connected to the I / O interface 505, including an input unit 506, such as a keyboard, a mouse, etc., an output unit 507, such as various types of displays, a speaker, etc., a storage unit 508, such as a magnetic disk, an optical disk, etc., and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0146] The processor 501 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose 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 501 performs various methods and processes described above, such as the credential anti-replay method.
[0147] In some embodiments, the credential anti-replay method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded onto the RAM 503 and executed by the processor 501, one or more steps of the credential anti-replay method described above can be performed. Alternatively, in other embodiments, the processor 501 can be configured to perform the credential anti-replay method by any other appropriate means, such as by means of firmware.
[0148] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0149] Computer programs used to implement the processes of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program
[0150] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0151] To provide for interaction with a user, the systems and techniques described here can 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 a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0152] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can 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), blockchain network, and the Internet.
[0153] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS (Virtual Private Server).
[0154] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in sequence, or executed in different orders, as long as the desired results of the present disclosure are achieved, and the present disclosure is not limited herein.
[0155] The above detailed description does not limit the scope of the application. Various modifications, combinations, sub-combinations and alternatives can be made to the detailed description. Any modification, equivalent replacement and improvement etc. made within the spirit and principle of the application shall be included in the scope of the application.
Claims
1. A method for preventing duplicate vouchers, characterized in that, The method includes: During the voucher receiving stage, the voucher to be processed and the voucher deduplication control table of the target database are obtained. The main document unique key of the voucher to be processed is registered in the voucher deduplication control table of the target database, and the detail document unique key and corresponding detail information of the voucher to be processed are registered in the voucher information registration table of the target database. Based on the voucher deduplication control table in the target database, perform duplicate detection on the primary unique key of the voucher to be processed; If the unique key of the primary document of the document to be processed does not have duplicates, the document to be processed will be entered into the database. When a click submit operation is detected for the pending voucher, the asynchronous processing task corresponding to the unique key of the pending voucher's details is registered; During the voucher processing stage, after the asynchronous processing task corresponding to the unique key of the detail voucher is invoked, the middle platform processing service is called to pass the unique key of the detail voucher to be processed to the downstream middle platform service, and the downstream middle platform service is used to perform duplicate detection on the unique key of the detail voucher. When the unique key of the details of the pending voucher does not have duplicates, the middle platform processing service is invoked to process the pending voucher according to the details in the voucher information registration table.
2. The method according to claim 1, characterized in that, After the pending vouchers are entered into the database, the process further includes: Call the global anti-duplicate service of the original database; Using all the anti-duplicate services of the original database, and based on the existing anti-duplicate control table and the synchronous anti-duplicate control table of the original database, the unique key of the primary order of the voucher to be processed is checked for duplicates. If the unique key of the master document of the pending document is duplicated, the pending document will be rejected. If the unique key of the primary document of the pending document does not have duplicates, the pending document will continue to be processed.
3. The method according to claim 2, characterized in that, Before performing duplicate detection on the primary unique key of the voucher to be processed based on the existing duplicate control table and the synchronous duplicate control table of the original database through all the duplicate prevention services of the original database, the process also includes: By using all the anti-duplicate services of the original database, the voucher deduplication control table and voucher information registration table of the target database are synchronized to generate the synchronized anti-duplicate control table of the original database.
4. The method according to claim 1, characterized in that, After the pending vouchers are entered into the database, the process further includes: Call the business anti-duplicate service of the original database; Through the business anti-duplicate service of the original database, the status of the voucher details corresponding to the unique key of the voucher to be processed is detected according to the transaction details table of the original database. When the status of the document details of the document with the unique key in the document details of the document to be processed is in the process of processing or has been processed, the transaction for the document to be processed is rejected. If the status of the document details of the document with the unique key in the document details to be processed is not in the process of processing or has been processed, the transaction for the document to be processed shall continue.
5. The method according to claim 1, characterized in that, The target database includes at least two alternative database shards; each alternative database shard has a corresponding alternative voucher deduplication control table and an alternative voucher information registration table; Accordingly, registering the master document unique key of the voucher to be processed to the voucher deduplication control table of the target database, and registering the detail document unique key and corresponding detail information of the voucher to be processed to the voucher information registration table, includes: Based on the administrative division of the master unique key of the voucher to be processed, the target database shard is selected from each of the candidate database shards; Register the primary unique key of the voucher to be processed in the target voucher deduplication control table of the target database shard; The unique key of the document to be processed and the corresponding detailed information are registered in the target document information registration table of the target database segment; Accordingly, the step of performing duplicate detection on the primary unique key of the voucher to be processed based on the voucher deduplication control table in the target database includes: Based on the target voucher deduplication control table in the target database shard, the primary single unique key of the voucher to be processed is subjected to duplicate detection.
6. The method according to claim 1, characterized in that, The target database includes at least two alternative database shards; Each of the aforementioned alternative database shards has a corresponding alternative business anti-duplicate table; Correspondingly, it also includes: During the voucher receiving stage, the business unique key of the voucher to be processed is obtained, and the target database shard is selected from the candidate database shards based on the administrative division of the business unique key of the voucher to be processed. Register the unique business key of the credential to be processed to the target business anti-duplicate table of the target database shard; Based on the target business anti-duplicate table in the target database shard, the business unique key of the credential to be processed is subjected to duplicate detection.
7. The method according to claim 1, characterized in that, Each master order unique key corresponds to at least one detail order unique key; the master order unique key includes the business year, administrative division, voucher type, and voucher number; the detail order unique key includes the business year, administrative division, voucher type, voucher number, and voucher detail sequence number.
8. A device for preventing duplicate vouchers, characterized in that, The device includes: The voucher receiving module is used to obtain the voucher to be processed and the voucher deduplication control table of the target database during the voucher receiving stage, register the main document unique key of the voucher to be processed to the voucher deduplication control table of the target database, and register the detail document unique key and corresponding detail information of the voucher to be processed to the voucher information registration table of the target database. The single-database anti-duplicate detection module is used to perform duplicate detection on the main unique key of the voucher to be processed based on the voucher deduplication control table in the target database. The voucher entry module is used to enter the voucher into the database when the unique key of the master order of the voucher to be processed does not have duplicates. The asynchronous processing task registration module is used to register the asynchronous processing task corresponding to the unique key of the details sheet of the pending voucher when the click submit operation of the pending voucher is detected. The link anti-duplicate detection module is used to call the middle platform processing service after the asynchronous processing task corresponding to the unique key of the detail order is invoked during the voucher processing stage. The unique key of the detail order of the voucher to be processed is passed to the downstream middle platform service, and the downstream middle platform service is used to perform duplicate detection on the unique key of the detail order. The voucher processing module is used to call the middle platform processing service when there is no duplicate unique key in the details of the voucher to be processed, and process the voucher to be processed according to the details in the voucher information registration table.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the credential duplication prevention method according to any one of claims 1-7.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the credential duplication prevention method according to any one of claims 1-7.