Disclosure of Invention
In view of the above technical problems, embodiments of the present specification provide a method and a system for processing a transfer service, where the technical scheme is as follows:
according to a first aspect of embodiments of the present specification, there is provided a transfer service processing method for processing transfer services of a plurality of transfer-in parties in the same transfer-out direction, the method including:
the service management side receives a plurality of transfer service processing requests and determines each transfer party corresponding to each request according to the transfer party identification carried in each request;
the service management side groups the received requests according to the determined information storage positions of the transfer-in parties; wherein, the information of each request corresponding to the transfer party in any group is stored in the same database;
the service management side sends any group of transfer service processing requests to the corresponding database side;
after receiving a group of transfer service processing requests sent by a service management side, a database side obtains a target request which meets a preset condition in the group of transfer service processing requests;
the database side requests any one of the obtained targets: creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request; and under the condition that the idempotent record is successfully established, according to the transferred party identification and the transfer amount in the target request, obtaining account information of the corresponding transferred party stored in the database and transferring accounts.
According to a second aspect of the embodiments of the present specification, there is provided a transfer service processing method for processing transfer services of a plurality of transfer parties in the same transfer-out direction and applying to a service management side, the method including:
receiving a plurality of transfer service processing requests, and determining each transfer party corresponding to each request according to the transfer party identification carried in each request;
grouping the received requests according to the determined information storage positions of the transfer-in parties; wherein, the information of each request corresponding to the transfer party in any group is stored in the same database;
and sending any group of transfer service processing requests to the corresponding database side so that the database side performs batch processing on the group of transfer service processing requests.
According to a third aspect of the embodiments of the present specification, there is provided a transfer service processing method for processing transfer services of a plurality of transfer-in parties in the same transfer-out direction and applying to a database side, the method including:
after receiving a group of transfer service processing requests sent by a service management side, obtaining target requests meeting preset conditions in the group of transfer service processing requests; the group of transfer service processing requests are obtained by grouping the information storage positions of corresponding transfer parties of the service management side according to the transfer service processing;
for any target request obtained:
creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request; and under the condition that the idempotent record is successfully established, according to the transfer party identification and the transfer amount in the target request, obtaining account information corresponding to the transfer party and stored in the database and transferring accounts.
According to a fourth aspect of embodiments herein, there is provided a transfer service processing system for processing transfer services for a plurality of transfer-in parties in the same transfer-out direction, the system comprising: a service management side and a database side;
the service management side receives a plurality of transfer service processing requests and determines each transfer party corresponding to each request according to the transfer party identification carried in each request;
the service management side groups the received requests according to the determined information storage positions of the transfer-in parties; wherein, the information of each request corresponding to the transfer party in any group is stored in the same database;
the service management side sends any group of transfer service processing requests to the corresponding database side;
after receiving a group of transfer service processing requests sent by a service management side, a database side obtains a target request which meets a preset condition in the group of transfer service processing requests;
the database side requests any one of the obtained targets: creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request; and under the condition that the idempotent record is successfully established, according to the transfer party identification and the transfer amount in the target request, obtaining account information corresponding to the transfer party and stored in the database and transferring accounts.
According to a fifth aspect of embodiments of the present specification, there is provided a transfer service processing apparatus for processing transfer services of a plurality of transfer-in parties in the same transfer-out direction and applying to a service management side, the apparatus including:
the request receiving module is used for receiving a plurality of transfer service processing requests and determining each transfer party corresponding to each request according to the transfer party identification carried in each request;
the request grouping module is used for grouping the received requests according to the determined information storage positions of the transfer parties; wherein, the information of each request corresponding to the transfer party in any group is stored in the same database;
and the request sending module is used for sending any group of transfer service processing requests to the corresponding database side so as to enable the database side to carry out batch processing on the group of transfer service processing requests.
According to a sixth aspect of embodiments of the present specification, there is provided a transfer service processing apparatus for processing transfer services of a plurality of transferring parties in the same transferring-out direction, and applying to a database side, the apparatus including:
the system comprises a target request acquisition module, a service management side and a service management module, wherein the target request acquisition module is used for acquiring a target request which meets a preset condition in a group of transfer service processing requests after receiving the group of transfer service processing requests sent by the service management side; the group of transfer service processing requests are obtained by grouping the information storage positions of transfer parties corresponding to the transfer service processing by the service management side;
a target request processing module, configured to, for any one of the obtained target requests:
creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request; and under the condition that the idempotent record is successfully established, according to the transfer party identification and the transfer amount in the target request, obtaining account information corresponding to the transfer party and stored in the database and transferring accounts.
According to the technical scheme provided by the embodiment of the specification, transfer logic is simplified aiming at the condition that the same account transfers to other accounts in batches, a large number of transfer service processing requests are divided into a plurality of groups according to the storage position of transfer party information, the transfer service processing requests corresponding to the database are processed in batches from the side of each database for storing the transfer party information, and the idempotent is ensured through idempotent records, so that the processing efficiency of a large number of transfer services is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of embodiments of the invention.
In addition, any one of the embodiments in the present specification is not required to achieve all of the effects described above.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be described in detail below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification should be within the scope of protection.
Aiming at the problems in the prior art, the embodiment of the specification provides a transfer service processing method which is used for processing the transfer services of a plurality of transfer parties in the same transfer-out direction.
In the embodiment of the present specification, the flow of the transfer service processing relates to a service management side and a plurality of databases, and a corresponding system architecture diagram is shown in fig. 1 and includes a service management device 10 and database devices 20 and 30.
Fig. 2 is an interaction flowchart of a transfer service processing method provided in the embodiment of the present specification, which may specifically include the following steps:
s201, a service management side receives a plurality of transfer service processing requests and determines each transfer party corresponding to each request according to a transfer party identifier carried in each request;
in the embodiment of the specification, when transferring funds from a transferring-out direction to a transferring-in party, transfer services are initiated firstly, so that a service management side receives transfer service processing requests, and when transferring funds from the transferring-out direction to a plurality of transferring-in parties in batches, the service management side receives a plurality of transfer service processing requests.
It can be understood that the present specification does not limit the initiation mode of the transfer service, for example, the forwarding party may be a personal account, and the initiation mode may be a transfer operation performed through a terminal device; for another example, the roll-out party may be an enterprise account, and the initiation manner may be to issue payment red packages to the user in batches, taking the payment platform as an example; and so on.
In the prior art, when the transfer service is processed, a distributed transaction processing mode is adopted, and cross-database remote operation processing needs to be performed through a database for storing the information of the roll-out party and the roll-in party, so that the transfer service processing flow has complex logic and high resource consumption.
In the solution provided in the embodiment of the present specification, the service management side determines, for each received transfer service processing request, a corresponding transfer party according to a transfer party identifier carried in the request. It should be understood that the embodiments in this specification do not limit the specific form of the transferring-in party identifier, for example, the identifier may be a unique serial number identifier assigned to each transferring-in party, or may be an account name of the transferring-in party, and the like, and those skilled in the art may flexibly set the identifier according to the actual situation.
S202, the service management side groups the received requests according to the determined information storage positions of the transfer parties; wherein, the information of each request corresponding to the transfer party in any group is stored in the same database;
s203, the service management side sends any group of transfer service processing requests to the corresponding database side;
for convenience of explanation, S202 and S203 will be described in combination.
In the scheme provided by the embodiment of the specification, the corresponding requests of the transfer parties of which the information is stored in the same database are divided into a group, and the group of transfer service processing requests can be sent to the database, so that the group of requests can be processed by the database in a unified manner without cross-database processing, the service processing logic of transfer in a plurality of transfer parties in the same transfer direction is simplified, and the service processing efficiency is improved.
S204, after receiving a group of transfer service processing requests sent by a service management side, the database side obtains a target request meeting preset conditions in the group of transfer service processing requests;
in the embodiment of the present specification, according to different request processing requirements, a target request meeting a preset condition in the group of transfer service processing requests may be obtained in a variety of ways, which is not limited in the embodiment of the present specification.
In one embodiment of the present disclosure, the information of the transfer party may need to be screened, verified, etc. in advance before the funds of the transfer party are remitted into the account of the transfer party. For example, it may be desirable to verify that there is a credit issue, such as fraud, with the transferred party account; for another example, a payment platform issues a payment red envelope, and a target user group of the payment platform may need to meet a certain condition; and the like, and can be flexibly set by a person skilled in the art according to actual requirements.
Correspondingly, in this embodiment, a target request meeting a preset condition in the group of transfer service processing requests is obtained, and specifically, for any transfer service processing request in the group, the corresponding transfer party information stored in the database is obtained according to the transfer party identifier carried in the request, and then the obtained transfer party information is verified according to a preset verification rule, so that the request is determined to be the target request meeting the preset condition under the condition that the transfer party information is verified.
For example, the obtained transferring party information includes a risk value, a credit value and the like of the transferring party, and the verification rule is that the risk value is lower than a preset threshold value or the credit value is higher than the preset threshold value, so that a request corresponding to a verified and approved transferring party is determined as a target request; for another example, the obtained information of the transfer-in party includes historical consumption records, historical consumption scenes, historical activity values and the like of the transfer-in party, and the verification rule is that the historical consumption scenes are matched with the consumption scenes of the payment red package issued this time, or the historical activity values are higher than a preset threshold value, and the like, so that the request corresponding to the transfer-in party passing verification can be determined as the target request, and the probability that the user consumes the red package after the red package is issued is improved.
In another specific implementation of the embodiments of the present specification, in order to further improve the efficiency of the transfer service processing, a plurality of transfer service processing requests may be further combined into one target request processing. Specifically, at least one preset request merge condition may be obtained first, and the specific content of the request merge condition is not limited in this embodiment of the specification, for example, the request merge condition may be the same transfer party account, the same fund flow direction, the same business subtype, and the like. And then determining whether the group of transfer service processing requests have transfer service processing requests meeting the request merging conditions, if so, merging the determined transfer service processing requests according to the request merging conditions to obtain merged target requests.
For example, if the request merging conditions are that the transferring party accounts are the same, and it is determined that all the transferring party accounts of 3 transfer service processing requests are the account a, the 3 requests can be merged into 1 target request processing; for another example, if the request merging condition is that the fund flow direction is the same, and it is determined that 10 transfer service processing requests are all bank accounts transferred to bank B, the 10 requests may be merged into 1 target request processing; and so on.
It is understood that in the case that a plurality of merged request conditions are preset, there may be transfer service processing requests satisfying a plurality of conditions, such as the transferor account of request 1 is the same as the transferor account of request 2, and the service subtype of request 3 is the same, and the embodiments of the present specification do not limit the processing manner in this case.
For example, request 1 may be merged with either request 2, 3; for another example, priorities may be set for different merge request conditions in advance, and if the condition that the "same transfer party account" has a higher priority than the "same service subtype", request 1 and request 2 are merged; for example, requests meeting more conditions may be merged, that is, assuming that the account of the transfer party of the request 1, 2, 4, 5 is the same, and the service subtype of the request 1 is the same as that of the request 3, the requests 1, 2, 4, 5 may be merged to obtain a target request; and so on.
Of course, in the embodiment of the present specification, the condition restriction of the transfer service processing request may not be performed, that is, the database performs batch processing on all the transfer service processing requests in a group received without performing operations such as checking, screening, or merging, and in this case, each received transfer service processing request is used as a target request, and the subsequent processing is performed.
S205, the database side requests any one obtained target: creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request; and under the condition that the idempotent record is successfully established, according to the transfer party identification and the transfer amount in the target request, obtaining account information corresponding to the transfer party and stored in the database and transferring accounts.
In the above embodiment, a target request obtained by a plurality of transfer service processing requests may be merged, and when creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request, at least 2 idempotent identifiers in the target request may be obtained first, where the at least 2 idempotent identifiers are: and combining the idempotent identifications carried in at least 2 transfer service processing requests of the target request, and then creating corresponding idempotent records for the transfer service processing requests corresponding to the idempotent identifications according to each obtained idempotent identification.
In another specific implementation manner of the embodiment of the present specification, after the group of transfer service processing requests is processed, the database side sends processing result data of the group of transfer service processing requests to the service management side, so that after the service management side receives the processing result data sent by the database side, the account balance of the transfer party is updated according to the data. That is, the service management side may asynchronously update the account balance of the account of the transfer party, and may generate a corresponding account detail for each transfer service processing request, or generate an account detail for a plurality of transfer service processing requests processed in batch by the same database, thereby further improving the transfer service processing efficiency.
In order to more clearly illustrate the transfer service processing scheme in the embodiment of the present specification, the following describes the transfer service processing methods executed by the service management side and the database side from the perspective of a single side respectively:
fig. 3 is a flowchart of a transfer service processing method executed by a service management side, which is used for processing transfer services of multiple transfer parties in the same transfer-out direction, and specifically includes the following steps:
s301, receiving a plurality of transfer service processing requests, and determining each transfer party corresponding to each request according to the transfer party identification carried in each request;
s302, grouping the received requests according to the determined information storage positions of the transfer parties; wherein, the information of each request corresponding to the transfer party in any group is stored in the same database;
and S303, sending any group of transfer service processing requests to a corresponding database side so that the database side performs batch processing on the group of transfer service processing requests.
Fig. 4 is a flow chart of a transfer service processing method executed at the database side, which is used for processing transfer services of multiple transfer parties in the same transfer-out direction, and specifically includes the following steps:
s401, after receiving a group of transfer service processing requests sent by a service management side, obtaining target requests meeting preset conditions in the group of transfer service processing requests; the group of transfer service processing requests are obtained by grouping the information storage positions of corresponding transfer parties of the service management side according to the transfer service processing;
s402, aiming at any one obtained target request: creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request;
and S403, under the condition that the idempotent record is successfully created, according to the transfer party identifier and the transfer amount in the target request, obtaining account information corresponding to the transfer party and stored in the database, and transferring accounts.
For details of the single-side execution method of the service management side and the database side, reference may be made to the description of the foregoing embodiments, which are not described herein again.
The transfer service processing method provided in the present specification will be described below with reference to a more specific example.
Assuming that a certain payment platform needs to issue payment red packages to a batch of users, the service management side firstly receives a batch of corresponding transfer service processing requests.
The service management side can firstly determine a user account corresponding to each transfer service processing request to determine a database for storing the user account information, for example, an account sub-table can be set, and the database where the account is located is identified, so that batch transfer service processing requests are sequenced according to the account sub-table, and transfer service processing requests with the same account sub-table are sent to the corresponding database in batch.
Supposing that the service management side sends 100 transfer service processing requests to the database A, after the transfer service processing requests are received by the database A, performing idempotent record writing aiming at each transfer service processing request, and if the idempotent record writing is successful, indicating that a red packet is not sent to a corresponding account, so that the transfer service processing can be performed; if the write-in of the idempotent records fails, it is indicated that the red packet is issued to the corresponding account, so that the subsequent processing is not performed any more, and the processing result of the transfer service processing request is successful.
After the database a processes all the 100 transfer service processing requests, it may return processing result data to the service management side, for example, it may return the processing result of each transfer service processing request as success or failure, the amount of money transferred separately or in total, and so on, so that the service management system may perform subsequent processing, such as updating the balance of the transfer party account, generating transfer account details, and so on. And the transferred party's accounting details and balance may be updated by database a either synchronously or asynchronously.
Therefore, by applying the scheme, the transfer service processing flow can be simplified and the remote operation across databases can be reduced on the basis of ensuring the safety and the accuracy of fund circulation aiming at the condition that a plurality of transfer parties transfer accounts in the same transfer-out direction, so that the transfer service processing efficiency is improved.
Corresponding to the above method embodiment, an embodiment of the present specification further provides a device for processing transfer services, configured to process transfer services of multiple transfer-in parties in the same transfer-out direction, and apply the device to a service management side, where, as shown in fig. 5, the device may include:
the request receiving module 110 is configured to receive a plurality of transfer service processing requests, and determine each transfer party corresponding to each request according to a transfer party identifier carried in each request;
a request grouping module 120, configured to group the received requests according to the determined information storage locations of the forwarding parties; wherein, the information of each request corresponding to the transfer party in any group is stored in the same database;
the request sending module 130 is configured to send any group of transfer service processing requests to the corresponding database side, so that the database side performs batch processing on the group of transfer service processing requests.
An embodiment of the present disclosure further provides a device for processing transfer services, configured to process transfer services of multiple transfer-in parties in the same transfer-out direction, and apply the transfer services to a database side, as shown in fig. 6, where the device may include:
a target request obtaining module 210, configured to obtain, after receiving a group of transfer service processing requests sent by a service management side, a target request meeting a preset condition in the group of transfer service processing requests; the group of transfer service processing requests are obtained by grouping the information storage positions of transfer parties corresponding to the transfer service processing by the service management side;
a target request processing module 220, configured to, for any obtained target request:
creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request; and under the condition that the idempotent record is successfully established, according to the transfer party identification and the transfer amount in the target request, obtaining account information corresponding to the transfer party and stored in the database and transferring accounts.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
Embodiments of the present specification further provide a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned transfer service processing method when executing the program. The method at least comprises the following steps:
a transfer service processing method is used for processing the transfer services of a plurality of transfer parties in the same transfer-out direction, and comprises the following steps:
the service management side receives a plurality of transfer service processing requests and determines each transfer party corresponding to each request according to the transfer party identification carried in each request;
the service management side groups the received requests according to the determined information storage positions of the transfer-in parties; wherein, the information of each request corresponding to the transfer party in any group is stored in the same database;
the service management side sends any group of transfer service processing requests to the corresponding database side;
after receiving a group of transfer service processing requests sent by a service management side, a database side obtains target requests meeting preset conditions in the group of transfer service processing requests;
the database side requests any one of the obtained targets: creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request; and under the condition that the idempotent record is successfully established, according to the transferred party identification and the transfer amount in the target request, obtaining account information of the corresponding transferred party stored in the database and transferring accounts.
Fig. 7 is a more specific hardware structure diagram of a computing device provided in an embodiment of the present specification, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static Memory device, a dynamic Memory device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.
The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component within the device (not shown) or may be external to the device to provide corresponding functionality. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, bluetooth and the like).
The bus 1050 includes a path to transfer information between various components of the device, such as the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.
It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only the components necessary to implement the embodiments of the present disclosure, and need not include all of the components shown in the figures.
Embodiments of the present specification also provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor, implements the aforementioned transfer service processing method. The method at least comprises the following steps:
a transfer service processing method is used for processing the transfer services of a plurality of transfer parties in the same transfer-out direction, and comprises the following steps:
the service management side receives a plurality of transfer service processing requests and determines each transfer party corresponding to each request according to the transfer party identification carried in each request;
the service management side groups the received requests according to the determined information storage positions of the transfer-in parties; wherein, the information of each request corresponding to the transfer party in any group is stored in the same database;
the service management side sends any group of transfer service processing requests to the corresponding database side;
after receiving a group of transfer service processing requests sent by a service management side, a database side obtains a target request which meets a preset condition in the group of transfer service processing requests;
the database side requests any one of the obtained targets: creating an idempotent record corresponding to the target request according to the idempotent identifier in the target request; and under the condition that the idempotent record is successfully established, according to the transfer party identification and the transfer amount in the target request, obtaining account information corresponding to the transfer party and stored in the database and transferring accounts.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
From the above description of the embodiments, it is clear to those skilled in the art that the embodiments of the present disclosure can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the embodiments of the present specification may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments of the present specification.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, and the modules described as separate components may or may not be physically separate, and the functions of the modules may be implemented in one or more software and/or hardware when implementing the embodiments of the present disclosure. And part or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment. One of ordinary skill in the art can understand and implement without inventive effort.
The foregoing is only a specific embodiment of the embodiments of the present disclosure, and it should be noted that, for those skilled in the art, a plurality of modifications and decorations can be made without departing from the principle of the embodiments of the present disclosure, and these modifications and decorations should also be regarded as the protection scope of the embodiments of the present disclosure.