A business processing method and a business processing device
By combining the data query method of cache cluster and business system, it solves the problems of slow data query and query result error in high concurrency scenarios in the financial industry, achieves fast and accurate data query, and improves user experience and system performance.
Patent Information
- Application Number
- CN202410938878.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-12
AI Technical Summary
Business processing platforms in the financial industry, in scenarios with high concurrency, real-time dependence and strong data correlation, lead to slow data queries and errors in query results.
By receiving the query request sent by the terminal, it is determined whether the query target information meets specific conditions. If it meets the requirements, the data will be obtained from the cache cluster. If not, the data will be obtained from the business system. Combining the data query methods of the cache cluster and business system, it will reduce user waiting. Time-consuming and ensuring data accuracy.
It significantly reduces the user's query waiting time, reduces the number of request calls to the business system, ensures the normal display and accuracy of data, and improves query efficiency and user experience.
Smart Images

Figure CN118503295B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a service processing method and a service processing device. Background Art
[0002] In the existing technology, digitalization is the transformation direction of the financial industry's business processing platform. With the continuous expansion of personal business, the number of personal channel users has increased significantly. In order to meet the needs of different customer groups, various asset services are also continuously launched. For example, mobile banking provides aggregate query functions for various businesses, assets, and income. Such business scenarios often have the characteristics of high timeliness and concurrency. Therefore, it is necessary to provide a processing method to solve the problems of slow data query and errors in query results caused by the large concurrency requirements, high real-time dependence, and strong data correlation rationality of such business scenarios. Summary of the invention
[0003] The present disclosure provides a service processing method, a service processing device, an electronic device and a storage medium to at least solve the above technical problems existing in the prior art.
[0004] In a first aspect, an embodiment of the present disclosure provides a service processing method, the method comprising:
[0005] Receiving a first query request sent by a first terminal;
[0006] Determine query target information according to the first query request, and determine whether the query target information meets a first condition;
[0007] If the query target information satisfies the first condition, first data is obtained from the cache cluster according to the query target information; whether the first data satisfies the second condition is determined, if the first data satisfies the second condition, the query result is determined according to the first data; if the first data does not satisfy the second condition, second data is obtained from the business system according to the query target information, and the query result is determined according to the first data and the second data;
[0008] If the query target information does not satisfy the first condition, obtaining third data from the business system according to the query target information, and determining the query result according to the third data;
[0009] The query result is sent to the first terminal.
[0010] In a second aspect, an embodiment of the present disclosure provides a service processing device, including:
[0011] A receiving module, configured to receive a first query request sent by a first terminal;
[0012] A first processing module, configured to determine query target information according to the first query request, and determine whether the query target information satisfies a first condition;
[0013] If the query target information satisfies the first condition, first data is obtained from the cache cluster according to the query target information; whether the first data satisfies the second condition is determined, if the first data satisfies the second condition, the query result is determined according to the first data; if the first data does not satisfy the second condition, second data is obtained from the business system according to the query target information, and the query result is determined according to the first data and the second data;
[0014] If the query target information does not satisfy the first condition, obtaining third data from the business system according to the query target information, and determining the query result according to the third data;
[0015] A sending module is used to send the query result to the first terminal.
[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present disclosure.
[0020] In a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method described in the present disclosure.
[0021] The business processing method, business processing device, electronic device and storage medium provided by the embodiment of the present disclosure include: receiving a first query request sent by a first terminal; determining query target information according to the first query request, and determining whether the query target information satisfies a first condition; if the query target information satisfies the first condition, obtaining first data from a cache cluster according to the query target information; determining whether the first data satisfies a second condition, if the first data satisfies the second condition, determining a query result according to the first data, if the first data does not satisfy the second condition, obtaining second data from a business system according to the query target information, and determining a query result according to the first data and the second data; if the query target information does not satisfy the first condition, obtaining third data from a business system according to the query target information, and determining a query result according to the third data; and sending the query result to the first terminal. In this way, the query method from the cache cluster and the query method from the business system are combined, which greatly reduces the query waiting time of the user, decouples the business, reduces the request call volume of the business system, and ensures the normal display of data in abnormal situations.
[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A flowchart of a business processing method provided by an embodiment of the present disclosure;
[0024] Figure 2 A flowchart of a data updating method provided by an application embodiment of the present disclosure;
[0025] Figure 3 A flowchart of another data linkage update method provided by an application embodiment of the present disclosure;
[0026] Figure 4 A schematic diagram of a data cache cluster provided for an application embodiment of the present disclosure;
[0027] Figure 5 A flowchart of a business processing method provided by an application embodiment of the present disclosure;
[0028] Figure 6 A schematic diagram of the structure of a service processing device provided in an embodiment of the present disclosure;
[0029] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0031] Figure 1 A flowchart of a business processing method provided by an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the method includes:
[0032] Step 101: receiving a first query request sent by a first terminal;
[0033] Step 102: determining query target information according to the first query request, and determining whether the query target information satisfies a first condition;
[0034] Step 103: if the query target information satisfies the first condition, obtain first data from the cache cluster according to the query target information; determine whether the first data satisfies the second condition; if the first data satisfies the second condition, determine the query result according to the first data; if the first data does not satisfy the second condition, obtain second data from the business system according to the query target information, and determine the query result according to the first data and the second data;
[0035] Step 104: if the query target information does not satisfy the first condition, obtain third data from the business system according to the query target information, and determine the query result according to the third data;
[0036] Step 105: Send the query result to the first terminal.
[0037] In some embodiments, the method is applied to an electronic device, and the electronic device may be a device having data processing, data interaction and other capabilities, for example, the electronic device may be a computer, a server, and the like.
[0038] The electronic device may include a service processing module, and the service processing module is used to execute the service processing method.
[0039] In some embodiments, the first terminal is a terminal held by a user, and the user can operate through a human-computer interaction interface provided by the first terminal to input a first query request.
[0040] Specifically, the first terminal may be installed with a client, and interact with the electronic device through the client. For example, the client may be a mobile phone application APP (Application).
[0041] Receiving a first query request sent by a first terminal includes: receiving the first query request sent by a client of the first terminal.
[0042] The first query request may be used to query any kind of business, and may also be used to query asset data corresponding to the business owned by the user; for example, the first query request is a request to query deposit status, a request to query financial management status, etc.
[0043] In some embodiments, the cache cluster includes: a first cache group and a second cache group;
[0044] The first cache group includes product asset data of each business in at least one business and an update timestamp of the product asset data;
[0045] The second cache group includes personal asset data of each user of at least one user and an update timestamp of the personal asset data.
[0046] Here, the services and users saved in the cache cluster are services and users with cache permissions. Services with cache permissions are recorded as first-category services, and users with cache permissions are recorded as first-category users; services without cache permissions are recorded as second-category services, and users without cache permissions are recorded as second-category users.
[0047] In some embodiments, determining the query target information according to the first query request and determining whether the query target information satisfies a first condition includes:
[0048] Determine query target information according to the first query request, the query target information including: a target user and a target business;
[0049] Determining whether the query target information meets the first condition according to the preset business processing rules, the target user and the target business;
[0050] Accordingly, the query target information satisfies the first condition, including:
[0051] Determining, according to the preset service processing rule, that the target user is a first-category user and that the target service is a first-category service;
[0052] The query target information does not meet the first condition, including at least one of the following:
[0053] Determining, according to the preset business processing rule, that the target business is a second-category business;
[0054] Determining, according to the preset service processing rule, that the target service is a first-category service or a second-category service, and that the target user is a second-category user;
[0055] The preset service processing rule is used to indicate at least one first-category service and / or at least one first-category user;
[0056] The first type of business is a business in which product asset data is stored in the cache cluster;
[0057] The first category of users are users whose personal asset data is stored in the cache cluster.
[0058] Specifically, the target query information includes:
[0059] Target user, the target user may be represented by a unique user identity;
[0060] The target business may be represented by a business name, a business number, etc.
[0061] Specifically, the preset service processing rule is used to indicate at least one first-category service and / or at least one first-category user; for example, the preset service processing rule indicates the following information:
[0062] Business 1, Business 2, Business 3, etc. are the first type of business;
[0063] Business 4 and Business 5 are the second type of business;
[0064] User 1, User 2, User 3, etc. are the first type of users;
[0065] User four, user five, etc. are the second type of users.
[0066] For example, the first type of business is the business that can be cached, such as: funds, financial management, trusts, deposits, insurance, electronic treasury bonds, precious metals, and commercial pension insurance;
[0067] The second type of business is real-time query business, such as: direct sales, over-the-counter bonds, credit cards, loans, personal pensions, etc.
[0068] Of course, the preset business processing rules can be set based on the users, businesses, etc. involved in the actual application scenario, and are not limited here.
[0069] After determining the query target information (including the target user and the target service) according to the first query request, it is determined whether the query target information meets the first condition according to the preset service processing rule.
[0070] Here, it is determined whether the query target information satisfies the first condition, that is, it is determined whether the data requested by the first query request is obtained from the cache cluster or from the business system.
[0071] If the query target information does not meet the first condition, it can be determined that the query data requested by the first query request is obtained from the business system. Therefore, third data can be obtained from the business system according to the query target information, and the query result can be determined according to the third data.
[0072] If the query target information satisfies the first condition, it can be determined that the query data requested by the first query request can be obtained from the cache cluster. Therefore, the first data can be obtained from the cache cluster according to the query target information, and then the query result can be determined.
[0073] In some embodiments, the first data includes: product data and user data, and determining whether the first data satisfies the second condition includes:
[0074] Determining a first update time corresponding to the user data;
[0075] Determining a second update time corresponding to the product data;
[0076] Determine a sequence relationship between the first update time and the second update time;
[0077] Accordingly, the first data satisfies the second condition, including: the first update time is after the second update time;
[0078] The first data does not satisfy a second condition, including: the first update time is before the second update time.
[0079] Specifically, when obtaining data from the cache cluster, customer-level cache data (ie, user data) and product-level cache data (ie, product data) may be obtained simultaneously.
[0080] The cached data at the product level corresponds to (or contains) the timestamp of publishing or updating;
[0081] The client-level cache data corresponds to (or contains) the timestamp of publishing or updating;
[0082] Compare the time information of the product-level cache data with the customer-level cache data to determine whether the data obtained from the cache cluster is valid or whether the data is questionable. If the data is invalid or questionable, it is necessary to obtain real-time data from the business system to ensure data accuracy.
[0083] In some embodiments, determining whether the first data satisfies the second condition further includes:
[0084] Determining whether the user data corresponds to an invalidation label;
[0085] Accordingly, the first data satisfies the second condition, further comprising: the user data has no corresponding invalidation label;
[0086] The first data does not satisfy the second condition, and further includes: the user data corresponds to an invalid label.
[0087] Specifically, when using user data in the cache cluster as the result, the timeliness of the user data needs to be considered. In actual application, an invalidation label can be added to the user data according to the specific situation. If the user data corresponds to an invalidation label, it is considered that the user data in the current cache cluster is questionable or may be abnormal data.
[0088] The invalidation tag is a tag added during the user data update process, which is used to reflect whether the current data is questionable or may be abnormal data.
[0089] Here, the update time and label can be combined to make a judgment. If the product-level time (i.e., the second update time) is newer, the cached data is considered invalid, and the asset data is queried and compared again through the real-time interface.
[0090] If the customer-level data (i.e., the second update time) is newer, it is further divided into two situations. Specifically, it is necessary to determine whether it is stage one. Stage one is the stage where the cached data is marked as invalid and has not yet been asynchronously refreshed to write the latest data. If so, the latest data will be obtained from the business system through the real-time interface; if not, the cached data is considered valid and the cached data in the cache cluster is read directly.
[0091] In some embodiments, acquiring second data from a business system according to the query target information, and determining a query result according to the first data and the second data includes:
[0092] Determining a first business system according to the query target information;
[0093] Sending a second query request to the first business system through a real-time interface, wherein the second query request is used to request the first business system to feedback the latest data of the target user;
[0094] receiving second data sent by the first business system, where the second data includes the latest data of the target user;
[0095] A query result is determined according to the first data and the second data.
[0096] Specifically, the query target information also includes: a first tag and a second tag;
[0097] The first tag is used to mark the data source, and the data source may be the business system that generates the data;
[0098] The second tag is used to mark the data type, which can be used to distinguish whether it is a customer or a business. If it is a customer, it means that the data is the data of the customer's asset changes. If it is a business, it means that the data is the data of the product asset changes corresponding to the business. If it is a customer, it can also be specifically distinguished into specific types such as deposits, financial management, and total assets.
[0099] Here, determining the first business system according to the query target information includes:
[0100] Determine a first tag according to the query target information;
[0101] A first business system corresponding to the first tag is determined according to the first relationship table.
[0102] The first relationship table is pre-set and stored in the electronic device, and the first relationship table includes at least one tag and a business system corresponding to each tag. The business system may include: a consignment system, a core system, etc. For example, the consignment system may be a system for consignment sales of a certain type of financial management, and the core system may be a system for a bank to perform data settlement and other total processing.
[0103] Here, the first business system provides a real-time interface, and the business processing module can send a request to the first business system through the real-time interface and receive feedback results immediately. Therefore, a second query request can be sent to the first business system through the real-time interface, wherein the second query request carries a user identifier and a specific category to inform the first business terminal of the specific user to be queried and the content to be queried.
[0104] In some embodiments, the method further comprises:
[0105] If second data fed back by the first business system is received, determining a first update request according to the second data;
[0106] A first update request is sent to the cache cluster, where the first update request is used to request the cache cluster to update user data corresponding to the target user.
[0107] Here, if a second query request is sent to the first business system, it indicates that the data in the cache cluster is considered to be questionable. Therefore, after receiving the latest data (i.e., the second data) fed back in real time by the first business system, a first update request containing or carrying the second data is sent to the cache cluster, so that the cache cluster updates the user data corresponding to the target user according to the second data.
[0108] Furthermore, when updating, the timestamp of the updated user data is updated to reflect the timeliness of the updated data, so that in subsequent queries, it can be determined whether the user data is questionable or available based on the timestamp.
[0109] In some embodiments, the method further comprises:
[0110] Receiving data change information sent by the second business system, the data change information including: user change data and / or business change data;
[0111] Determine, according to a preset business processing rule, the changed data of the first category of business and / or the changed data of the first category of users in the data change information;
[0112] If the data change information includes the change data of the first type of business, updating the product asset information corresponding to the business in the cache cluster according to the change data of the first type of business;
[0113] If the data change information includes the changed data of the first category of users, a first invalidation instruction is sent to the cache cluster; an asynchronous refresh is performed according to the user identifier of the first category of users and the changed data of the first category of users to obtain an asynchronous refresh result; according to the asynchronous refresh result, the personal asset information corresponding to the user in the cache cluster is updated, and the invalidation label is deleted; wherein the first invalidation instruction is used to instruct the cache cluster to add an invalidation label to the user data.
[0114] In some embodiments, performing asynchronous refreshing according to the user identifiers of the first category of users and the changed data of the first category of users to obtain the asynchronous refreshing result includes:
[0115] Determining, according to the changed data of the first category of users, a service type corresponding to the changed data and at least one third service system;
[0116] Sending a second update request to each third business system according to the user identifier of the first category of users to perform asynchronous refresh;
[0117] Receive the asynchronous refresh result fed back by each third business system, and update the personal asset information corresponding to the user in the cache cluster according to the asynchronous refresh result corresponding to each business type;
[0118] and / or,
[0119] Receive asset update data sent by the fourth business system, and update personal asset information corresponding to the user in the cache cluster according to the asset update data.
[0120] Specifically, the second business system may actively send data change information. When the business processing module receives the data change information, it needs to update the data in the cache cluster according to the data change information.
[0121] Here, the preset service processing rule is used to indicate at least one first-category service and / or at least one first-category user;
[0122] After receiving the data change message, each user and / or service included therein is matched with the first type of service and the first type of user indicated in the preset service processing rule to determine whether the data change information contains changed data of the first type of service and changed data of the first type of user.
[0123] For the changed data of the first type of business included in the data change information, the product asset information corresponding to the business in the cache cluster is updated according to the changed data of the first type of business; and the timestamp of the product asset information is updated.
[0124] For the changed data of the first category of users included in the data change information, the user data update in the cache cluster is divided into multiple stages, and each stage represents the invalidation or update of a part of the data. Specifically, it may include: sending a first invalidation instruction to the cache cluster to invalidate the user data related to the changed data; at the same time, performing asynchronous refresh according to the user identification of the first category of users and the changed data of the first category of users to obtain an asynchronous refresh result; according to the asynchronous refresh result, updating the personal asset information corresponding to the user in the cache cluster, deleting the invalidation label, and updating the timestamp of the personal asset information. In this way, the situation of data feedback errors caused by users querying related data during the data update process is avoided.
[0125] Through the above method, the specific business processing logic is isolated from the customer access, and black box access to the data is realized; through the business processing module and the cache cluster, the impact of business system anomalies on the overall business is reduced. Compared with the use of multi-threaded concurrent query business system, the method provided by the embodiment of the present disclosure directly reads the cache cluster when the user requests the relevant asset data, and then combines a small amount of real-time data, thereby reducing the interaction between the user and the specific business system, improving the query efficiency, and improving the user experience.
[0126] Provide an application embodiment, such as Figure 2 As shown, the data updating method comprises:
[0127] When asset-related data changes, the business system sends the data change information to the business processing module through the first message queue; wherein the business system includes: core system, agency sales system, etc., and the agency sales system includes systems for financial management, funds and other businesses;
[0128] The business processing module performs data cleaning on the user's changed data and / or the business's changed data in the data change information based on the first data cleaning rule;
[0129] During the data cleaning process, type judgment is performed based on the user's changed data and / or the business's changed data, and the first operation or the second operation is performed based on the judgment result to update the data in the cache cluster.
[0130] The cache cluster adopts HBASE (Hadoop Database, Hadoop database, a distributed storage system) cluster. The HBASE cluster includes: product cache (equivalent to an example of a first cache group) and user cache (equivalent to an example of a second cache group).
[0131] The first operation includes:
[0132] For the changed data of the business, the changed data of the business is sent to the relational database service (RDS) platform through the second message queue, and the changed data of the business is sent to the cache cluster through the RDS platform; the cache cluster updates the product asset information corresponding to the business according to the changed data of the business.
[0133] For the user's changed data, asynchronous refresh is performed in conjunction with the business system, and the personal asset information corresponding to the user in the cache cluster is updated according to the asynchronous refresh results.
[0134] Among them, the first message queue can use SofaMQ middleware, a distributed message middleware; the second message queue can use Kafka middleware, a distributed publish-subscribe message system.
[0135] Regarding asynchronous refresh in combination with the business system, updating the personal asset information corresponding to the user in the cache cluster according to the asynchronous refresh result, a specific application embodiment is provided, such as Figure 3 As shown, taking the business system including the agency sales system and the core system as an example, the data linkage update method includes:
[0136] The agency sales system manages the sales and financial management, generates transaction files, and sends the transaction files to the core system;
[0137] The core system modifies customer accounts in batches according to transaction files, generates reconciliation files after batch processing, and sends the reconciliation files to the agency sales system;
[0138] At the same time, after modifying the customer accounts in batches, data change information is generated, and the data change message is sent to the business processing module through the first message queue (such as SofaMQ middleware); the data change information includes: the user's changed data, specifically deposit data, the corresponding first label can be the core system, and the second label can be the deposit;
[0139] The business processing module cleans the user's changed data based on the first data cleaning rule. If it is determined that the deposit data has changed during the data cleaning process, the business processing module sends a first invalidation instruction to the cache cluster through the second message queue (such as Kafka middleware) and the RDS platform to instruct the cache cluster to add an invalidation tag to the user data, or to instruct the cache cluster to add an invalidation tag to the deposit data and financial management data in the user data; the cache cluster marks the invalidation according to the first invalidation instruction;
[0140] At the same time, the asynchronous refresh operation is performed, including: sending a second update request to the core system to perform asynchronous refresh; receiving the asynchronous refresh result fed back by the core system, including the latest deposit data; updating the deposit asset cache in the personal asset information corresponding to the user in the cache cluster according to the latest deposit data;
[0141] In the above process, the agency system will update the assets, and after the update, it will actively send data change information to the business processing module. The data change information includes: the user's changed data, specifically financial management data, the corresponding first label can be the agency system, and the second label can be financial management; after receiving the financial management data, the business processing module performs data cleaning based on the second data cleaning rule, and executes the second asynchronous refresh operation, including: sending a second update request to the agency system for asynchronous refresh; receiving the asynchronous refresh results fed back by the agency system, including the latest financial management data; according to the latest financial management data, updating the financial asset cache in the personal asset information corresponding to the user in the cache cluster.
[0142] In this way, cache preheating capability is provided. In order to optimize the waiting experience of users when accessing, the detailed data in the position data is asynchronously refreshed through the data cleaning link in the message push. When the interface makes an access request through the external real-time interface, the latest data is directly displayed.
[0143] When the business processing module identifies changes in the corresponding asset data during the data cleaning phase, it first sets the timestamp mark in the cache cluster to invalid in real time, and then calls the real-time interface to obtain the latest user data and refresh the cache, which improves the waiting experience of user access and ensures the accuracy of the data.
[0144] Through the method provided by the embodiment of the present disclosure, the consistency of all data is ensured, the impact of data inconsistency caused by message link delay is reduced, and in the processing logic fragment where the data cache fails, the related business data is bound and associated, thereby ensuring the consistency of data display.
[0145] Specifically, there are specially marked tags in the data change information (such as the first tag and the second tag mentioned above). For example, the transaction data push of financial management will be delayed, and there is a time difference with the account dynamic push data in the core system. When the identification tag determines that the data type of the data change information is a deposit, the deposit position cache data will be set to an expired state, and the financial management position data will also be set to pending verification (i.e., stage one, stage one, stage two, and stage three in the figure are used to illustrate the stages of invalidation or update of some data). If the user logs in and requests to query deposits and financial management during this period, there is a situation where the cached data is questionable. Here, by switching to a real-time query operation (i.e., an asynchronous refresh operation), until the message push of the agency sales system and the core system is received, the accurate data pushed will be fed back to the user, and the cached data will be refreshed (i.e., the update of stage two and stage three is completed). Avoid the situation where the user accesses in stage two because the financial management push has not been sent yet, and the data in the latest cache data obtained from the cache cluster is abnormal data (at this time, the deposit in the cache data is correct data, and the financial management is wrong data).
[0146] In this way, the cache data in the cache cluster and the real-time data in the business system are processed jointly. Combined with the cache cluster, there is no need to query data from the business system every time, which greatly reduces the user's query waiting time. Taking financial management customers with heavy holdings as an example, the asset query time can be reduced from more than 2 seconds to less than 500 milliseconds, a reduction of 75%. In addition, business decoupling is achieved to protect the back-end business system, which can reduce the request call volume to the back-end business system by about 70% and ensure the normal display of data in abnormal situations. In addition, the throughput (TPS, Transactions Per Second) is improved and the demand for hardware resources is reduced. After using the combination of cache and real-time, the throughput of a single server can be increased by about 58%, reducing the budget demand for expansion.
[0147] Figure 4 A schematic diagram of a cache cluster provided for an application embodiment of the present disclosure; Figure 4 As shown, the cache cluster includes: a first cache group and a second cache group;
[0148] The first cache group includes product asset data of each business in at least one business and an update timestamp of the product asset data;
[0149] The second cache group includes personal asset data of each user of at least one user and an update timestamp of the personal asset data.
[0150] For example, the personal asset data of user A includes: asset A, asset B, and the timestamps corresponding to asset A and asset B;
[0151] User B's personal asset data includes: asset A, asset B, and the timestamps corresponding to asset A and asset B.
[0152] Different assets of the same user can correspond to different timestamps, that is, asset A can correspond to a first timestamp, indicating the update time of asset A, and asset B can correspond to a second timestamp, indicating the update time of asset B.
[0153] For another example, different businesses may include: net value type, share type, real-time valuation, etc.;
[0154] Among them, the asset data of net value products include: net value, type, and release date; for example, the type can be a financial product such as a fund, and the net value is the net value of the corresponding fund;
[0155] The asset data of share-based products include share type and release date. For example, the share type can be a product such as a certificate of deposit, which has a specific share corresponding to it.
[0156] Real-time valuation of product asset data, including: category-value per share, release date; for example, categories can be such as gold price, exchange rate, etc., and each value represents the real-time valuation of the category.
[0157] The product asset data for different types of businesses may be different, and the release date indicates the update time of the product asset data.
[0158] In actual application, the asset data of each user can be calculated by combining the above business and user asset information. For example, asset A of user A is a real-time valued asset, and asset A includes the quantity owned. Based on the real-time valuation and the quantity owned, the amount of asset A of user A can be obtained.
[0159] Here, the cached data in the cache cluster can be used as the response content, and the data stored in the cache module can be used as the response content. It can be divided into two dimensions: assets and customers. When access is requested, the corresponding cached data is provided to reduce the degree of coupling with the business system and improve response efficiency.
[0160] In the cache cluster, data is divided into two dimensions: product level and user level.
[0161] The data source of the product dimension cache depends on the part forwarded by Kafka in the message push link. Through the standardized data template, expired data is marked and refreshed by release date, update timestamp, etc.
[0162] The data source of the user dimension cache is based on the real-time query results in the data processing service. When the corresponding asset changes are identified in the data cleaning stage, the corresponding business system will be requested to obtain the correct user asset data and write it into the cache through the delayed interface query. At the same time, the cache update time is marked by the timestamp. When the user accesses, the specific cache effective time mark can be compared to avoid the impact of dirty data caused by cache invalidation.
[0163] In the business processing module, the switching between query cache and real-time link can be realized, and the combined configuration operation can be pointed out. For example, funds and financial management can be set up to obtain the user's actual asset data through cache and real-time data interface respectively. When the user accesses, the business processing module combines the data and provides the corresponding asset data as the query result.
[0164] Figure 5 A schematic diagram of a business processing method provided by an application embodiment of the present disclosure; Figure 5 As shown, the method is applied to a business processing module in an electronic device; the business processing module can receive a query request sent by a mobile banking APP, and can also interact with a business system through a real-time interface.
[0165] The business processing method of the business processing module includes:
[0166] Receive a personal asset query request, and determine whether a first condition is met; specifically, determine query target information according to the personal asset query request (an example of a first query request), and determine whether the query target information meets the first condition;
[0167] If the first condition is met, it is considered to belong to the cache group, and the first data is obtained from the HBASE cluster (an example of a cache cluster); it is determined whether the first data meets the second condition. If the second condition is met, the obtained data is considered to be valid, and the third operation is performed; if the second condition is not met, the obtained data is considered invalid, and a data refresh operation is performed. Here, the data refresh operation is used to refresh asset data whose cache is invalid and whose data is questionable. The data refresh operation includes: obtaining the second data from the core and agency system (an example of a business system) to obtain the latest asset data through the real-time interface provided by the core and agency system, and asynchronously updating the user cache data in the HBASE cluster. Here, the third operation includes: performing data combination calculations based on the first data, and after determining the query results, feeding them back to the customer through the mobile banking APP.
[0168] If the first condition is not met, it is considered to belong to the real-time group, and the third data is obtained from the core and agency systems. Data combination calculations are performed based on the third data, and after the query results are determined, they are fed back to the customer through the mobile banking APP.
[0169] Specifically, the HBASE cluster may include: a product cache and a user cache; the first data or the third data obtained therefrom may include: product asset data and personal asset data.
[0170] Data combination calculation includes calculation based on product asset data and personal asset data. The calculation rules can be pre-set and saved. Different calculation methods can be set for each business. There is no limitation here. For example, for precious metal business, the real-time exchange rate, gold price, etc. can be combined for calculation and then the real-time asset data obtained in the business system can be accumulated to obtain the final personal asset query result.
[0171] Figure 6 A schematic diagram of the structure of a service processing device provided in an embodiment of the present disclosure; Figure 6 As shown, the device comprises:
[0172] A receiving module, configured to receive a first query request sent by a first terminal;
[0173] A first processing module, configured to determine query target information according to the first query request, and determine whether the query target information satisfies a first condition;
[0174] If the query target information satisfies the first condition, first data is obtained from the cache cluster according to the query target information; whether the first data satisfies the second condition is determined, if the first data satisfies the second condition, the query result is determined according to the first data; if the first data does not satisfy the second condition, second data is obtained from the business system according to the query target information, and the query result is determined according to the first data and the second data;
[0175] If the query target information does not satisfy the first condition, obtaining third data from the business system according to the query target information, and determining the query result according to the third data;
[0176] A sending module is used to send the query result to the first terminal.
[0177] In some embodiments, the first processing module is used to determine query target information according to the first query request, and the query target information includes: a target user and a target business;
[0178] Determining whether the query target information meets the first condition according to the preset business processing rules, the target user and the target business;
[0179] Accordingly, the query target information satisfies the first condition, including:
[0180] Determining, according to the preset service processing rule, that the target user is a first-category user and that the target service is a first-category service;
[0181] The query target information does not meet the first condition, including at least one of the following:
[0182] Determining, according to the preset business processing rule, that the target business is a second-category business;
[0183] Determining, according to the preset service processing rule, that the target service is a first-category service or a second-category service, and that the target user is a second-category user;
[0184] The preset service processing rule is used to indicate at least one first-category service and / or at least one first-category user;
[0185] The first type of business is a business in which product asset data is stored in the cache cluster;
[0186] The first category of users are users whose personal asset data is stored in the cache cluster.
[0187] In some embodiments, the first data includes: product data and user data, and the first processing module is used to determine a first update time corresponding to the user data;
[0188] Determining a second update time corresponding to the product data;
[0189] Determine a sequence relationship between the first update time and the second update time;
[0190] Accordingly, the first data satisfies the second condition, including: the first update time is after the second update time;
[0191] The first data does not satisfy a second condition, including: the first update time is before the second update time.
[0192] In some embodiments, the first processing module is further used to determine whether the user data corresponds to an invalidation tag;
[0193] Accordingly, the first data satisfies the second condition, including: the user data has no corresponding invalidation label;
[0194] The first data does not satisfy the second condition, including: the user data corresponds to an invalid label.
[0195] In some embodiments, the first processing module is used to determine the first business system according to the query target information;
[0196] Sending a second query request to the first business system through a real-time interface, wherein the second query request is used to request the first business system to feedback the latest data of the target user;
[0197] receiving second data sent by the first business system, where the second data includes the latest data of the target user;
[0198] A query result is determined according to the first data and the second data.
[0199] In some embodiments, the first processing module is further configured to determine a first update request according to the second data if second data fed back by the first business system is received;
[0200] The sending module is further used to send a first update request to the cache cluster, where the first update request is used to request the cache cluster to update user data corresponding to the target user.
[0201] In some embodiments, the receiving module is further used to receive data change information sent by the second business system, and the data change information includes: user change data and / or business change data;
[0202] The first processing module is further used to determine the changed data of the first type of business and / or the changed data of the first type of users in the data change information according to a preset business processing rule;
[0203] If the data change information includes the change data of the first type of business, updating the product asset information corresponding to the business in the cache cluster according to the change data of the first type of business;
[0204] If the data change information includes the changed data of the first category of users, a first invalidation instruction is sent to the cache cluster, and an asynchronous refresh is performed according to the user identifier of the first category of users and the changed data of the first category of users to obtain an asynchronous refresh result; according to the asynchronous refresh result, the personal asset information corresponding to the user in the cache cluster is updated, and the invalidation label is deleted; wherein the first invalidation instruction is used to instruct the cache cluster to add an invalidation label to the user data.
[0205] In some embodiments, the first processing module is used to determine the service type and at least one third service system corresponding to the change data according to the change data of the first category of users;
[0206] The sending module is used to send a second update request to each third business system according to the user identifier of the first category of users, so as to perform asynchronous refresh;
[0207] The receiving module is used to receive the asynchronous refresh result fed back by each third business system; the first processing module is used to update the personal asset information corresponding to the user in the cache cluster according to the asynchronous refresh result corresponding to each business type;
[0208] and / or,
[0209] The receiving module is used to receive asset update data sent by the fourth business system; the first processing module is used to update the personal asset information corresponding to the user in the cache cluster according to the asset update data.
[0210] In some embodiments, the cache cluster includes: a first cache group and a second cache group;
[0211] The first cache group includes product asset data of each business in at least one business and an update timestamp of the product asset data;
[0212] The second cache group includes personal asset data of each user of at least one user and an update timestamp of the personal asset data.
[0213] It is understandable that when the business processing device provided in the above embodiment implements the corresponding business processing method, the above processing can be assigned to different program modules as needed to complete all or part of the above-described processing. In addition, the device provided in the above embodiment and the embodiment of the corresponding method belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0214] An embodiment of the present disclosure provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will be triggered to execute the business processing method provided by the embodiment of the present disclosure.
[0215] In some embodiments, the computer-readable storage medium may be a ferroelectric random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a CD-ROM; or it may be various devices including one or any combination of the above memories.
[0216] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, model, subroutine or other unit suitable for use in a computing environment.
[0217] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0218] An embodiment of the present disclosure provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the business processing method described in the present disclosure is implemented.
[0219] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure; Figure 7 As shown, the electronic device 70 includes: a processor 701 and a memory 702 for storing a computer program that can be run on the processor; when the processor 701 is used to run the computer program, it executes the business processing method provided by the embodiment of the present disclosure.
[0220] In actual application, the electronic device 70 may further include: at least one network interface 703. The various components in the electronic device 70 are coupled together via a bus system 704. It is understood that the bus system 704 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7 In the figure, various buses are marked as bus system 704. There may be at least one processor 701. The network interface 703 is used for wired or wireless communication between the electronic device 70 and other devices.
[0221] The memory 702 in the embodiment of the present disclosure is used to store various types of data to support the operation of the electronic device 70 .
[0222] The method disclosed in the above embodiment of the present disclosure can be applied to the processor 701, or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 701 or the instruction in the form of software. The above processor 701 may be a general processor, a digital signal processor (DSP, DiGital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 701 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present disclosure. The general processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present disclosure can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be combined to execute. The software module can be located in a storage medium, which is located in the memory 702. The processor 701 reads the information in the memory 702 and completes the steps of the above method in combination with its hardware.
[0223] In some embodiments, the electronic device 70 may be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to execute the aforementioned method.
[0224] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this disclosure is not limited here.
[0225] In the above description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0226] Unless otherwise defined, all technical and scientific terms used in this disclosure have the same meaning as those commonly understood by those skilled in the art to which this disclosure belongs. The terms used in this disclosure are only for the purpose of describing the embodiments of this disclosure and are not intended to limit this disclosure.
[0227] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0228] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A business processing method, characterized in that: The method comprises: Receiving a first query request sent by a first terminal; Determine query target information according to the first query request, and determine whether the query target information meets a first condition; If the query target information satisfies the first condition, first data is obtained from the cache cluster according to the query target information; whether the first data satisfies the second condition is determined, if the first data satisfies the second condition, the query result is determined according to the first data; if the first data does not satisfy the second condition, second data is obtained from the business system according to the query target information, and the query result is determined according to the first data and the second data; If the query target information does not satisfy the first condition, obtaining third data from the business system according to the query target information, and determining the query result according to the third data; Sending the query result to the first terminal; The determining of the query target information according to the first query request and determining whether the query target information satisfies a first condition includes: Determine query target information according to the first query request, the query target information including: a target user and a target business; Determining whether the query target information meets the first condition according to the preset business processing rules, the target user and the target business; Accordingly, the query target information satisfies the first condition, including: Determining, according to the preset service processing rule, that the target user is a first-category user and that the target service is a first-category service; The query target information does not meet the first condition, including at least one of the following: Determining, according to the preset business processing rule, that the target business is a second-category business; Determining, according to the preset service processing rule, that the target service is a first-category service or a second-category service, and that the target user is a second-category user; The preset service processing rule is used to indicate at least one first-category service and / or at least one first-category user; The first type of business is a business with cache authority; The first type of users are users with cache permissions; The second type of business is a business that does not have cache authority; The second type of users are users who do not have cache permissions; The first data includes: product data and user data, and the determining whether the first data satisfies the second condition includes: Determining a first update time corresponding to the user data; Determining a second update time corresponding to the product data; Determine a sequence relationship between the first update time and the second update time; Accordingly, the first data satisfies the second condition, including: the first update time is after the second update time; The first data does not satisfy the second condition, including: the first update time is before the second update time; The determining whether the first data satisfies the second condition further includes: Determining whether the user data corresponds to an invalidation label; Accordingly, the first data satisfies the second condition, further comprising: the user data has no corresponding invalidation label; The first data does not satisfy the second condition, and further includes: the user data corresponds to an invalid label.
2. The method according to claim 1, characterized in that The acquiring second data from the business system according to the query target information, and determining the query result according to the first data and the second data, includes: Determining a first business system according to the query target information; Sending a second query request to the first business system through a real-time interface, wherein the second query request is used to request the first business system to feedback the latest data of the target user; receiving second data sent by the first business system, where the second data includes the latest data of the target user; A query result is determined according to the first data and the second data.
3. The method according to claim 2, characterized in that The method further comprises: If second data fed back by the first business system is received, determining a first update request according to the second data; A first update request is sent to the cache cluster, where the first update request is used to request the cache cluster to update user data corresponding to the target user.
4. The method according to claim 1, characterized in that The method further comprises: Receiving data change information sent by the second business system, the data change information including: user change data and / or business change data; Determine, according to a preset business processing rule, the changed data of the first category of business and / or the changed data of the first category of users in the data change information; If the data change information includes the change data of the first type of business, updating the product asset information corresponding to the business in the cache cluster according to the change data of the first type of business; If the data change information includes the changed data of the first category of users, a first invalidation instruction is sent to the cache cluster, and an asynchronous refresh is performed according to the user identifier of the first category of users and the changed data of the first category of users to obtain an asynchronous refresh result; according to the asynchronous refresh result, the personal asset information corresponding to the user in the cache cluster is updated, and the invalidation label is deleted; wherein the first invalidation instruction is used to instruct the cache cluster to add an invalidation label to the user data.
5. The method according to claim 4, characterized in that Asynchronously refreshing the data according to the user identifiers of the first category of users and the changed data of the first category of users to obtain an asynchronous refresh result includes: Determining, according to the changed data of the first category of users, a service type corresponding to the changed data and at least one third service system; Sending a second update request to each third business system according to the user identifier of the first category of users to perform asynchronous refresh; Receive the asynchronous refresh result fed back by each third business system, and update the personal asset information corresponding to the user in the cache cluster according to the asynchronous refresh result corresponding to each business type; and / or, Receive asset update data sent by the fourth business system, and update personal asset information corresponding to the user in the cache cluster according to the asset update data.
6. The method according to any one of claims 1 to 5, characterized in that: The cache cluster includes: a first cache group and a second cache group; The first cache group includes product asset data of each business in at least one business and an update timestamp of the product asset data; The second cache group includes personal asset data of each user of at least one user and an update timestamp of the personal asset data.
7. A service processing device, characterized in that: The device comprises: A receiving module, configured to receive a first query request sent by a first terminal; A first processing module, configured to determine query target information according to the first query request, and determine whether the query target information satisfies a first condition; If the query target information satisfies the first condition, first data is obtained from the cache cluster according to the query target information; whether the first data satisfies the second condition is determined, if the first data satisfies the second condition, the query result is determined according to the first data; if the first data does not satisfy the second condition, second data is obtained from the business system according to the query target information, and the query result is determined according to the first data and the second data; If the query target information does not satisfy the first condition, obtaining third data from the business system according to the query target information, and determining the query result according to the third data; A sending module, used for sending the query result to the first terminal; The first processing module is used to determine the query target information according to the first query request, and the query target information includes: a target user and a target service; Determining whether the query target information meets the first condition according to the preset business processing rules, the target user and the target business; Accordingly, the query target information satisfies the first condition, including: Determining, according to the preset service processing rule, that the target user is a first-category user and that the target service is a first-category service; The query target information does not meet the first condition, including at least one of the following: Determining, according to the preset business processing rule, that the target business is a second-category business; Determining, according to the preset service processing rule, that the target service is a first-category service or a second-category service, and that the target user is a second-category user; The preset service processing rule is used to indicate at least one first-category service and / or at least one first-category user; The first type of business is a business with cache authority; The first type of users are users with cache permissions; The second type of business is a business that does not have cache authority; The second type of users are users who do not have cache permissions; Wherein, the first data includes: product data and user data, and the first processing module is used to determine a first update time corresponding to the user data; Determining a second update time corresponding to the product data; Determine a sequence relationship between the first update time and the second update time; Accordingly, the first data satisfies the second condition, including: the first update time is after the second update time; The first data does not satisfy the second condition, including: the first update time is before the second update time; The first processing module is further used for: Determining whether the user data corresponds to an invalidation label; Accordingly, the first data satisfies the second condition, further comprising: the user data has no corresponding invalidation label; The first data does not satisfy the second condition, and further includes: the user data corresponds to an invalid label.
