Bill collection method and device
By receiving and matching orders and user information in the electronic payment system, using Bloom filter and Zookeeper technology, the problem that electronic payment APP cannot display electronic bills instantly is solved, the user's function of quickly viewing bills is realized, and the system's Scalability and efficiency.
Patent Information
- Application Number
- CN202210141542.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-02-16
AI Technical Summary
Existing electronic payment APPs cannot display electronic bills to users immediately after payment, because the bill provider only has order information and lacks user information, which makes it impossible to match the user with the bill.
By receiving order information and user information from the bill issuer, using the Bloom filter for matching and association, and querying order information in the merchant collaboration platform push record table to determine user information, thereby realizing the association between the bill and the user, and through Zookeeper Distributed table sleeve number switching to solve the insufficient scalability of the Bloom filter.
It enables users to quickly view electronic receipts after payment, enhances user stickiness, and performs massive data filtering within O(1) time complexity, occupying less memory, making up for the insufficient scalability of the Bloom filter.
Smart Images

Figure CN114511365B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and more specifically, to a bill collection method, a bill collection device, a computer storage medium, a computer program product, and a payment clearing server. Background Art
[0002] With the continuous development of the information society and the increasingly accelerated pace of life, fast and convenient payment is entering people's daily life, work and study, including but not limited to dining, shopping, parking and so on.
[0003] Wireless technologies represented by mobile 2G, 3G, 4G networks, WiFi, Bluetooth, etc. are becoming increasingly mature and have quietly changed people's living habits and lifestyles. Their advantages of high security, low cost, high speed, low power consumption, high integration, and small size have also greatly met people's daily needs. Modern payment methods, with their convenience, efficiency, ease of use, and people-friendly features, are replacing traditional payment methods in an all-round way, and various electronic payment apps are emerging one after another.
[0004] Existing electronic payment apps generally cannot provide the function of instant invoicing when providing payment services to users. The reason is that most electronic payment apps adopt the method of receiving and pushing, that is, the bill provider (or "bill issuer") pushes the bill-related information to the bill collector (also called "bill receiver"). However, some bill providers only have order information but no user information, so the bill collector cannot complete the matching between users and bills, making it impossible for the electronic payment app to display the electronic bill to the user immediately after payment. Summary of the invention
[0005] According to one aspect of the present invention, a bill collection method is provided, the method comprising: receiving order information and bill information corresponding to the order information from a bill issuer; receiving the order information and user information corresponding to the order information from a merchant collaboration platform; and using a Bloom filter to match and associate the bill information and the user information based on the order information.
[0006] As a supplement or replacement for the above-mentioned scheme, in the above-mentioned method, after receiving order information and bill information corresponding to the order information from the bill issuer, the method also includes: querying the order corresponding to the order information in the merchant collaboration platform push record table; and based on the queried order, determining the user information in the order so as to associate it with the bill information.
[0007] As a supplement or replacement for the above-mentioned scheme, in the above-mentioned method, after receiving order information and bill information corresponding to the order information from the bill issuer, the method also includes: when no order corresponding to the order information is found, storing the order number to be queried into the Bloom filter.
[0008] As a supplement or replacement for the above-mentioned scheme, in the above-mentioned method, after receiving the order information and the user information corresponding to the order information from the merchant collaboration platform, the method also includes: writing the order number in the order information into the merchant collaboration platform push record table; matching the order number with the Bloom filter; when the match is successful, querying the order corresponding to the order number from the bill order table; and based on the queried order, determining the bill information corresponding to the order so as to associate it with the user information.
[0009] As a supplement or replacement for the above solution, the above method also includes: performing distributed table set number switching through Zookeeper.
[0010] As a supplement or replacement for the above solution, in the above method, the distributed table set number switching through Zookeeper includes: after the clearing time starts, clearing the data in the merchant collaboration platform push record table and the bill order table to be switched, and creating a new Bloom filter.
[0011] As a supplement or replacement for the above solution, after receiving the order information and user information corresponding to the order information from the merchant collaboration platform, the method further includes: judging whether the order is received today based on the order information.
[0012] As a supplement or replacement of the above solution, in the above method, the table set number includes a first table set number and a second table set number.
[0013] As a supplement or replacement for the above-mentioned scheme, in the above-mentioned method, distributed table set number switching through Zookeeper includes: when preparing to switch from the first table set number to the second table set number, clearing the data in the merchant collaboration platform push record table, bill order table and Bloom filter corresponding to the second table set number; and creating a new Bloom filter at least based on the number of bill orders.
[0014] As a supplement or replacement for the above solution, the above method also includes: writing the matched and associated ticket information and user information into the user ticket package table.
[0015] According to another aspect of the present invention, a bill collection device is provided, which includes: a first receiving device for receiving order information and bill information corresponding to the order information from a bill issuer; a second receiving device for receiving the order information and user information corresponding to the order information from a merchant collaboration platform; and a matching and association device for matching and associating the bill information and the user information based on the order information using a Bloom filter.
[0016] As a supplement or replacement for the above-mentioned scheme, the above-mentioned device also includes: a first query device, which is used to query the order corresponding to the order information in the merchant collaboration platform push record table after the first receiving device receives the order information and the bill information corresponding to the order information from the bill issuer; and a first determination device, which is used to determine the user information in the order based on the queried order, so as to associate it with the bill information.
[0017] As a supplement or replacement for the above solution, the above device also includes: a storage device, which is used to store the order number to be queried into the Bloom filter when no order corresponding to the order information is found.
[0018] As a supplement or replacement for the above-mentioned scheme, the above-mentioned device also includes: a first writing device, which is used to write the order number in the order information into the merchant collaboration platform push record table after the second receiving device receives the order information and the user information corresponding to the order information from the merchant collaboration platform; a matching device, which is used to match the order number with the Bloom filter; a second query device, which is used to query the order corresponding to the order number from the bill order table when the match is successful; and a second determination device, which is used to determine the bill information corresponding to the order based on the queried order, so as to associate it with the user information.
[0019] As a supplement or replacement for the above solution, the above device also includes: a switching device for performing distributed table set number switching through Zookeeper.
[0020] As a supplement or replacement for the above solution, in the above device, the switching device is configured to: after the clearing time starts, clear the data in the merchant collaboration platform push record table and the bill order table to be switched, and create a new Bloom filter.
[0021] As a supplement or replacement for the above-mentioned scheme, the above-mentioned device also includes: a judgment device, which is used to judge whether it is an order received today based on the order information after the second receiving device receives the order information and user information corresponding to the order information from the merchant collaboration platform.
[0022] As a supplement or replacement of the above solution, in the above device, the table set number includes a first table set number and a second table set number.
[0023] As a supplement or replacement for the above solution, in the above device, the switching device is configured to: when preparing to switch from the first table set number to the second table set number, clear the data in the merchant collaboration platform push record table, the bill order table and the Bloom filter corresponding to the second table set number; and
[0024] Create a new Bloom filter based on at least the ticket order quantity.
[0025] As a supplement or replacement for the above solution, the above device also includes: a second writing device, which is used to write the matched and associated ticket information and user information into the user ticket package table.
[0026] According to yet another aspect of the present invention, a computer storage medium is provided, wherein the medium includes instructions, and the instructions execute the above method when executed.
[0027] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, and when the computer program is executed by a processor, the method as described above is implemented.
[0028] According to another aspect of the present invention, a payment clearing server is provided, wherein the server includes the bill collection device as described above.
[0029] The bill collection scheme of the embodiment of the present invention not only receives order information and bill information corresponding to the order information from the bill issuer, but also receives the order information and user information corresponding to the order information from the merchant collaboration platform, thereby quickly matching the received successfully issued order number-bill information combination with the merchant side's full order number-user information combination, so that users can view their electronic bills within an acceptable time after payment, thereby achieving the purpose of enhancing user stickiness. In addition, the bill collection scheme of the embodiment of the present invention uses Bloom filters to filter massive data to match associations, thereby determining whether the data to be checked is in a given set within O(1) time complexity, and occupying a small amount of memory.
[0030] In addition, the bill collection solution of one or more embodiments of the present invention performs distributed table set number switching through Zookeeper, thereby making up for the shortcoming of insufficient scalability of the Bloom filter. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The above and other objects and advantages of the present invention will become more fully apparent from the following detailed description taken in conjunction with the accompanying drawings, wherein the same or similar elements are denoted by the same reference numerals.
[0032] Figure 1 A schematic diagram showing a flow chart of a bill collection method according to an embodiment of the present invention; and
[0033] Figure 2 A schematic structural diagram of a bill collection device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0034] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0035] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0036] Figure 1 FIG. 1 is a flow chart of a bill collection method 1000 according to an embodiment of the present invention. Figure 1 As shown, the bill collection method 1000 includes the following steps:
[0037] In step S110, order information and bill information corresponding to the order information are received from the bill issuer;
[0038] In step S120, the order information and user information corresponding to the order information are received from the merchant collaboration platform; and
[0039] In step S130, the ticket information and the user information are matched and associated based on the order information using a Bloom filter.
[0040] In the context of the present invention, the term "invoice issuer" is also referred to as an invoice provider or invoice pusher. In one embodiment, after the user pays and issues an invoice, the invoice issuer identifies the payment channel as Cloud QuickPass and pushes the order information and invoice information to the invoice collector.
[0041] The term "Merchant Collaboration Platform" (MCS) refers to a system that pushes and forwards the full amount of payment order information and user information of all merchants in a certain industry to downstream systems. In one or more embodiments, the merchant collaboration platform only supports the push function and does not support the query function.
[0042] In the context of this invention, the term "Bloom filter" is actually a very long binary vector and a series of random mapping functions. Bloom filter can be used to retrieve whether an element is in a set. Its advantages are that the space efficiency and query time are far superior to general algorithms, and its disadvantages are that there is a certain misrecognition rate and deletion difficulty.
[0043] In one or more embodiments, a Bloom filter is used to filter a large amount of data. In this way, the bill collection party can quickly match the order number-bill information combination of the successfully issued bill (i.e., the order information and bill information received from the bill issuer) with the merchant side's full order number-user information combination (i.e., the order information and user information received from the merchant collaboration platform). This is conducive to users being able to view their electronic bills immediately after payment, thereby achieving the purpose of enhancing user stickiness.
[0044] In one embodiment, after step S110, the above-mentioned bill collection method 1000 further includes: querying the order corresponding to the order information in the merchant collaboration platform push record table; and determining the user information in the order based on the queried order, so as to associate it with the bill information. When the order corresponding to the order information is not queried, the order number to be queried is stored in the Bloom filter.
[0045] For example, after receiving a push from the government service side, the bill collection method 1000 according to an embodiment of the present invention may include: (1) when the order is found in the MCS push record table of the day, the user information in the order is taken out, and after associating it with the bill information, the process ends. If the order is not found, go to step 2; (2) store the order number to be queried in the Bloom filter of Redis on the day, and the process ends.
[0046] Redis (Remote Dictionary Server), or remote dictionary service, is an open source log-type, Key-Value database written in ANSI C language, supporting the network, memory-based and persistent, and provides APIs in multiple languages. Similar to Memcached, it supports relatively more value types for storage, including string, list, set, zset (sorted set -- ordered set) and hash. These data types support push / pop, add / remove, intersection, union, difference and richer operations, and these operations are atomic. On this basis, Redis supports various different sorting methods. Like memcached, in order to ensure efficiency, data is cached in memory. The difference is that Redis will periodically write updated data to disk or write modification operations to additional record files, and on this basis, master-slave synchronization is implemented.
[0047] Redis is a high-performance key-value database. The emergence of Redis has largely compensated for the shortcomings of key / value storage such as memcached, and can be a good supplement to relational databases in some situations. It provides clients such as Java, C / C++, C#, PHP, JavaScript, Perl, Object-C, Python, Ruby, Erlang, etc., which is very convenient to use.
[0048] Redis supports master-slave synchronization. Data can be synchronized from a master to any number of slaves, which can be masters that are linked to other slaves. This allows Redis to perform single-layer tree replication. Data can be written to the disk intentionally or unintentionally. Since the publish / subscribe mechanism is fully implemented, slaves can subscribe to a channel and receive the complete message publishing record of the master server when synchronizing the tree anywhere. Synchronization is very helpful for scalability of read operations and data redundancy.
[0049] In one embodiment, after step S120, the above-mentioned bill collection method 1000 may also include: writing the order number in the order information into the merchant collaboration platform push record table; matching the order number with the Bloom filter; when successfully matched, querying the order corresponding to the order number from the bill order table; and based on the queried order, determining the bill information corresponding to the order so as to associate it with the user information.
[0050] For example, after receiving an order pushed by the MCS side, the bill collection method 1000 of the embodiment of the present invention may further include the following steps: (1) writing the order number received by the MCS side into the mcs order record table of the day; (2) matching the received order number with the bloomFilter in Redis. If the match is successful, proceed to step 3; otherwise, the process ends; (3) querying the order from the bill order table to be queried on the day. If the order is found, the bill information is retrieved and associated with the user information into the user bill package; if the order is not found, the process ends.
[0051] It should be noted that due to network path problems and delay problems, the order of the push data on the government service side and the order push information on the MCS side cannot be guaranteed. Therefore, in one or more embodiments of the present invention, the order of step S110 and step S120 is not fixed. For example, in one embodiment, step S110 may be executed before step S120. In another embodiment, step S110 may be executed after step S120.
[0052] In addition, due to the characteristics of business requirements, the order push volume from the MCS side will be much larger than the ticket order volume that needs to be matched. Therefore, a large data volume filtering function is required. At the same time, due to the effectiveness of order data, we only care about the data of the day, so in one embodiment, the distributed timed daily switching function can be combined with the Bloom filter function.
[0053] The advantage of using Bloom filter is that it can determine whether the data to be checked is in a given set within O(1) time complexity and occupies less memory. Specifically, the memory occupied is , where fpp is the false positive rate and n is the set to be judged. In contrast, if the database matching adopts the B+ tree structure, the time complexity is above O(lgn) and the space occupied will be much larger than the Bloom filter.
[0054] The inventors of the present application have also discovered that the use of Bloom filters has the disadvantage of insufficient scalability, that is, when the volume of data to be judged increases, a new Bloom filter needs to be enabled and all existing data needs to be rewritten into the new Bloom filter.
[0055] In order to solve this problem, considering that the data that needs to be judged by the Bloom filter in the current business needs is only the data within one day, the scalability problem can be overcome by using the ab table daily cutting method.
[0056] In one embodiment, although Figure 1 Not shown, the above-mentioned bill collection method 1000 also includes: performing distributed table set number switching through Zookeeper.
[0057] Specifically, the above-mentioned bill collection method 1000 includes the following process:
[0058] (1) All application hosts subscribe to the bloomFilterCode and orderCode znodes on Zookeeper;
[0059] (2) After the daily clearing time begins, all application nodes obtain the distributed consistency lock of the daily task through Zookeeper. The application node that successfully obtains the lock executes step 3;
[0060] (3) Clear the data in the MCS record table, bill order record table, and Bloom filter to be cut. For example, if the current table set number is a and you plan to cut to b, clear all the data in the table with number b and create a new Bloom filter based on factors such as the number of bill orders and marketing plans.
[0061] (4) Change the values of bloomFilterCode and orderCode of znode nodes, such as switching from a to b;
[0062] (5) All subscriber nodes that receive the Zookeeper push update the table set number value in their local memory, and the process ends.
[0063] In the context of the present invention, ZooKeeper is a distributed, open source distributed application coordination service, an open source implementation of Google's Chubby, and an important component of Hadoop and Hbase. It is a software that provides consistency services for distributed applications, and provides functions including: configuration maintenance, domain name services, distributed synchronization, group services, etc. The goal of ZooKeeper is to encapsulate complex and error-prone key services and provide users with simple and easy-to-use interfaces and efficient and stable systems.
[0064] In Zookeeper, a znode is a node similar to a Unix file system path, where data can be stored or retrieved. If the Flag is set to EPHEMERAL when creating a znode, then when the node that created the znode loses connection with Zookeeper, the znode will no longer exist in Zookeeper. Zookeeper uses Watcher to detect event information. When the client receives event information, such as connection timeout, node data change, child node change, it can call the corresponding behavior to process the data. The Zookeeper Wiki page shows how to use Zookeeper to handle event notifications, queues, priority queues, locks, shared locks, etc.
[0065] In one embodiment, implementing distributed locks using Zookeeper may include the following steps:
[0066] (1) The client calls the create() method to create a node named "locknode / guid-lock-". It should be noted that the node creation type here needs to be set to EPHEMERAL_SEQUENTIAL;
[0067] (2) The client calls the getChildren("locknode") method to obtain all created child nodes;
[0068] (3) After the client obtains all child node paths, if it finds that the node it created in step 1 has the smallest sequence number among all nodes, then it is considered that the client has obtained the lock;
[0069] (4) If the created node is not the one with the smallest serial number among all nodes, then monitor the largest node with a smaller serial number than the node created by itself and enter a waiting state; until the next time the monitored child node changes, the child node is acquired and it is determined whether the lock is acquired;
[0070] (5) The process of releasing the lock is relatively simple, which is to delete the child node that you created.
[0071] The above method of implementing distributed locks using Zookeeper is based on temporary sequential nodes. It is understandable that the method of implementing distributed locks using Zookeeper is not limited to the above example. Those skilled in the art can make changes according to actual needs.
[0072] In addition, in one embodiment, the method 1000 further includes: writing the matched and associated ticket information and user information into the user ticket package table. In this way, the user can see his or her electronic ticket in the electronic payment app (such as Cloud QuickPass) within a reasonable time after completing the payment.
[0073] Through the description of various embodiments above, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the computer-readable recording medium includes any mechanism for storing or transmitting information in a computer (e.g., computer) readable form. For example, a machine-readable medium includes a read-only memory (ROM), a random access memory (RAM), a disk storage medium, an optical storage medium, a flash storage medium, an electrical, optical, acoustic or other form of propagation signal (e.g., a carrier wave, an infrared signal, a digital signal, etc.), etc. The computer software product includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0074] Figure 2 FIG. 2 shows a schematic diagram of the structure of a bill collection device 2000 according to an embodiment of the present invention. Figure 2 As shown, the bill collection device 2000 includes a first receiving device 210 , a second receiving device 220 and a matching and associating device 230 .
[0075] The first receiving device 210 is used to receive order information and bill information corresponding to the order information from the bill issuer;
[0076] The second receiving means 220 is used to receive the order information and the user information corresponding to the order information from the merchant collaboration platform; and
[0077] The matching and associating means 230 is used to match and associate the ticket information with the user information based on the order information by using a Bloom filter.
[0078] In the context of the present invention, the term "invoice issuer" is also referred to as an invoice provider or invoice pusher. In one embodiment, after the user pays and issues an invoice, the invoice issuer identifies the payment channel as Cloud QuickPass and pushes the order information and invoice information to the invoice collector.
[0079] The term "Merchant Collaboration Platform" (MCS) refers to a system that pushes and forwards the full amount of payment order information and user information of all merchants in a certain industry to downstream systems. In one or more embodiments, the merchant collaboration platform only supports the push function and does not support the query function.
[0080] In the context of this invention, the term "Bloom filter" is actually a very long binary vector and a series of random mapping functions. Bloom filter can be used to retrieve whether an element is in a set. Its advantages are that the space efficiency and query time are far superior to general algorithms, and its disadvantages are that there is a certain misrecognition rate and deletion difficulty.
[0081] In one or more embodiments, a Bloom filter is used to filter a large amount of data. In this way, the bill collection party can quickly match the order number-bill information combination of the successfully issued bill (i.e., the order information and bill information received from the bill issuer) with the merchant side's full order number-user information combination (i.e., the order information and user information received from the merchant collaboration platform). This is conducive to users being able to view their electronic bills immediately after payment, thereby achieving the purpose of enhancing user stickiness.
[0082] In one embodiment, although Figure 2 Not shown, the device 2000 further includes: a first query device, which is used to query the order corresponding to the order information in the merchant collaboration platform push record table after the first receiving device receives the order information and the bill information corresponding to the order information from the bill issuer; and a first determination device, which is used to determine the user information in the order based on the queried order so as to associate it with the bill information. In one embodiment, the device 2000 may further include: a storage device, which is used to store the order number to be queried into the Bloom filter when the order corresponding to the order information is not queried.
[0083] For example, after the first receiving device receives the push from the government service side, the first query device is used to query the order corresponding to the order information in the MCS push record table of the day. If the first query device finds the order, the first determination device takes out the user information in the order to associate it with the bill information. If the first query device does not find the order, the storage device stores the order number to be queried in the Bloom filter of Redis on the day.
[0084] Redis (Remote Dictionary Server), or remote dictionary service, is an open source log-type, Key-Value database written in ANSI C language, supporting the network, memory-based and persistent, and provides APIs in multiple languages. Similar to Memcached, it supports relatively more value types for storage, including string, list, set, zset (sorted set -- ordered set) and hash. These data types support push / pop, add / remove, intersection, union, difference and richer operations, and these operations are atomic. On this basis, Redis supports various different sorting methods. Like memcached, in order to ensure efficiency, data is cached in memory. The difference is that Redis will periodically write updated data to disk or write modification operations to additional record files, and on this basis, master-slave synchronization is implemented.
[0085] Redis is a high-performance key-value database. The emergence of Redis has largely compensated for the shortcomings of key / value storage such as memcached, and can be a good supplement to relational databases in some situations. It provides clients such as Java, C / C++, C#, PHP, JavaScript, Perl, Object-C, Python, Ruby, Erlang, etc., which is very convenient to use.
[0086] Redis supports master-slave synchronization. Data can be synchronized from a master to any number of slaves, which can be masters that are linked to other slaves. This allows Redis to perform single-layer tree replication. Data can be written to the disk intentionally or unintentionally. Since the publish / subscribe mechanism is fully implemented, slaves can subscribe to a channel and receive the complete message publishing record of the master server when synchronizing the tree anywhere. Synchronization is very helpful for scalability of read operations and data redundancy.
[0087] In one embodiment, the above-mentioned device 2000 may also include: a first writing device, used to write the order number in the order information into the merchant collaboration platform push record table after the second receiving device receives the order information and the user information corresponding to the order information from the merchant collaboration platform; a matching device, used to match the order number with the Bloom filter; a second query device, used to query the order corresponding to the order number from the bill order table when the match is successful; and a second determination device, used to determine the bill information corresponding to the order based on the queried order, so as to associate it with the user information.
[0088] For example, after the second receiving device receives the order pushed by the MCS side, the first writing device writes the order number received by the MCS side into the MCS order record table of the day. Then, the matching device matches the received order number with the Bloom filter in Redis. If the match is successful, the second query device queries the order from the ticket order table to be queried on the day. If the second query device finds the order, the second determination device extracts the ticket information so as to associate it with the user information into the user ticket package.
[0089] In one embodiment, the above-mentioned device 2000 may further include: a judgment device for judging whether it is an order received today based on the order information after the second receiving device receives the order information and the user information corresponding to the order information from the merchant collaboration platform.
[0090] In addition, due to the characteristics of business requirements, the order push volume from the MCS side will be much larger than the ticket order volume that needs to be matched. Therefore, a large data volume filtering function is required. At the same time, due to the effectiveness of order data, we only care about the data of the day, so in one embodiment, the distributed timed daily switching function can be combined with the Bloom filter function.
[0091] The advantage of using Bloom filter is that it can determine whether the data to be checked is in a given set within O(1) time complexity and occupies less memory. Specifically, the memory occupied is , where fpp is the false positive rate and n is the set to be judged. In contrast, if the database matching adopts the B+ tree structure, the time complexity is above O(lgn) and the space occupied will be much larger than the Bloom filter.
[0092] The inventors of the present application have also discovered that the use of Bloom filters has the disadvantage of insufficient scalability, that is, when the volume of data to be judged increases, a new Bloom filter needs to be enabled and all existing data needs to be rewritten into the new Bloom filter.
[0093] In order to solve this problem, considering that the data that needs to be judged by the Bloom filter in the current business needs is only the data within one day, the scalability problem can be overcome by using the ab table daily cutting method.
[0094] In one or more embodiments, the device 2000 further includes: a switching device for performing distributed table set number switching through Zookeeper. For example, the switching device can be configured to: after the clearing time starts, clear the data in the merchant collaboration platform push record table and the bill order table to be switched, and create a new Bloom filter.
[0095] In the context of the present invention, ZooKeeper is a distributed, open source distributed application coordination service, an open source implementation of Google's Chubby, and an important component of Hadoop and Hbase. It is a software that provides consistency services for distributed applications, and provides functions including: configuration maintenance, domain name services, distributed synchronization, group services, etc. The goal of ZooKeeper is to encapsulate complex and error-prone key services and provide users with simple and easy-to-use interfaces and efficient and stable systems.
[0096] In Zookeeper, a znode is a node similar to a Unix file system path, where data can be stored or retrieved. If the Flag is set to EPHEMERAL when creating a znode, then when the node that created the znode loses connection with Zookeeper, the znode will no longer exist in Zookeeper. Zookeeper uses Watcher to detect event information. When the client receives event information, such as connection timeout, node data change, child node change, it can call the corresponding behavior to process the data. The Zookeeper Wiki page shows how to use Zookeeper to handle event notifications, queues, priority queues, locks, shared locks, etc.
[0097] In one embodiment, the table set number includes a first table set number and a second table set number. In this embodiment, the switching device is configured to: when preparing to switch from the first table set number to the second table set number, clear the data in the merchant collaboration platform push record table, the bill order table, and the Bloom filter corresponding to the second table set number; and create a new Bloom filter according to at least the bill order quantity.
[0098] In one embodiment, the above-mentioned device 2000 may further include: a second writing device, used to write the matched and associated ticket information and user information into the user ticket package table.
[0099] The above-mentioned bill collection device 2000 can be integrated in various types of payment and clearing servers. In this way, the payment and clearing server receives information from the bill issuer and the merchant cooperation platform respectively, and collects the received information, thereby providing the user with a "payment and billing" function.
[0100] In an implementation scenario, the system interaction process involving the bill issuer, the bill collector, and the merchant collaboration platform includes the following steps:
[0101] (1) Users pay fiscal fees, such as roadside parking fees, through the UnionPay app;
[0102] (2) Transaction information is notified to the Merchant Collaboration Platform (MCS) through the UnionPay Omni-channel System;
[0103] (3) After the merchant collaboration platform determines that the merchant receiving payment is a government merchant, it pushes the order information and user information to the bill collection party;
[0104] (4) After receiving the order information pushed by the MCS side, the bill collector determines whether it is a bill order received today. If so, it proceeds to step 5; otherwise, the process ends;
[0105] (5) The order information is combined with the user information pushed by the MCS side and the bill information pushed by the financial service side (i.e. the bill issuer) to assemble the bill information, which is written into the user ticket package table, and the process ends;
[0106] (6) After the financial service side confirms that the user's payment is successful, it will issue a bill and push the bill information and UnionPay order information to the bill collection party;
[0107] (7) After receiving the push information from the financial service, the bill collector determines whether it has received the corresponding order information from the MCS today. If so, it proceeds to step 5; otherwise, it records it as information to be completed and ends the process.
[0108] In summary, the bill collection scheme of the embodiment of the present invention not only receives order information and bill information corresponding to the order information from the bill issuer, but also receives the order information and user information corresponding to the order information from the merchant collaboration platform, thereby quickly matching the received successfully issued order number-bill information combination with the merchant side's full order number-user information combination, so that users can view their electronic bills within an acceptable time after payment, thereby achieving the purpose of enhancing user stickiness. In addition, the bill collection scheme of the embodiment of the present invention uses Bloom filters to filter massive data to match associations, thereby determining whether the data to be checked is in a given set within O(1) time complexity, and occupying a small amount of memory.
[0109] In addition, the bill collection solution of one or more embodiments of the present invention performs distributed table set number switching through Zookeeper, thereby making up for the shortcoming of insufficient scalability of the Bloom filter.
[0110] The present application is described with reference to the flowcharts and / or block diagrams of the methods, apparatuses (devices) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0111] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0113] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application. Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A bill collection method, characterized in that: The method comprises: receiving order information and bill information corresponding to the order information from the bill issuer; receiving the order information and user information corresponding to the order information from the merchant collaboration platform; and Using a Bloom filter, the ticket information and the user information are matched and associated based on the order information. The method further comprises: Distributed table set number switching is performed through Zookeeper, wherein distributed table set number switching through Zookeeper includes: After the clearing time begins, clear the data in the merchant collaboration platform push record table and the bill order table to be switched over, and create a new Bloom filter.
2. The method of claim 1, wherein: After receiving order information and bill information corresponding to the order information from the bill issuer, the method further includes: Querying the order corresponding to the order information in the merchant collaboration platform push record table; and Based on the queried order, user information in the order is determined so as to be associated with the ticket information.
3. The method of claim 2, wherein: After receiving order information and bill information corresponding to the order information from the bill issuer, the method further includes: When no order corresponding to the order information is found, the order number to be queried is stored in the Bloom filter.
4. The method of claim 1, wherein: After receiving the order information and user information corresponding to the order information from the merchant collaboration platform, the method further includes: Writing the order number in the order information into the merchant collaboration platform push record table; Matching the order number with the Bloom filter; When the match is successful, query the order corresponding to the order number from the ticket order table; and Based on the queried order, the ticket information corresponding to the order is determined so as to be associated with the user information.
5. The method according to claim 1, after receiving the order information and the user information corresponding to the order information from the merchant collaboration platform, the method further comprises: Based on the order information, determine whether it is an order received today.
6. The method of claim 1, wherein: The table set number includes a first table set number and a second table set number.
7. The method of claim 6, wherein: Distributed table set number switching through Zookeeper includes: When preparing to switch from the first table set number to the second table set number, clearing the data in the merchant collaboration platform push record table, the bill order table, and the Bloom filter corresponding to the second table set number; and Create a new Bloom filter based on at least the ticket order quantity.
8. The method of claim 1, further comprising: Write the matched and associated ticket information and user information into the user ticket package table.
9. A bill collection device, characterized in that: The device comprises: A first receiving device, used to receive order information and bill information corresponding to the order information from a bill issuer; A second receiving device is used to receive the order information and user information corresponding to the order information from the merchant collaboration platform; and A matching and associating device, configured to match and associate the ticket information with the user information based on the order information by using a Bloom filter, The device also includes: A switching device is used to perform distributed table set number switching through Zookeeper, wherein the switching device is configured to: After the clearing time begins, clear the data in the merchant collaboration platform push record table and the bill order table to be switched over, and create a new Bloom filter.
10. The device of claim 9, further comprising: A first query device, configured to query an order corresponding to the order information in a push record table of a merchant collaboration platform after the first receiving device receives the order information and the bill information corresponding to the order information from the bill issuer; as well as The first determining means is used to determine the user information in the order based on the queried order so as to associate it with the ticket information.
11. The device of claim 10, further comprising: The storage device is used to store the order number to be queried into the Bloom filter when no order corresponding to the order information is found.
12. The device of claim 9, further comprising: A first writing device, configured to write the order number in the order information into a push record table of the merchant collaboration platform after the second receiving device receives the order information and the user information corresponding to the order information from the merchant collaboration platform; matching means for matching the order number with the Bloom filter; The second query means is used to query the order corresponding to the order number from the bill order table when the match is successful; as well as The second determining means is used to determine the ticket information corresponding to the order based on the queried order, so as to associate it with the user information.
13. The device of claim 9, further comprising: The judging device is used to judge whether the order is received today based on the order information after the second receiving device receives the order information and the user information corresponding to the order information from the merchant cooperation platform.
14. The apparatus of claim 9, wherein: The table set number includes a first table set number and a second table set number.
15. The apparatus of claim 14, wherein: The switching device is configured as follows: When preparing to switch from the first table set number to the second table set number, clearing the data in the merchant collaboration platform push record table, the bill order table, and the Bloom filter corresponding to the second table set number; as well as Create a new Bloom filter based on at least the ticket order quantity.
16. The apparatus of claim 9, further comprising: The second writing device is used to write the matched and associated ticket information and user information into the user ticket package table.
17. A computer storage medium, characterized in that: The medium includes instructions that, when executed, perform the method of any one of claims 1 to 8.
18. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
19. A payment clearing server, characterized in that: The server includes the bill collection device as described in any one of claims 9 to 16.
Citation Information
Patent Citations
Payment verification method and system
CN111507724A