Task processing method and device, equipment and storage medium
By recording the successfully created resource transfer task identifier in the task information table and storing it in a non-relational database, the problem of repeated creation of tasks and storage pressure in the resource transfer processing system is solved, improving user experience and reducing capacity expansion costs .
Patent Information
- Application Number
- CN202411365711.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-14
AI Technical Summary
When existing resource transfer processing systems handle resource transfer tasks for a long time, there is the risk of repeated creation of tasks and storage pressure, resulting in poor user experience and high expansion cost of global idempotent tables.
By recording the task identifier of the successful resource transfer task created in the task information table, and combining the specific access process of first database first and then the task information table, preventing the repeated creation of the same resource transfer task and storing the task information table at the same time In non-relational databases, the low-cost expansion feature is used to reduce the expansion cost.
It realizes the storage and processing of resource transfer tasks over a long period of time, prevents repeated creation of tasks, improves user experience, and reduces the expansion cost of task information tables.
Smart Images

Figure CN119311669A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a task processing method, device, equipment and storage medium. Background Art
[0002] With the continuous development of the Internet and mobile technology, online resource transfer processing has become a widely used resource transfer processing method. For resource transfer processing systems with large business volumes, a large number of resource transfer tasks will be generated in a short period of time. The storage and processing of these resource transfer tasks require the support of a large amount of storage resources and computing resources.
[0003] In view of storage and performance pressure, the related technology can only support the storage and processing of resource transfer tasks within a short period of time. If the user wants to transfer the resource acquisition task generated a long time ago, the resource transfer process will fail due to the lack of relevant information of the resource acquisition task, resulting in a poor user experience. Summary of the invention
[0004] In order to solve the above technical problems, the embodiments of the present disclosure provide a task processing method, apparatus, device and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a task processing method, the method comprising:
[0006] In response to the resource transfer request, determining a first task identifier; wherein the first task identifier is a task identifier of a first resource transfer task; the first resource transfer task is used to transfer resources from a first party to a second party;
[0007] querying a first database for whether there is a second task identifier associated with the first task identifier; wherein the first database stores task data whose data attributes satisfy a first condition; the second task identifier is a task identifier of a second resource transfer task; and the second resource transfer task is used to transfer the resource from the second party to the first party;
[0008] If not, query whether there is the second task identifier associated with the first task identifier in the task information table; wherein the task information table is stored in a non-relational database and is used to record the task identifier of the second resource transfer task that is successfully created, and the task identifier of the first resource transfer task associated with the second resource transfer task;
[0009] If not, the second resource transfer task and the second task identifier are created based on the resource transfer request, and the second task identifier and the first task identifier are associated and stored in the task information table, and the second resource transfer task is stored in the first database.
[0010] In a second aspect, an embodiment of the present disclosure further provides a task processing device, the device comprising:
[0011] A first determination module, configured to determine a first task identifier in response to a resource transfer request; wherein the first task identifier is a task identifier of a first resource transfer task; and the first resource transfer task is used to transfer resources from a first party to a second party;
[0012] A first query module is used to query whether there is a second task identifier associated with the first task identifier in a first database; wherein the first database stores task data whose data attributes satisfy a first condition; the second task identifier is a task identifier of a second resource transfer task; and the second resource transfer task is used to transfer the resource from the second party to the first party;
[0013] a second query module, configured to query whether there is a second task identifier associated with the first task identifier in a task information table if the second task identifier does not exist; wherein the task information table is stored in a non-relational database and is configured to record the task identifier of the second resource transfer task that is successfully created and the task identifier of the first resource transfer task associated with the second resource transfer task;
[0014] The first storage module is used to create the second resource transfer task and the second task identifier based on the resource transfer request if it does not exist, and associate the second task identifier with the first task identifier and store them in the task information table, and store the second resource transfer task in the first database.
[0015] In a third aspect, an embodiment of the present disclosure further provides a task processing device, the task processing device comprising:
[0016] processor;
[0017] A memory for storing executable instructions;
[0018] The processor is used to read executable instructions from the memory and execute the executable instructions to implement the task processing method described in any embodiment of the present disclosure.
[0019] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the task method described in any embodiment of the present disclosure.
[0020] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which is used to execute the task processing method described in any embodiment of the present disclosure.
[0021] The technical solution for task processing provided by the embodiment of the present disclosure can determine a first task identifier in response to a resource transfer request, wherein the first task identifier is a task identifier of a first resource transfer task; the first resource transfer task is used to transfer resources from a first party to a second party, and query whether there is a second task identifier associated with the first task identifier in a first database, wherein the first database stores task data whose data attributes meet a first condition, the second task identifier is a task identifier of a second resource transfer task, and the second resource transfer task is used to transfer resources from the second party to the first party. If not, query whether there is a second task identifier associated with the first task identifier in a task information table, wherein the task information table is stored in a non-relational database, and is used to record the task identifier of a successfully created second resource transfer task, and the task identifier of the first resource transfer task associated with the second resource transfer task; if not, create the second resource transfer task and the second task identifier based on the resource transfer request, and store the second task identifier and the first task identifier in association in the task information table, and store the second resource transfer task in the first database. According to the embodiments of the present disclosure, by recording the task identifier of the successfully created resource transfer task in the task information table, and combining it with the specific access process of first checking the first database and then checking the task information table, a global idempotent effect is achieved, which can prevent the repeated creation of the same resource transfer task to a certain extent; in addition, by storing the task information table in a non-relational database, the relatively low-cost expansion feature of the non-relational database can be utilized to reduce the expansion cost of the task information table, so that resource transfer tasks and related information within a longer period of time can be stored, supporting long-term resource transfer processing and improving user experience.
[0022] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0024] Figure 1 A flowchart of a task processing method provided by an embodiment of the present disclosure;
[0025] Figure 2 A system architecture diagram of a task processing method provided by an embodiment of the present disclosure;
[0026] Figure 3 A flowchart of another task processing method provided by an embodiment of the present disclosure;
[0027] Figure 4 A flowchart of another task processing method provided by an embodiment of the present disclosure;
[0028] Figure 5 A flowchart of another task processing method provided by an embodiment of the present disclosure;
[0029] Figure 6 A flowchart of another task processing method provided by an embodiment of the present disclosure;
[0030] Figure 7 A flowchart of another task processing method provided by an embodiment of the present disclosure;
[0031] Figure 8 A schematic diagram of the structure of a task processing device provided by an embodiment of the present disclosure;
[0032] Fig. 9 A schematic diagram of the structure of a task processing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0034] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0035] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0036] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0037] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0038] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0039] At present, for resource transfer processing systems with large business volumes, a large amount of resource transfer task data is generated every day. The usual practice is to separate the resource transfer task data into cold and hot storage, such as putting data from two months ago into a cold storage and data from two months into a hot storage. If a resource transfer task appears in both the cold storage and the hot storage, there is a risk of repeatedly creating the same resource transfer task, resulting in asset damage to the resource transfer processing system.
[0040] To address the above issues, the conventional approach is to introduce the concept of global (i.e., the entire set of cold storage and hot storage) idempotency, and use the resource transfer order number to correspond to a record in the global idempotency table. The record indicates whether the resource transfer task corresponding to the resource transfer order number is in the cold storage or the hot storage. When a resource transfer request is received, if a resource transfer task with the same resource transfer order number is found, the corresponding resource transfer task is not allowed to be created, thereby preventing repeated creation of the same resource transfer task.
[0041] However, the global idempotent table is usually stored in a relational database. In order to support long-term resource transfer processing, the global idempotent table needs to be expanded to store a large amount of data. Due to the characteristics of non-relational databases, the expansion cost of the global idempotent table is high.
[0042] Based on the above situation, an embodiment of the present disclosure provides a task processing scheme, in response to a resource transfer request, determining a first task identifier, wherein the first task identifier is a task identifier of a first resource transfer task, and the first resource transfer task is used to transfer resources from a first party to a second party, querying a first database whether there is a second task identifier associated with the first task identifier, wherein the first database stores task data whose data attributes meet a first condition, and the second task identifier is a task identifier of a second resource transfer task, and the second resource transfer task is used to transfer resources from the second party to the first party; if not, querying a task information table whether there is a second task identifier associated with the first task identifier, wherein the task information table is stored in a non-relational database, and is used to record the task identifier of a successfully created second resource transfer task, and the task identifier of the first resource transfer task associated with the second resource transfer task; if not, creating a second resource transfer task and a second task identifier based on the resource transfer request, and storing the second task identifier and the first task identifier in association in the task information table, and storing the second resource transfer task in the first database. According to the embodiments of the present disclosure, by recording the task identifier of the successfully created resource transfer task in the task information table, and combining it with the specific access process of first checking the first database and then checking the task information table, a global idempotent effect is achieved, which can prevent the repeated creation of the same resource transfer task to a certain extent; in addition, by storing the task information table in a non-relational database, the relatively low-cost expansion feature of the non-relational database can be utilized to reduce the expansion cost of the task information table, so that resource transfer tasks and related information within a longer period of time can be stored, supporting long-term resource transfer processing and improving user experience.
[0043] The task processing method provided in the embodiment of the present disclosure can be applied to the resource transfer processing scenario. The method can be executed by a task processing device, which can be implemented by software and / or hardware, and the device can be integrated in a task processing device with a resource transfer processing function. The task processing device can include but is not limited to a laptop computer, a desktop computer, a server, etc.
[0044] Figure 1 FIG. 1 is a flow chart of a task processing method provided by an embodiment of the present disclosure. Figure 1 As shown, the task processing method may include the following steps:
[0045] S110: In response to a resource transfer request, determine a first task identifier.
[0046] The first task identifier is a task identifier of a first resource transfer task, and the first resource transfer task is used to transfer resources from a first party to a second party.
[0047] A resource transfer request is a request to transfer a specific resource from the resource sender's resource library to the resource receiver's resource library.
[0048] The embodiments of the present disclosure can be applied to Figure 2 In the resource transfer processing system shown, the resource transfer processing system includes a MiddleWare layer, a Handler layer, a Core layer, and a Model layer. In the resource transfer processing scenario, the resource transfer request can be a resource transfer request from the caller for a resource transfer task in the resource transfer processing system, such as a resource transfer request for a resource transfer task in which resources are transferred from a first party to a second party, a resource transfer request for a resource transfer task in which resources are transferred from a second party to a first party, etc. Specifically, the caller refers to the subject that initiates the resource transfer request, such as the upstream system of the resource transfer processing system. The resource transfer request may include the task identifier of the resource transfer task, such as the resource transfer order number, and may also include the order status corresponding to the task identifier, such as whether it is a resource transfer order, and may also include the resource value corresponding to the task identifier, and may also include the resource transfer reason corresponding to the task identifier, etc.
[0049] In the disclosed embodiment, the first resource transfer task may be any task requiring resource transfer, wherein the first resource transfer task is used to transfer resources from a first party to a second party, the first party being a resource sender and the second party being a resource receiver.
[0050] In the embodiment of the present disclosure, after receiving the resource transfer request, the task identifier of the first resource transfer task, that is, the first task identifier, can be obtained by parsing the resource transfer request.
[0051] S120: Query the first database to determine whether there is a second task identifier associated with the first task identifier.
[0052] The first database stores task data whose data attributes satisfy the first condition, the second task identifier is the task identifier of a second resource transfer task, and the second resource transfer task is used to transfer resources from the second party to the first party.
[0053] The first database may be any database used to store task data that meets the first condition, such as a relational database. The first condition may be any condition that the storage data attribute of the database needs to meet. Specifically, the first condition may be determined based on the data date of the task data in the database, such as setting task data with a data date within a preset period as the first condition. The first condition may also be determined based on the data access frequency of the task data in the database, such as setting task data with an access frequency exceeding a preset threshold as the first condition.
[0054] In the embodiment of the present disclosure, in the resource transfer processing scenario, the first database may be a hot database. Specifically, the hot database is used to represent a database with a high data access frequency and may be stored in a relational database.
[0055] The second task identifier refers to any task identifier associated with the first task identifier.
[0056] In the disclosed embodiment, the second task identifier is used to identify a second resource transfer task, and the second resource transfer task may be any task that requires resource transfer, wherein the second resource transfer task is used to transfer resources from a second party to a first party, with the second party serving as a resource sender and the first party serving as a resource receiver, that is, the resource transfer direction of the second resource transfer task identified by the second task identifier is opposite to the resource transfer direction of the first resource transfer task identified by the first task identifier.
[0057] S130: If not, query the task information table to see whether there is a second task identifier associated with the first task identifier.
[0058] The task information table is stored in a non-relational database and is used to record the task identifier of the successfully created second resource transfer task and the task identifier of the first resource transfer task associated with the second resource transfer task.
[0059] The task information table may be any non-relational database table. Specifically, the task information table is used to record the task identifier of the resource transfer task corresponding to the successfully created resource transfer request to prevent repeated creation of the same resource transfer task.
[0060] like Figure 2 As shown, the task information table can be written into the MiddleWare layer in the resource transfer processing system.
[0061] In the disclosed embodiment, the task information table is stored in a non-relational database, which can utilize the relatively low-cost expansion feature of the non-relational database to reduce the expansion cost of the task information table.
[0062] In practical applications, in addition to hot storage, the resource transfer processing system also includes cold storage. Specifically, the cold storage is used to represent a database with a low data access frequency and can be stored in a relational database. Usually, the performance of the cold storage is poor.
[0063] Since the performance of the cold storage is poor, the impact on the performance of the cold storage can be reduced by reducing the query frequency of the cold storage. In order to reduce the query frequency of the cold storage, in an optional implementation, if the second task identifier associated with the first task identifier does not exist in the first database, it can be determined by querying the task information table to determine whether the second task identifier associated with the first task identifier exists, that is, to determine whether the second task identifier has been successfully created. If the second task identifier is not successfully created, it indicates that there is no second resource transfer task. Therefore, there is no need to query the cold storage, thereby reducing the query frequency of the cold storage.
[0064] In an optional implementation manner, if the second task identifier associated with the first task identifier exists in the first database, the first feedback information is generated.
[0065] The first feedback information is used to represent the second resource transfer task corresponding to the existing resource transfer request.
[0066] In the disclosed embodiment, if there is a second task identifier associated with the first task identifier in the first database, it indicates that the second resource transfer task already exists in the first database. At this time, there is no need to continue to query the task information table, and it is only necessary to generate the first feedback information to prompt that the second resource transfer task already exists in the first database.
[0067] S140: If not, create a second resource transfer task and a second task identifier based on the resource transfer request, associate the second task identifier with the first task identifier and store them in the task information table, and store the second resource transfer task in the first database.
[0068] In the embodiment of the present disclosure, if the second task identifier associated with the first task identifier does not exist in the task information table, it indicates that the second resource transfer task and the second task identifier have not been created. At this time, the second resource transfer task and the second task identifier can be created according to the resource transfer request, and the second task identifier and the first task identifier can be associated and stored in the task information table, so that the second task identifier that has been successfully created can be queried in the task information table next time, so as to avoid repeated creation of the second resource transfer task. In addition, the second resource transfer task is stored in the first database to facilitate the subsequent processing of the successfully created second resource transfer task in the first database.
[0069] When the task information table is written to the middleware layer in the resource transfer processing system, since the data processing logic of the middleware layer is complex and prone to crashes, the second task identifier and the first task identifier can be associated and stored in the task information table first, and then the second resource transfer task can be stored in the first database.
[0070] In an optional implementation, the first subunit in the middleware unit is called to associate the second task identifier with the first task identifier and store it in the task information table, and the second subunit in the data processing unit is called to store the second resource transfer task in the first database.
[0071] The calling sequence of the data processing unit is after the calling sequence of the middleware unit.
[0072] In the embodiment of the present disclosure, the middleware unit may be a middleware layer in a resource transfer processing system, and accordingly, the first subunit in the middle layer unit may be any subunit in the middleware layer, and the data processing unit may be a component for processing data in the resource transfer processing system, specifically, the second subunit in the data processing unit may be any subunit in the data processing unit.
[0073] In the disclosed embodiment, the calling order of the data processing unit is placed after the calling order of the middleware unit, that is, the first subunit in the middleware unit is called first, the second task identifier and the first task identifier are associated and stored in the task information table, and then the second subunit in the data processing unit is called, and the second resource transfer task is stored in the first database. Therefore, when the second task identifier does not exist in the task information table, it can be determined that the second resource transfer task has not been created.
[0074] In the task processing method provided by the embodiment of the present disclosure, in response to a resource transfer request, a first task identifier is determined, wherein the first task identifier is the task identifier of the first resource transfer task, and the first resource transfer task is used to transfer resources from the first party to the second party, and a query is made in the first database whether there is a second task identifier associated with the first task identifier, wherein the first database stores task data whose data attributes meet the first condition, and the second task identifier is the task identifier of the second resource transfer task, and the second resource transfer task is used to transfer resources from the second party to the first party. If not, a query is made in the task information table whether there is a second task identifier associated with the first task identifier, wherein the task information table is stored in a non-relational database, and is used to record the task identifier of the successfully created second resource transfer task, and the task identifier of the first resource transfer task associated with the second resource transfer task. If not, the second resource transfer task and the second task identifier are created based on the resource transfer request, and the second task identifier and the first task identifier are associated and stored in the task information table, and the second resource transfer task is stored in the first database. According to the embodiments of the present disclosure, by recording the task identifier of the successfully created resource transfer task in the task information table, and combining it with the specific access process of first checking the first database and then checking the task information table, a global idempotent effect is achieved, which can prevent the repeated creation of the same resource transfer task to a certain extent; in addition, by storing the task information table in a non-relational database, the relatively low-cost expansion feature of the non-relational database can be utilized to reduce the expansion cost of the task information table, so that resource transfer tasks and related information within a longer period of time can be stored, supporting long-term resource transfer processing and improving user experience.
[0075] Figure 3 FIG. 2 is a flow chart of another task processing method provided by an embodiment of the present disclosure. Figure 3 As shown, the task processing method may include the following steps:
[0076] S310: In response to a resource transfer request, determine a first task identifier.
[0077] The first task identifier is a task identifier of a first resource transfer task; the first resource transfer task is used to transfer resources from a first party to a second party.
[0078] Among them, step S310 is the same as the above step S110, and the details refer to the above description of step S110.
[0079] S320: Query the first database to determine whether there is a second task identifier associated with the first task identifier.
[0080] The first database stores task data whose data attributes satisfy the first condition; the second task identifier is the task identifier of the second resource transfer task; and the second resource transfer task is used to transfer resources from the second party to the first party.
[0081] Among them, step S320 is the same as the above step S120, and the details are referred to the above description of step S120.
[0082] S330: If not, query the task information table to see whether there is a second task identifier associated with the first task identifier.
[0083] The task information table is stored in a non-relational database and is used to record the task identifier of the successfully created second resource transfer task and the task identifier of the first resource transfer task associated with the second resource transfer task.
[0084] Among them, step S330 is the same as the above step S130, and the details are referred to the above description of step S130.
[0085] S341: If it exists or the query fails, query the second database to see whether there is a second task identifier associated with the first task identifier.
[0086] The second database stores task data whose data attributes satisfy a second condition, and the second condition is mutually exclusive with the first condition.
[0087] The second database may be any database used to store task data that satisfies the second condition. The second condition may be any condition that the storage data attribute of the database needs to satisfy. Specifically, the second condition may be determined based on the data date of the task data in the database. For example, task data with a data date outside a preset period may be set as the second condition. The second condition may also be determined based on the data access frequency of the task data in the database. For example, task data whose access frequency does not exceed a preset threshold may be set as the second condition.
[0088] In the embodiment of the present disclosure, in the resource transfer processing scenario, the second data may be a cold storage. Specifically, the cold storage is used to represent a database with a low data access frequency and may be stored in a relational database.
[0089] In the disclosed embodiment, since the task information table is stored in a non-relational database, data consistency cannot be guaranteed. Therefore, when there is a second task identifier associated with the first task identifier in the task information table, it is impossible to determine whether the second resource transfer task has been created. When the query in the task information table fails, it is also impossible to determine whether the second resource transfer task corresponding to the resource transfer request has been created. Therefore, it is necessary to continue to query the second database whether there is a second task identifier associated with the first task identifier.
[0090] In an optional implementation manner, if the second task identifier associated with the first task identifier exists in the second database, the first feedback information is generated.
[0091] The first feedback information is used to represent the second resource transfer task corresponding to the existing resource transfer request.
[0092] In the disclosed embodiment, if there is a second task identifier associated with the first task identifier in the second database, it indicates that the second resource transfer task already exists in the second database. At this time, it is only necessary to generate first feedback information to prompt that the second resource transfer task already exists in the second database.
[0093] S342: If it does not exist, create a second resource transfer task and a second task identifier based on the resource transfer request, associate the second task identifier with the first task identifier and store them in the task information table, and store the second resource transfer task in the first database.
[0094] Among them, step S342 is the same as the above step S140, and the details are described in the above description of step S140.
[0095] In the task processing method provided by the embodiment of the present disclosure, in response to a resource transfer request, a first task identifier is determined, wherein the first task identifier is a task identifier of a first resource transfer task, and the first resource transfer task is used to transfer resources from a first party to a second party, and a first database is queried whether a second task identifier associated with the first task identifier exists, wherein the first database stores task data whose data attributes meet a first condition, and the second task identifier is a task identifier of a second resource transfer task, and the second resource transfer task is used to transfer resources from the second party to the first party. If not, a task information table is queried whether a second task identifier associated with the first task identifier exists, wherein the task information table is stored in a non-relational database, and is used to record the task identifier of a successfully created second resource transfer task and the task identifier of the first resource transfer task associated with the second resource transfer task. If it exists or the query fails, a second database is queried whether a second task identifier associated with the first task identifier exists, wherein the second database stores task data whose data attributes meet a second condition, and the second condition is mutually exclusive with the first condition. If not, a second resource transfer task and a second task identifier are created based on the resource transfer request, and the second task identifier and the first task identifier are associated and stored in the task information table, and the second resource transfer task is stored in the first database. According to the embodiments of the present disclosure, by recording the task identifier of the successfully created resource transfer task in the task information table, and combining it with the specific access process of first checking the first database, then checking the task information table, and finally checking the second database, a global idempotent effect is achieved, which can prevent the repeated creation of the same resource transfer task to a certain extent; in addition, by storing the task information table in a non-relational database, the relatively low-cost expansion feature of the non-relational database can be utilized to reduce the expansion cost of the task information table, so that resource transfer tasks and related information within a longer period of time can be stored, supporting long-term resource transfer processing and improving user experience.
[0096] Figure 4 FIG. 2 is a flow chart showing another task processing method provided by an embodiment of the present disclosure. Figure 4 As shown, the task processing method may include the following steps:
[0097] For ease of understanding, the first database is a hot storage and the second database is a cold storage as an example for introduction:
[0098] Specifically, after receiving the resource transfer request, the resource transfer request is parsed to obtain the task identifier of the first resource transfer task (ie, the first task identifier), and a query is made in the heat library as to whether there is a second task identifier associated with the first task identifier.
[0099] If the second task identifier associated with the first task identifier does not exist in the heat library, it is queried whether the second task identifier associated with the first task identifier exists in the task information table.
[0100] If the second task identifier associated with the first task identifier does not exist in the task information table, it indicates that the second resource transfer task and the second task identifier have not been created. The second resource transfer task and the second task identifier can be created based on the resource transfer request, and the second task identifier and the first task identifier are associated and stored in the task information table, and the second resource transfer task is stored in the hot storage.
[0101] Since the task information table is stored in a non-relational database, data consistency cannot be guaranteed. If there is a second task identifier associated with the first task identifier in the task information table or the query fails, it cannot be determined whether the second resource transfer task has been created. Therefore, you can continue to query whether there is a second task identifier associated with the first task identifier in the cold storage. If there is a second task identifier associated with the first task identifier in the cold storage, it means that the second resource transfer task already exists in the cold storage. At this time, you only need to generate the first feedback information to prompt that the second resource transfer task already exists in the second database. If there is no second task identifier associated with the first task identifier in the cold storage, create the second resource transfer task and the second task identifier based on the resource transfer request, and store the second task identifier and the first task identifier in the task information table, and store the second resource transfer task in the hot storage.
[0102] According to the embodiments of the present disclosure, by recording the task identifier of the successfully created resource transfer task in the task information table, and combining it with the specific access process of first checking the hot storage, then checking the task information table, and finally checking the cold storage, a global idempotent effect is achieved, which can prevent the repeated creation of the same resource transfer task to a certain extent; in addition, by storing the task information table in a non-relational database, the relatively low-cost expansion feature of the non-relational database can be utilized to reduce the expansion cost of the task information table, so that resource transfer tasks and related information within a longer period of time can be stored, supporting long-term resource transfer processing and improving user experience.
[0103] In some embodiments of the present disclosure, in response to a query request for a third resource transfer task, a third task identifier is determined, and a query is made in the first database as to whether the third task identifier exists. If so, second feedback information is generated. If not, a query is made in the task information table as to whether the third task identifier exists. If not, third feedback information is generated. If so, or the query fails, a query is made in the second database as to whether the third task identifier exists. If not, third feedback information is generated. If so, second feedback information is generated.
[0104] The second feedback information is used to indicate that there is a third resource transfer task, and the third feedback information is used to indicate that there is no third resource transfer task.
[0105] The third resource transfer task may be any task requiring resource transfer, such as a resource transfer task for transferring resources from a first party to a second party, a resource transfer task for transferring resources from a second party to a first party, and the like.
[0106] In the disclosed embodiment, after receiving a query request for a third resource transfer task, the query request for the third resource transfer task is parsed to determine a third task identifier of the third resource transfer task. After determining the third task identifier, a query is first performed in the first database to inquire whether the third task identifier exists in the first database. If the third task identifier exists in the first database, second feedback information is directly generated to indicate that the third resource transfer task exists in the first database. If the third task identifier does not exist in the first database, the task information table is queried to determine whether the third task identifier exists. If the third task identifier does not exist in the task information table, third feedback information is generated to indicate that the third resource transfer task does not exist. Therefore, there is no need to continue to query in the second database. If the third task identifier exists in the task information table or the query fails, it is impossible to determine whether the third transfer task has been created. Therefore, the query may continue in the second database to inquire whether the third task identifier exists in the second database. If the third task identifier does not exist in the second database, third feedback information is generated to indicate that the third resource transfer task does not exist in the second database. If the third task identifier exists in the second database, second feedback information is generated to indicate that the third resource transfer task does not exist in the second database.
[0107] For ease of understanding, the query process of the resource transfer task is introduced by taking the first database as the hot database and the second database as the cold database as an example. Figure 5 As shown, Figure 5 A flowchart of another task processing method provided by an embodiment of the present disclosure is shown.
[0108] After receiving a query request for the third resource transfer task, the third task identifier is determined. First, it is queried in the hot storage whether the third task identifier exists. If the third task identifier exists in the hot storage, the second feedback information is directly generated to indicate that the third resource transfer task exists in the hot storage. If the third task identifier does not exist in the hot storage, the task information table is queried to see whether the third task identifier exists. If the third task identifier does not exist in the task information table, the third feedback information is generated to indicate that the third resource transfer task does not exist. At this time, there is no need to continue to query in the cold storage. If the third task identifier exists in the query task information table or the query fails, you can continue to query whether the third task identifier exists in the cold storage. If the third task identifier does not exist in the cold storage, the third feedback information is generated to indicate that the third resource transfer task does not exist in the cold storage. If the third task identifier exists in the cold storage, the second feedback information is generated to indicate that the third resource transfer task exists in the cold storage.
[0109] It can be seen that the embodiment of the present disclosure can implement a query for a single specific resource transfer task based on a specific access process of first checking the first database, then checking the task information table, and finally checking the second database.
[0110] In some embodiments of the present disclosure, batch queries can also be performed on multiple resource transfer tasks. Specifically, in response to a batch query request for multiple resource transfer tasks, based on a preset time period, resource transfer tasks that meet the preset time period can be queried in the first database and the second database at the same time to implement batch queries for multiple resource transfer tasks.
[0111] In some embodiments of the present disclosure, in response to a request to process a fourth resource transfer task, a fourth task identifier is determined; if it is determined that the fourth task identifier does not exist in the first database, it is determined whether the data attribute corresponding to the fourth task identifier satisfies the first condition; if not, and it is determined that the fourth task identifier exists in the second database, the fourth resource transfer task is transferred from the second database to the first database, and the fourth resource transfer task is locked so that the fourth resource transfer task can be processed based on the first database.
[0112] The fourth resource transfer task may be any task requiring resource transfer, such as the above-mentioned resource transfer task of transferring resources from the first party to the second party, the resource transfer task of transferring resources from the second party to the first party, etc.
[0113] In the disclosed embodiment, the processing request for the fourth resource transfer task may be a processing request issued for any resource transfer task. Specifically, after receiving the processing request for the fourth resource transfer task, multiple threads in the resource transfer processing system preemptively process the fourth resource transfer task. In order to enable the fourth resource transfer task to be processed in the first database, the fourth resource transfer task may be locked in the first database so that the fourth resource transfer task can be processed in the first database.
[0114] In the disclosed embodiment, after receiving a processing request for a fourth resource transfer task, the processing request is parsed to determine the fourth task identifier, and then a query is continued to determine whether the fourth task identifier exists in the first database. If it is determined that the fourth task identifier does not exist in the first database, then a query is made to determine whether the data attribute corresponding to the fourth task identifier satisfies the first condition. If the data attribute corresponding to the fourth task identifier does not satisfy the first condition, then it indicates that the fourth resource transfer task does not satisfy the storage condition of the first database. Since the first condition and the second condition are mutually exclusive, that is, the fourth resource transfer task satisfies the storage condition of the second database, then the query is continued to determine whether the fourth task identifier exists in the second database. If it is determined that the fourth task identifier exists in the second database, then the fourth resource transfer task is transferred from the second database to the first database, and the fourth resource transfer task is locked so as to process the fourth resource transfer task based on the first database.
[0115] If the data attribute corresponding to the fourth task identifier satisfies the first condition, it indicates that the fourth resource transfer task corresponding to the fourth task identifier satisfies the storage condition of the first database. Since the first condition and the second condition are mutually exclusive, that is, the fourth resource transfer task corresponding to the fourth task identifier does not meet the storage condition of the second database, there is no need to continue to query whether the fourth task identifier exists in the second database, and directly record that the fourth resource transfer task corresponding to the fourth task identifier does not exist.
[0116] For ease of understanding, the query process of the resource transfer task is introduced by taking the first database as the hot database and the second database as the cold database as an example. Figure 6 As shown, Figure 6 A flowchart of another task processing method provided by an embodiment of the present disclosure is shown.
[0117] First, a processing request for the fourth resource transfer task is received, the processing request is parsed, the fourth task identifier is determined, and the query of whether the fourth task identifier exists in the hot storage is continued. If it is determined that the fourth task identifier does not exist in the hot storage, it is determined whether the data attribute corresponding to the fourth task identifier satisfies the first condition (such as whether it is data within 45 days). If the data attribute corresponding to the fourth task identifier does not meet the first condition, it indicates that the fourth resource transfer task does not meet the storage condition of the hot storage. Since the first condition and the second condition are mutually exclusive, that is, the fourth resource transfer task meets the storage condition of the cold storage, that is, the fourth resource transfer task may exist in the cold storage. Therefore, it is possible to continue to query whether there is a fourth task identifier in the cold storage. If it is determined that the fourth task identifier exists in the cold storage, the fourth resource transfer task is transferred from the cold storage to the hot storage, and the fourth resource transfer task is locked to process the fourth resource transfer task based on the hot storage.
[0118] If the data attribute corresponding to the fourth task identifier satisfies the first condition, it indicates that the fourth resource transfer task corresponding to the fourth task identifier satisfies the storage condition of the hot storage. Since the first condition and the second condition are mutually exclusive, that is to say, the fourth resource transfer task corresponding to the fourth task identifier does not meet the storage condition of the second database, that is, the fourth resource transfer task must not be in the cold storage. Therefore, there is no need to continue to query whether the fourth task identifier exists in the cold storage. It is only necessary to record that the fourth resource transfer task corresponding to the fourth task identifier does not exist.
[0119] Since the cold storage has poor performance and low processing efficiency, the embodiment of the present disclosure can achieve the reflux from the cold storage to the hot storage by transferring the resource transfer tasks in the cold storage to the hot storage for processing requests of resource transfer tasks, and by locking the resource transfer tasks, the resource transfer tasks are processed in the hot storage, thereby reducing the data processing volume of the cold storage to reduce the impact on the performance of the cold storage.
[0120] In some embodiments of the present disclosure, in response to an information update request for a fifth resource transfer task, a fifth task identifier is determined; if it is determined that a data attribute corresponding to the fifth task identifier does not satisfy a first condition, a query is made in the first database as to whether the fifth task identifier exists; if not, and it is determined that the fifth data identifier exists in the second database, the fifth resource transfer task is transferred from the second database to the first database, and based on the information update request, the task data of the fifth resource transfer task is updated in the first database.
[0121] The fifth resource transfer task may be any task requiring resource transfer, such as the above-mentioned resource transfer task of transferring resources from the first party to the second party, and the resource transfer task of transferring resources from the second party to the first party.
[0122] In the embodiment of the present disclosure, the information update request for the fifth resource transfer task may be a status update for the resource transfer task, for example, updating the status of the resource transfer task from "resource transfer in progress" to "processing".
[0123] In the disclosed embodiment, after receiving an information update request for the fifth resource transfer task, the information update request is parsed to determine the fifth task identifier. First, it is determined whether the data attribute corresponding to the fifth task identifier satisfies the first condition (such as whether it is data within 45 days). When it is determined that the data attribute corresponding to the fifth task identifier does not satisfy the first condition, it indicates that the fifth resource transfer task does not satisfy the storage condition of the first database. Although the fifth resource transfer task does not satisfy the storage condition of the first database, the fifth resource transfer task can be a resource transfer task transferred from the second database to the first database. Therefore, it is possible to query the first database whether there is a fifth task identifier. If the first database does not have the fifth task identifier, and it is determined that the fifth data identifier exists in the second database, the fifth resource transfer task is transferred from the second database to the first database. Based on the information update request, the task data of the fifth resource transfer task is updated in the first database.
[0124] If it is determined that the data attribute corresponding to the fifth task identifier satisfies the first condition, that is, the fifth resource transfer task satisfies the storage condition of the first database, then it indicates that the fifth resource transfer task is in the first database or the fifth resource transfer task does not exist. Specifically, if the fifth resource transfer task is in the first database, the task data of the fifth resource transfer task is updated in the first database directly based on the information update request. If the fifth resource transfer task does not exist, an error can be directly reported in the information update link.
[0125] For ease of understanding, the query process of the resource transfer task is introduced by taking the first database as the hot database and the second database as the cold database as an example. Figure 7 As shown, Figure 7 A flowchart of another task processing method provided by an embodiment of the present disclosure is shown.
[0126] In the disclosed embodiment, after receiving an information update request for the fifth resource transfer task, the information update request is parsed to determine the fifth task identifier. First, it is determined whether the data attribute corresponding to the fifth task identifier satisfies the first condition (such as if it is not data within 45 days). When it is determined that the data attribute corresponding to the fifth task identifier does not satisfy the first condition, it indicates that the fifth resource transfer task does not meet the storage conditions of the hot storage. Although the fifth resource transfer task does not meet the storage conditions of the hot storage, the fifth resource transfer task can be a resource transfer task transferred from the cold storage to the hot storage. Therefore, it is possible to query whether the hot storage has the fifth task identifier. If the hot storage does not have the fifth task identifier, it is possible to continue to determine whether the fifth data identifier exists in the cold storage. If it is determined that the fifth data identifier exists in the cold storage, the fifth resource transfer task is transferred from the cold storage to the hot storage. Based on the information update request, the task data of the fifth resource transfer task is updated in the hot storage.
[0127] If it is determined that the data attribute corresponding to the fifth task identifier satisfies the first condition, that is, the fifth resource transfer task satisfies the storage condition of the hot storage, it indicates that the fifth resource transfer task is in the hot storage or the fifth resource transfer task does not exist. Specifically, if the fifth resource transfer task is in the first database, the task data of the fifth resource transfer task is updated in the first database directly based on the information update request. If the fifth resource transfer task does not exist, an error can be directly reported in the information update link.
[0128] Since the performance of the cold storage is poor and the processing efficiency is low, the embodiment of the present disclosure can achieve the reflux from the cold storage to the hot storage by transferring the resource transfer tasks in the cold storage to the hot storage, thereby reducing the data processing volume of the hot storage.
[0129] The following is an embodiment of a task processing device provided by an embodiment of the present invention. The device and the task processing methods of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the task processing device, reference can be made to the embodiment of the above task processing method.
[0130] Figure 8 FIG. 1 is a schematic diagram showing a structure of a task processing device provided by an embodiment of the present disclosure. Figure 8 As shown, the task processing device 800 may include:
[0131] A first determination module 801 is used to determine a first task identifier in response to a resource transfer request; wherein the first task identifier is a task identifier of a first resource transfer task; and the first resource transfer task is used to transfer resources from a first party to a second party;
[0132] A first query module 802 is used to query whether there is a second task identifier associated with the first task identifier in a first database; wherein the first database stores task data whose data attributes satisfy a first condition; the second task identifier is a task identifier of a second resource transfer task; and the second resource transfer task is used to transfer the resource from the second party to the first party;
[0133] A second query module 803 is used to query whether there is a second task identifier associated with the first task identifier in the task information table if it does not exist; wherein the task information table is stored in a non-relational database and is used to record the task identifier of the second resource transfer task that is successfully created, and the task identifier of the first resource transfer task associated with the second resource transfer task;
[0134] The first storage module 804 is used to create the second resource transfer task and the second task identifier based on the resource transfer request if they do not exist, and store the second task identifier and the first task identifier in the task information table in association, and store the second resource transfer task in the first database.
[0135] In an optional implementation, the device further includes:
[0136] A third query module, for querying whether the second task identifier associated with the first task identifier exists in a second database if the second task identifier exists or the query fails; wherein the second database stores task data whose data attributes satisfy a second condition; the second condition is mutually exclusive with the first condition;
[0137] The second storage module is used to create the second resource transfer task and the second task identifier based on the resource transfer request if it does not exist, and store the second task identifier and the first task identifier in the task information table in association, and store the second resource transfer task in the first database.
[0138] In an optional implementation, the device further includes:
[0139] The first generating module is configured to generate first feedback information if it exists; wherein the first feedback information is used to indicate that the second resource transfer task corresponding to the resource transfer request already exists.
[0140] In an optional implementation, the first storage module 804 includes a creation submodule and a first storage submodule, the creation submodule is used to create the second resource transfer task and the second task identifier based on the resource transfer request;
[0141] The first storage submodule is used to associate the second task identifier with the first task identifier and store it in the task information table, and store the second resource transfer task in the first database;
[0142] The first storage submodule includes:
[0143] A second storage submodule is used to call the first subunit in the middleware unit to associate the second task identifier with the first task identifier and store it in the task information table;
[0144] The third storage submodule is used to call the second subunit in the data processing unit to store the second resource transfer task in the first database; wherein the calling sequence of the data processing unit is after the calling sequence of the middleware unit.
[0145] In an optional implementation, the device further includes:
[0146] a second determining module, configured to determine a third task identifier in response to a query request for the third resource transfer task;
[0147] A fourth query module, used for querying whether the third task identifier exists in the first database;
[0148] A second generating module, configured to generate second feedback information if the third resource transfer task exists; wherein the second feedback information is used to indicate the existence of the third resource transfer task;
[0149] A fifth query module, configured to query whether the third task identifier exists in the task information table if the third task identifier does not exist;
[0150] A third generating module is used to generate third feedback information if the third resource transfer task does not exist; wherein the third feedback information is used to indicate that the third resource transfer task does not exist;
[0151] A sixth query module, configured to query whether the third task identifier exists in the second database if the third task identifier exists or the query fails;
[0152] a fourth generating module, configured to generate the third feedback information if the third feedback information does not exist;
[0153] A fifth generating module is configured to generate the second feedback information if the second feedback information exists.
[0154] In an optional implementation, the device further includes:
[0155] a third determining module, configured to determine a fourth task identifier in response to a processing request for a fourth resource transfer task;
[0156] a fourth determination module, configured to determine whether a data attribute corresponding to the fourth task identifier satisfies the first condition if it is determined that the fourth task identifier does not exist in the first database;
[0157] The first transfer module is used to transfer the fourth resource transfer task from the second database to the first database and lock the fourth resource transfer task if no and it is determined that the fourth task identifier exists in the second database, so as to process the fourth resource transfer task based on the first database.
[0158] In an optional implementation, the device further includes:
[0159] a fifth determining module, configured to determine a fifth task identifier in response to an information update request for a fifth resource transfer task;
[0160] a seventh query module, configured to query the first database whether the fifth task identifier exists if it is determined that the data attribute corresponding to the fifth task identifier does not satisfy the first condition;
[0161] A second transfer module, configured to transfer the fifth resource transfer task from the second database to the first database if no and it is determined that the fifth data identifier exists in the second database;
[0162] An updating module is used to update the task data of the fifth resource transfer task in the first database based on the information update request.
[0163] The task processing device provided in the embodiment of the present invention can execute the task processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0164] It is worth noting that in the embodiment of the above-mentioned task processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present disclosure.
[0165] The embodiment of the present disclosure also provides a task processing device, which may include a processor and a memory, wherein the memory may be used to store executable instructions. The processor may be used to read the executable instructions from the memory and execute the executable instructions to implement the task processing method in the above embodiment.
[0166] Fig. 9 A structural schematic diagram of a task processing device provided by an embodiment of the present disclosure is shown.
[0167] like Fig. 9 As shown, the task processing device 900 may include a processing device 901 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903. Various programs and data required for the operation of the task processing device 900 are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output interface (I / O interface) 905 is also connected to the bus 904.
[0168] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the task processing device 900 to communicate with other devices wirelessly or by wire to exchange data.
[0169] It should be noted that Fig. 9 The task processing device 900 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure. Fig. 9 The task processing device 900 having various devices is shown, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.
[0170] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the task processing method of any embodiment of the present disclosure are executed.
[0171] An embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the task processing method in any embodiment of the present disclosure.
[0172] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0173] In some embodiments, the client and server may communicate using any currently known or future developed network protocol such as HTTP, and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0174] The computer-readable medium may be included in the task processing device; or may exist independently without being assembled into the task processing device.
[0175] The computer-readable medium carries one or more programs. When the one or more programs are executed by the task processing device, the task processing device executes the steps of the task processing method described in any embodiment of the present disclosure.
[0176] In embodiments of the present disclosure, computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0177] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0178] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0179] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0180] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0181] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0182] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A task processing method, characterized in that: include: In response to the resource transfer request, determining a first task identifier; wherein the first task identifier is a task identifier of a first resource transfer task; the first resource transfer task is used to transfer resources from a first party to a second party; querying a first database for whether there is a second task identifier associated with the first task identifier; wherein the first database stores task data whose data attributes satisfy a first condition; the second task identifier is a task identifier of a second resource transfer task; and the second resource transfer task is used to transfer the resource from the second party to the first party; If not, query whether there is the second task identifier associated with the first task identifier in the task information table; wherein the task information table is stored in a non-relational database and is used to record the task identifier of the second resource transfer task that is successfully created, and the task identifier of the first resource transfer task associated with the second resource transfer task; If not, the second resource transfer task and the second task identifier are created based on the resource transfer request, and the second task identifier and the first task identifier are associated and stored in the task information table, and the second resource transfer task is stored in the first database.
2. The method according to claim 1, characterized in that After checking whether there is the second task identifier associated with the first task identifier in the query task information table, the method further includes: If it exists or the query fails, query whether there is the second task identifier associated with the first task identifier in the second database; wherein the second database stores task data whose data attributes meet the second condition; the second condition is mutually exclusive with the first condition; If not, the second resource transfer task and the second task identifier are created based on the resource transfer request, and the second task identifier and the first task identifier are associated and stored in the task information table, and the second resource transfer task is stored in the first database.
3. The method according to claim 2, characterized in that After querying the first database or the second database whether the second task identifier associated with the first task identifier exists, the method further includes: If so, first feedback information is generated; wherein the first feedback information is used to indicate that the second resource transfer task corresponding to the resource transfer request already exists.
4. The method according to claim 1 or 2, characterized in that: The associating and storing the second task identifier and the first task identifier in the task information table, and storing the second resource transfer task in the first database, includes: calling a first subunit in the middleware unit to associate the second task identifier with the first task identifier and store them in the task information table; The second subunit in the data processing unit is called to store the second resource transfer task in the first database; wherein the calling sequence of the data processing unit is after the calling sequence of the middleware unit.
5. The method according to claim 1, characterized in that The method further comprises: In response to a query request for a third resource transfer task, determining a third task identifier; Querying the first database whether the third task identifier exists; If so, generating second feedback information; wherein the second feedback information is used to indicate the existence of the third resource transfer task; If not, querying whether the third task identifier exists in the task information table; If not, generating third feedback information; wherein the third feedback information is used to indicate that the third resource transfer task does not exist; If it exists or the query fails, query whether the third task identifier exists in the second database; If not present, generating the third feedback information; If so, the second feedback information is generated.
6. The method according to claim 1, characterized in that The method further comprises: In response to the processing request for the fourth resource transfer task, determining a fourth task identifier; If it is determined that the fourth task identifier does not exist in the first database, determining whether the data attribute corresponding to the fourth task identifier satisfies the first condition; If not, and it is determined that the fourth task identifier exists in the second database, the fourth resource transfer task is transferred from the second database to the first database, and the fourth resource transfer task is locked to process the fourth resource transfer task based on the first database.
7. The method according to claim 1, characterized in that The method further comprises: In response to the information update request for the fifth resource transfer task, determining a fifth task identifier; If it is determined that the data attribute corresponding to the fifth task identifier does not satisfy the first condition, querying the first database whether the fifth task identifier exists; If not, and it is determined that the fifth data identifier exists in the second database, transferring the fifth resource transfer task from the second database to the first database; Based on the information update request, task data of the fifth resource transfer task is updated in the first database.
8. A task processing device, characterized in that: include: A first determination module, configured to determine a first task identifier in response to a resource transfer request; wherein the first task identifier is a task identifier of a first resource transfer task; and the first resource transfer task is used to transfer resources from a first party to a second party; A first query module is used to query whether there is a second task identifier associated with the first task identifier in a first database; wherein the first database stores task data whose data attributes satisfy a first condition; the second task identifier is a task identifier of a second resource transfer task; and the second resource transfer task is used to transfer the resource from the second party to the first party; a second query module, configured to query whether there is a second task identifier associated with the first task identifier in a task information table if the second task identifier does not exist; wherein the task information table is stored in a non-relational database and is configured to record the task identifier of the second resource transfer task that is successfully created and the task identifier of the first resource transfer task associated with the second resource transfer task; The first storage module is used to create the second resource transfer task and the second task identifier based on the resource transfer request if it does not exist, and associate the second task identifier with the first task identifier and store them in the task information table, and store the second resource transfer task in the first database.
9. A task processing device, characterized in that: include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the task processing method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the processor implements the task processing method described in any one of claims 1 to 7.