Product data processing method, system, computer device and storage medium
By introducing a cache server into the business server cluster and adopting token acquisition and release mechanisms, the problem of low response efficiency of business systems in high-frequency product application scenarios is solved, and more efficient product data processing and system stability are achieved.
Patent Information
- Application Number
- CN201910418420.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-20
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2039-05-20
AI Technical Summary
In the high-frequency product application scenario, the business system is down due to the inability to respond to product application requests in a timely manner, resulting in low product data processing efficiency.
By introducing a cache server into the business server cluster, the token acquisition and release mechanism is adopted. After obtaining the product application request, the business server verifies the applicant's information and generates a token acquisition request. If the token is successfully obtained, a quota query request is generated. To obtain the product quota, calculate the remaining quota when the quota is sufficient and release the token, update the product quota in the cache server.
It improves the response efficiency and system stability of product data processing, avoids system downtime caused by waiting for response, and improves the processing efficiency of product application requests.
Smart Images

Figure CN110245153B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a product data processing method, system, computer device and storage medium. Background Art
[0002] With the continuous development of computer technology and Internet technology, online business based on the Internet has gradually developed, bringing many conveniences to people's lives. In order to facilitate business processing, business systems have gradually emerged, through which applicants can apply for products or services provided by providers.
[0003] At present, business systems are usually designed based on low-frequency product application scenarios, without considering the support of special scenarios such as high-frequency product applications (such as rush purchases). In high-frequency product application scenarios, the business system serially obtains product quotas from the database based on multiple product application requests received, which reduces the response efficiency of product application requests. Especially when the number of product application requests increases dramatically, the system may crash due to the inability to respond to product application requests in a timely manner, thereby further reducing the response efficiency of product application requests and causing low product data processing efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a product data processing method, system, computer device and storage medium that can improve product data processing efficiency in response to the above technical problems.
[0005] A product data processing method is applied to a business server in a business server cluster, the method comprising:
[0006] Obtain a product application request with an applicant ID, an application amount, and a product ID;
[0007] Verifying the applicant according to the applicant information corresponding to the applicant identifier, and when the verification passes, sending a token acquisition request generated according to the product identifier to the cache server;
[0008] When there is a token corresponding to the product identifier and in an idle state in the cache server, receiving the token allocated by the cache server;
[0009] generating a credit limit query request according to the token and the product identifier, and sending the credit limit query request to the cache server;
[0010] receiving the product quota fed back by the cache server, and when the product quota is greater than or equal to the application amount, calculating the remaining product quota according to the product quota and the application amount;
[0011] A token release instruction is generated according to the remaining amount of the product and the token, and the token release instruction is sent to the cache server; the token release instruction is used to instruct the cache server to update the product amount in the memory according to the remaining amount of the product and release the token.
[0012] In one embodiment, after sending the token acquisition request generated according to the product identifier to the cache server, the method further includes:
[0013] When there is no token corresponding to the product identifier and in an idle state in the cache server, waiting for the allocation of the token;
[0014] The token acquisition request sent is used to instruct the cache server to sort and cache the token acquisition requests according to the reception time of the token acquisition requests to wait for the allocation of the token;
[0015] When the cache server releases the token according to the received token release instruction and the ranking of the token acquisition request is equal to the preset ranking, the token allocated by the cache server is received.
[0016] In one embodiment, after sending the token release instruction to the cache server, the method further includes:
[0017] forwarding the product application request to a processing server; the forwarded product application request is used to instruct the processing server to process the product application;
[0018] When receiving an application result indicating a successful application fed back by the processing server in response to the product application request, generating a quota update instruction according to the product identifier and the application amount;
[0019] The credit limit update instruction is sent to the storage server; the credit limit update instruction is used to instruct the storage server to update the product credit limit corresponding to the product identifier in the database according to the application amount.
[0020] In one embodiment, the cache server is a master server in a cache server cluster; the method further comprises:
[0021] Monitor the master-slave switching event in real time; the master-slave switching event refers to switching the current master server in the cache server cluster to a slave server to obtain the switched master server;
[0022] When the master-slave switching event is monitored, triggering the generation of a permission acquisition request;
[0023] Sending the permission acquisition request to the main server, and upon receiving the permission certificate assigned by the main server, acquiring the latest version of the product quota from the database of the storage server;
[0024] The authority certificate and the latest version of the product quota are sent to the main server, so that the main server stores the latest version of the product quota in a memory based on the authority certificate.
[0025] A product data processing method is applied to a cache server, the method comprising:
[0026] Receive a token acquisition request sent by a business server, and query a token in an idle state in a memory according to a product identifier in the token acquisition request;
[0027] When the token is found, the token is allocated to the service server;
[0028] receiving a credit limit query request sent by the business server; the credit limit query request carries the token and the product identifier;
[0029] Based on the token, query the product amount corresponding to the product identifier in the memory, and feed back the queried product amount to the business server;
[0030] Receiving a token release instruction sent by the business server; the token release instruction carries the token and the remaining amount of the product corresponding to the product identifier;
[0031] The product amount in the memory is updated according to the remaining amount of the product, and the token is released.
[0032] In one embodiment, the method further comprises:
[0033] When the token is not found, the token acquisition requests are sorted and cached according to the reception time of the token acquisition requests;
[0034] When the token is released according to the received token release instruction, the token is allocated to the service server corresponding to the token acquisition request with a ranking equal to the preset ranking according to the ranking of the token acquisition request.
[0035] In one embodiment, after allocating the token to the service server, the method further includes:
[0036] Performing occupation processing on the token and counting the occupation time of the token;
[0037] When the occupation time is greater than or equal to the preset time, the token is released, and according to the ranking of the token acquisition request, the token is allocated to the business server corresponding to the token acquisition request with a ranking equal to the preset ranking.
[0038] A product data processing system, the system comprising: a business server and a cache server;
[0039] The business server is used to obtain a product application request carrying an applicant identifier, an application amount, and a product identifier; verify the applicant according to the applicant information corresponding to the applicant identifier, and when the verification passes, send a token acquisition request generated according to the product identifier to the cache server;
[0040] The cache server is used to query the idle token in the memory according to the product identification in the token acquisition request; when the token is found, the token is allocated to the business server;
[0041] The business server is further configured to generate a credit limit query request according to the token and the product identifier, and send the credit limit query request to the cache server;
[0042] The cache server is further configured to query the product amount corresponding to the product identifier in the memory based on the token, and feed back the queried product amount to the business server;
[0043] The business server is further configured to calculate the remaining amount of the product according to the product amount and the application amount when the product amount is greater than or equal to the application amount; generate a token release instruction according to the remaining amount of the product and the token, and send the token release instruction to the cache server;
[0044] The cache server is further used to update the product amount in the memory according to the remaining amount of the product in the token release instruction and release the token.
[0045] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the product data processing method described in the above embodiments when executing the computer program.
[0046] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the product data processing method described in the above embodiments.
[0047] In the above-mentioned product data processing method, system, computer device and storage medium, when the business server obtains a product application request carrying the applicant identification, application amount and product identification, it verifies the applicant according to the applicant identification, and when the verification is passed, it seizes the token in an idle state from the cache server according to the product identification to realize serial preemption of the product quota; after seizing the token, the business server sends the quota query request generated according to the token and the product identification to the cache server, and the cache server queries the product quota corresponding to the product identification in the memory based on the token and feeds back to the business server, so as to improve the operation efficiency of the product quota; when the product quota is greater than or equal to the application amount, the business server calculates the remaining product quota according to the product quota and the application amount, and sends the token release instruction carrying the remaining product quota and the token to the cache server, and the cache server automatically updates the corresponding product quota in the memory according to the remaining product quota, and releases the token, so as to automatically allocate the token to the business server corresponding to other product application requests to be responded to, so as to further improve the operation efficiency of the product quota, improve the response efficiency of product application requests, and thus improve the product data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 An application scenario diagram of a product data processing method in an embodiment;
[0049] Figure 2 is a flowchart of a product data processing method in one embodiment;
[0050] Figure 3 is a flowchart of a product data processing method in another embodiment;
[0051] Figure 4 is a flowchart of a product data processing method in yet another embodiment;
[0052] Figure 5 A flowchart of a product data processing method in yet another embodiment;
[0053] Figure 6 is an architectural diagram of a product data processing system in one embodiment;
[0054] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The product data processing method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the business server 102a in the business server cluster 102 communicates with the cache server 104 through the network. When the business server 102a obtains the product application request carrying the applicant identification, the application amount and the product identification, it verifies the applicant according to the applicant information corresponding to the applicant identification, and sends the token acquisition request carrying the product identification to the cache server 104 after the verification is passed, and when there is a token corresponding to the product identification and in an idle state in the cache server 104, it receives the token allocated by the cache server 104, and then queries the product quota from the cache server 104 according to the token and the product identification. When the product quota is greater than or equal to the application amount, the product remaining quota is calculated according to the product quota and the application amount, and the token release instruction carrying the product remaining quota and the token is sent to the cache server 104, so that the cache server 104 updates the corresponding product quota in the memory based on the product remaining quota and releases the token. The business server 102a and the cache server 104 can be implemented with an independent server or a server cluster composed of multiple servers. It can be understood that the business server cluster 102 may include multiple business servers, such as business server 102a, business server 102b and business server 102c, etc., and each business server communicates with the cache server 104 through the network. Each business server in the business server cluster 102 may obtain a product application request, and when obtaining the product application request, execute the relevant operations executed by the above-mentioned business server 102a according to the obtained product application request.
[0057] In one embodiment, Figure 2 As shown, a product data processing method is provided, which is applied to Figure 1 Taking the service server 102a in the example as an example, the following steps are included:
[0058] S202, obtaining a product application request carrying an applicant identification, an application amount, and a product identification.
[0059] Among them, the applicant identification is used to uniquely identify the applicant, which can be an individual or a collective, such as a company, department or group. The application amount refers to the amount of the product requested, such as the number of products requested or the amount of resources equivalent to the requested product. The product identification is used to uniquely identify the product, which can be a financial product, such as a bond, or a commodity. Taking bonds as an example, the application amount refers to the amount of resources equivalent to the bonds requested. The resource amount refers to the number of resources, which can be funds, virtual red envelopes or electronic vouchers.
[0060] Specifically, when the applicant terminal detects the preset application trigger operation triggered by the applicant, it obtains the application amount and product identification pre-selected or pre-entered by the applicant, as well as the applicant identification corresponding to the applicant, generates a product application request based on the applicant identification, application amount and product identification, and sends the product application request to the business server.
[0061] In one embodiment, the applicant terminal sends the generated product application request to a service server in the service server cluster.
[0062] In one embodiment, the applicant terminal sends the generated product application request to the load balancing server in the business system, and the load balancing server distributes the product application request to the corresponding business server. Specifically, the load balancing server distributes the product application request to a business server in the business server cluster according to the pre-configured load balancing policy parameters. The load balancing policy parameters are quantitative parameters of the load balancing policy, such as selecting a business server from the business server cluster to receive the product application request according to the polling method or the current load of each business server.
[0063] S204, verifying the applicant according to the applicant information corresponding to the applicant identifier, and when the verification passes, sending a token acquisition request generated according to the product identifier to the cache server.
[0064] Among them, the applicant information includes the applicant account information and / or the risk assessment level. The applicant account information includes the current status and available resources of the applicant account. The current status of the applicant account includes a normal state and an abnormal state. For example, if the applicant account is in a state of being cancelled, blacklisted or frozen, the current state is determined to be an abnormal state. The risk assessment level can be predicted and fed back by the risk assessment system based on a pre-trained risk assessment model. The risk assessment level is such as A, B, C or D (or 1, 2, 3 or 4), and the level decreases from front to back. The applicant information may also include the applicant's basic information or risk assessment level. Taking the applicant as an individual as an example, the applicant's basic information may include the applicant's occupation, income, age, gender, place of residence or marital status. The business server may also predict the applicant's risk assessment level based on the applicant's basic information.
[0065] Specifically, the business server parses the received product application request to obtain the applicant identification, application amount and product identification. The business server obtains the applicant account information and / or risk assessment level from the local or other computer device according to the applicant identification, and verifies the applicant according to the applicant account information and / or risk assessment level. When the applicant account information verification passes and / or the risk assessment level verification passes, it is determined that the applicant verification passes, and the business server generates a token acquisition request according to the product identification, and sends the token acquisition request to the cache server to grab the token corresponding to the product identification and in an idle state from the cache server according to the token acquisition request. The business server determines the current state and available resources of the applicant account according to the applicant information, and compares the available resources with the preset resources. The preset resources can be determined according to the application amount specified by the product application request, such as being equal to the application amount. When the current state of the applicant account is normal and the available resources are greater than the preset resources, the business server determines that the applicant information verification passes. The business server queries the product risk assessment level corresponding to the product identification, and compares the applicant's risk assessment level with the product risk assessment level. When the applicant's risk assessment level is higher than the product's risk assessment level, the risk assessment level verification is deemed to have passed.
[0066] In one embodiment, after obtaining the product application request, the business server queries the corresponding product status according to the product identification, and when the queried product status is an application-available status, verifies the applicant according to the applicant identification.
[0067] In one embodiment, the business server queries the current product quota and product status corresponding to the product identification from the local or other computer devices, and compares the current product quota with the application amount. When the current product quota is greater than or equal to the application amount, and the product status is an applicable state, the business server continues to perform the step of verifying the applicant. Among them, the product status includes an applicable state and an unapplicable state. If the current time is in the validity period or trading period of the product, the product status is determined to be an applicable state. Taking the product as a bond as an example, the validity period of the bond refers to the bond term (time period) specified when the bond is issued, and the trading period is non-holidays, non-registration days, and non-dividend days. Therefore, the business server determines whether to perform subsequent product quota preemption operations by preliminarily judging whether the current product quota is greater than the application amount, which can improve the response efficiency of product application requests.
[0068] In one embodiment, each business server in the business server cluster may receive a product application request sent by the applicant terminal. When receiving a product application request sent by the applicant terminal, the business server receiving the product application request queries the corresponding applicant information according to the applicant identifier in the product application request, verifies the applicant according to the applicant information, and triggers the generation of a token acquisition request carrying a product identifier after the verification passes, so as to obtain a token corresponding to the product identifier and in an idle state from the cache server. As a result, the business servers that receive the product application request will perform the above-mentioned token grabbing operation, and only the business server that grabs the token can obtain the product amount corresponding to the product identifier from the cache server according to the grabbed token.
[0069] S206: When there is a token corresponding to the product identifier and in an idle state in the cache server, receive a token allocated by the cache server.
[0070] The token is a credential for accessing the cache server to obtain the product amount corresponding to the product identifier, that is, an access token, which can be a string consisting of at least one of numbers, letters, symbols and other characters.
[0071] Specifically, when the cache server receives a token acquisition request sent by the business server, it parses the token acquisition request to obtain the product identifier, locally queries for a token in an idle state based on the product identifier, and when the token is found, allocates the found token to the business server. The cache server is pre-configured with a corresponding token locally for each product identifier. The cache server can locally query the pre-configured token and the status identifier corresponding to the token based on the product identifier. When the status identifier is an idle identifier, the token is determined to be a token found based on the product identifier and in an idle state, and the token is allocated to the corresponding business server, and the status identifier of the token is updated to an occupied identifier.
[0072] S208, generating a credit limit query request according to the token and the product identifier, and sending the credit limit query request to the cache server.
[0073] Specifically, when receiving the token assigned by the cache server for the token acquisition request, it indicates that the business server has seized the authority to obtain the product quota corresponding to the product identifier, and then generates a corresponding quota query request based on the token and product identifier, and sends the quota query request to the cache server. The cache server parses the received quota query request to obtain the product identifier and token, queries the product quota corresponding to the product identifier in the memory based on the token, and feeds back the queried product quota to the business server.
[0074] S210, receiving the product quota fed back by the cache server, and when the product quota is greater than or equal to the application amount, calculating the remaining product quota based on the product quota and the application amount.
[0075] The product quota refers to the amount of resources or products equivalent to the product. Specifically, it can refer to the amount of resources equivalent to the product to be applied for, that is, the amount of resources equivalent to the product provided or issued by the provider, such as the bond quota (the total face value of the bond); it can also refer to the number of products to be applied for, such as the number of goods to be sold. The remaining product quota refers to the remaining product quota available for application after excluding the application amount specified by the product application request.
[0076] Specifically, the business server receives the product quota fed back by the cache server in response to the quota query request, and compares the product quota with the application amount specified in the product application request. When the product quota is greater than or equal to the application amount, the business server subtracts the application amount from the product quota to obtain the corresponding product remaining quota.
[0077] In one embodiment, when the product amount is less than the application amount, the business server generates a token release instruction based on the seized token, and sends the token release instruction to the cache server to instruct the cache server to release the token. Further, the business server feeds back to the applicant terminal a prompt message indicating that the product application failed and / or the product amount is insufficient. The token release instruction may also include a product identifier.
[0078] S212, generate a token release instruction according to the remaining amount of the product and the token, and send the token release instruction to the cache server; the token release instruction is used to instruct the cache server to update the product amount in the memory according to the remaining amount of the product and release the token.
[0079] Specifically, the business server generates a token release instruction based on the calculated product remaining amount and the corresponding token, and sends the token release instruction to the cache server. The cache server parses the received token release instruction to obtain the product remaining amount and the token to be released, determines the product identifier based on the product remaining amount and / or the token, locally queries the product amount corresponding to the product identifier, and updates the queried product amount based on the product remaining amount, that is, updates the queried product amount to the product remaining amount. The cache server releases the token corresponding to the product identifier, and can also update the status identifier corresponding to the token to an idle identifier.
[0080] Furthermore, if the cache server has a token acquisition request that is waiting to be responded to and corresponds to the product identifier in its local cache, the cache server selects the token acquisition request with the earliest reception time from the token acquisition requests to be responded to, allocates the released token to the business server corresponding to the selected token acquisition request, and performs occupation processing on the token so that the business server allocated to the token performs the above-mentioned related operations according to the token. It is understandable that the token acquisition request locally cached by the cache server can be acquired and sent by the business server in sequence, or it can be sent by one or more business servers in the business server cluster where the business server is located. In this way, multiple business servers can serially seize the product quota corresponding to the product identifier from the cache server. In the above-mentioned product data processing method, when the business server obtains a product application request carrying the applicant identification, application amount and product identification, it verifies the applicant according to the applicant identification, and when the verification is passed, it seizes the token in an idle state from the cache server according to the product identification to realize serial preemption of the product quota; after seizing the token, the business server sends the quota query request generated according to the token and the product identification to the cache server, and the cache server queries the product quota corresponding to the product identification in the memory based on the token and feeds back to the business server, so as to improve the operation efficiency of the product quota; when the product quota is greater than or equal to the application amount, the business server calculates the remaining product quota according to the product quota and the application amount, and sends the token release instruction carrying the remaining product quota and the token to the cache server, and the cache server automatically updates the corresponding product quota in the memory according to the remaining product quota, and releases the token, so as to automatically allocate the token to the business server corresponding to other product application requests to be responded to, so as to further improve the operation efficiency of the product quota, improve the response efficiency of product application requests, and thus improve the product data processing efficiency.
[0081] In one embodiment, after step S204, the product data processing method further includes: when there is no token corresponding to the product identifier and in an idle state in the cache server, waiting for the allocation of the token; sending a token acquisition request to instruct the cache server to sort and cache the token acquisition request according to the reception time of the token acquisition request to wait for the allocation of the token; when the cache server releases the token according to the received token release instruction and the sorting ranking of the token acquisition request is equal to the preset ranking, receiving the token allocated by the cache server.
[0082] The receiving time refers to the time when the cache server receives the token acquisition request sent by the business server. The sorting rank refers to the sequence number of the token acquisition request in the cache queue. The preset rank refers to a preset sequence number, such as 1.
[0083] Specifically, when no token corresponding to the product identifier and in an idle state is found locally according to the received token acquisition request, the cache server sorts and caches the token according to the time when the token acquisition request is received. Accordingly, before receiving the token allocated by the cache server for the token acquisition request, the business server waits for the allocation of the token, that is, enters the waiting state for the token allocation. Further, when the cache server receives the token release instruction sent by the business server holding the token and releases the occupied token according to the token release instruction, it allocates the released token to the business server corresponding to the token acquisition request with the earliest reception time or the highest ranking according to the sorting of the token acquisition request of the sorted cache. It can be understood that after the token acquisition request is sorted and cached by the cache server, when the cache server releases the token currently in the occupied state according to the received token release instruction and the ranking of the cached token acquisition request is equal to the preset ranking, the cache server allocates the released token to the business server corresponding to the cached token acquisition request.
[0084] In one embodiment, when no token corresponding to the product identifier in the token acquisition request and in an idle state is found, the cache server caches the token acquisition request to a cache queue. It is understood that when the token corresponding to the product identifier is in an occupied state, the cache server caches the token acquisition request sent by one or more business servers for the product identifier in the cache queue according to the reception time of the token acquisition request.
[0085] In the above embodiment, the token acquisition requests that have not preempted the token are sorted and cached, and the released tokens are allocated in sequence to the business servers corresponding to the corresponding token acquisition requests in order to improve the serial preemption efficiency of the token, thereby improving the serial preemption efficiency of the product quota.
[0086] In one embodiment, after sending the token release instruction to the cache server, the above-mentioned product data processing method also includes: forwarding the product application request to the processing server; the forwarded product application request is used to instruct the processing server to process the product application; when receiving the application result indicating that the application is successful in response to the product application request from the processing server, generating a credit limit update instruction based on the product identifier and the application amount; sending the credit limit update instruction to the storage server; the credit limit update instruction is used to instruct the storage server to update the product credit limit corresponding to the product identifier in the database according to the application amount.
[0087] Specifically, when it is determined that the queried product quota is greater than or equal to the application amount specified in the product application request, the business server forwards the product application request to the processing server. The processing server performs product application processing according to the received product application request. Taking the product as a bond as an example, the executed product application processing is such as allocating resources in the applicant's account equal to the application amount to the provider's account, and feeding back the product or product application certificate provided by the provider to the applicant. When the product application is processed, the processing server triggers the generation of an application result and feeds the application result back to the business server. When the received application result is a successful application, the business server generates a quota update instruction according to the product identification and application amount specified in the product application request, and sends the quota update instruction to the storage server. The storage server queries the product quota corresponding to the product identification in the database according to the quota update instruction, subtracts the application amount from the queried product quota to obtain the remaining product quota, and updates the product quota in the database according to the remaining product quota.
[0088] In one embodiment, when the application result is an application failure, the business server feeds back a prompt message indicating the application failure to the applicant terminal, and sends a token acquisition request generated according to the product identifier to the cache server. When receiving the token allocated by the cache server for the token acquisition request, the business server obtains the product quota corresponding to the product identifier from the cache server according to the token and the product identifier, sums the product quota with the application amount specified in the product application request to obtain the remaining product quota, updates the corresponding product quota in the cache server memory according to the remaining product quota, and releases the held token. Thus, when the application fails, the product quota in the cache server memory is updated according to the application amount of the failed application.
[0089] In one embodiment, when the storage server receives the quota update instruction, it updates the corresponding product quota in the database according to the received quota update instruction. The storage server can update the product quota in the database in an overwriting manner, that is, update the product quota corresponding to the product identification in the database to the product remaining quota calculated according to the product quota and the application amount. The storage server can also record the calculated product remaining quota and the product identification in the database as the latest version of the product quota. Thus, the database records the product quotas of various versions corresponding to the product identification. It can be understood that the storage server can record the application amount and the product identification in the database according to the quota update instruction to form a persistently stored product application record. The product application record can also include the applicant identification and application time, etc.
[0090] In one embodiment, the storage server caches the received quota update instructions locally, queries the database for the latest version of the product quota corresponding to the product identifier according to a preset period, calculates the remaining product quota based on the application amount in each quota update instruction cached locally and corresponding to the product identifier, and the queried product quota, and updates the product quota in the database based on the product remaining quota.
[0091] In one embodiment, the product application processing performed by the processing server according to the product application request can be performed by the business server. Specifically, after sending the token release instruction to the cache server, the business server performs product application processing according to the product application request and obtains the corresponding application result. When the application result is successful, the business server generates a quota update instruction according to the corresponding product identifier and application amount, and sends the quota update instruction to the storage server.
[0092] In the above embodiment, the product quota in the database is updated according to the successfully applied amount, so that the product quota is persistently updated in the database, which can avoid the problem of loss of product quota in memory due to cache server failure.
[0093] In one embodiment, the cache server is the master server in the cache server cluster; the above-mentioned product data processing method also includes: real-time monitoring of master-slave switching events; the master-slave switching event refers to switching the current master server in the cache server cluster to a slave server to obtain the switched master server; when the master-slave switching event is monitored, triggering the generation of an authority acquisition request; sending the authority acquisition request to the master server, and when receiving the authority certificate assigned by the master server, obtaining the latest version of the product quota from the database of the storage server; sending the authority certificate and the latest version of the product quota to the master server, so that the master server stores the latest version of the product quota in the memory based on the authority certificate.
[0094] Among them, the cache server cluster includes a master server and at least one slave server. The master-slave switching event refers to the automatic triggering of switching the current master server to a slave server when the current master server in the cache server cluster goes down, thereby obtaining the switched master server. It can be understood that the master-slave switching event is to select a target slave server from the slave servers in the cache server cluster, and replace the current master server with the target slave server as the switched master server. The master server has read and write permissions, and the slave server only has read permissions. The master server synchronizes the updated product quota to the slave server. The permission credential is a credential used to represent the permission to restore the memory data of the cache server, which can be a token.
[0095] Specifically, the cache server in each of the above embodiments is a main server business server in a cache server cluster that monitors the running status of the main server in the cache server cluster in real time. When a master-slave switching event triggered by the main server downtime is monitored, a permission acquisition request is triggered and sent to the switched main server. The switched main server selects the earliest received permission acquisition request from the received permission acquisition request, and allocates the pre-configured permission certificate to the business server corresponding to the selected permission acquisition request. When the assigned permission certificate is received, the business server that receives the permission certificate obtains the latest version of the product quota corresponding to each product identifier from the database of the storage server, and sends the permission certificate and the latest version of the product quota to the switched main server. The switched main server verifies the received permission certificate, and stores the latest version of the product quota in the memory after the verification is passed to restore the product quota in the main server memory. Further, the main server synchronizes the product quota corresponding to each product identifier in the memory to each slave server.
[0096] In one embodiment, each service server in the service server cluster monitors the master-slave switching event of the cache server cluster in real time, and after monitoring the master-slave switching event, sends a permission acquisition request to the switched master server to seize the permission credential.
[0097] In the above embodiment, when the product quota in the memory is lost due to the downtime of the cache server, the product quota in the switched cache server is automatically updated according to the product quota in the storage server database, so that the product quota can be quickly obtained from the memory when the product application request is received again, thereby improving the product data processing efficiency. The memory data is restored by preempting the permission certificate to ensure the correctness of the memory data.
[0098] In one embodiment, the business server receives a business application request corresponding to the applicant identifier sent by the applicant terminal, and determines the business type and the applicant type according to the business application request. When the business type is a differentiated business type, the business server queries the pre-configured differentiated business processing flow according to the applicant type, and performs business processing according to the differentiated business processing flow according to the business application request. When the business type is a general business type, the business server queries the pre-configured general business processing flow, and performs business processing according to the business application request according to the general business processing flow. Taking the product as bonds as an example, differentiated business types include inquiry, appointment and transfer of custody, and general business types include product application. The applicant types include individuals, corporate and peer customers, etc. As a result, multiple types of applicants can be supported, and corresponding business processing flows can be provided for different types of applicants, thereby improving business processing efficiency.
[0099] In one embodiment, the business server receives the product quotation corresponding to the product identifier pushed by the quotation server, determines the application server list according to the product identifier, and broadcasts the product quotation to each application server in the application server list through a socket long connection. Among them, the application server list is a set of one or more application servers that have registered in the communication network and subscribed to the product quotation corresponding to the product identifier. The application server may include a business server, a cache server and a storage server, as well as other servers in the business system, such as a query server. The quotation server can predict the product quotation with the help of a trained quotation model, or determine the product quotation based on the historical transaction resource exchange volume. It can be understood that the quotation server pushes the product quotation to any business server in the business server cluster, and the business server broadcasts the product quotation to other application servers. Taking the product as a bond as an example, the quotation server can calculate the corresponding bond quotation based on the China Bond Valuation Data, the transaction price of the primary bond trading market, and the historical transaction price. As a result, real-time and high-frequency two-way product quotations can be provided to the applicant and the provider to improve the user experience, thereby increasing the product application transaction volume.
[0100] In one embodiment, when the service server receives the modification data sent by the management terminal, the service server receiving the modification data queries the corresponding application server list and broadcasts the modification data to each application server in the application server list, so that each application server can quickly share the latest data.
[0101] In one embodiment, Figure 3 As shown, a product data processing method is provided, which specifically includes the following steps:
[0102] S302, obtaining a product application request carrying an applicant identifier, an application amount, and a product identifier.
[0103] S304, verifying the applicant according to the applicant information corresponding to the applicant identifier, and when the verification passes, sending a token acquisition request generated according to the product identifier to the cache server.
[0104] S306, when there is no token corresponding to the product identifier and in an idle state in the cache server, wait for the allocation of the token; the token acquisition request sent is used to instruct the cache server to sort and cache the token acquisition requests according to the reception time of the token acquisition requests to wait for the allocation of the token.
[0105] S308, when the cache server releases the token according to the received token release instruction and the ranking of the token acquisition request is equal to the preset ranking, receive the token allocated by the cache server and jump to step S312 to continue execution.
[0106] S310: When there is a token corresponding to the product identifier and in an idle state in the cache server, receive a token allocated by the cache server.
[0107] S312, generating a credit limit query request according to the token and the product identifier, and sending the credit limit query request to the cache server.
[0108] S314, receiving the product quota fed back by the cache server, and when the product quota is greater than or equal to the application amount, calculating the remaining product quota based on the product quota and the application amount.
[0109] S316, generate a token release instruction according to the remaining amount of the product and the token, and send the token release instruction to the cache server; the token release instruction is used to instruct the cache server to update the product amount in the memory according to the remaining amount of the product and release the token.
[0110] In the above embodiment, when receiving a product application request, each business server in the business server cluster verifies the applicant to ensure the validity of the product application and the security of resources. When the verification is passed, a token acquisition request carrying the product identifier is sent to the cache server to seize the token corresponding to the product identifier from the cache server. The business server that seizes the token queries and updates the product quota in the memory of the cache server based on the token, and the business server that does not seize the token waits for the allocation of the token. The serial preemption efficiency of tokens and product quotas can be improved, thereby improving the efficiency of product data processing.
[0111] like Figure 4 As shown, in one embodiment, a product data processing method is provided, which is applied to Figure 1 Taking the cache server 104 in the example as an example, the following steps are specifically included:
[0112] 402, receiving a token acquisition request sent by the business server, and searching for an idle token in the memory according to the product identifier in the token acquisition request.
[0113] Specifically, the cache server receives a token acquisition request sent by the business server, parses the token acquisition request to obtain a product identifier, and searches the memory for a token that corresponds to the product identifier and is in an idle state according to the product identifier.
[0114] 404: When a token is found, the token is assigned to the business server.
[0115] Specifically, when a token corresponding to the product identifier and in an idle state is found, the cache server distributes the found token to a corresponding service server.
[0116] In one embodiment, the above-mentioned product data processing method also includes: when no token is queried, sorting and caching the token acquisition request according to the reception time of the token acquisition request; when the token is released according to the received token release instruction, according to the sorting of the token acquisition request, the token is allocated to the business server corresponding to the token acquisition request with a sorting ranking equal to a preset ranking.
[0117] Specifically, when no token corresponding to the product identifier in the token acquisition request and in an idle state is found, the cache server sorts and caches the token acquisition request according to the reception time of the token acquisition request to wait for the allocation of the token. When a token release instruction corresponding to the product identifier is received from the business server holding the token, and the token corresponding to the product identifier is released according to the token release instruction, the cache server allocates the released token to the business server corresponding to the token acquisition request with a ranking equal to the preset ranking according to the ranking of each token acquisition request in the sorted cache. It can be understood that when a released token is received, the cache server selects the token acquisition request with the earliest reception time from the token acquisition requests in the sorted cache, and allocates the token to the business server corresponding to the selected token acquisition request.
[0118] In one embodiment, when no token in an idle state is found according to the token acquisition request, the cache server caches the token acquisition request to a cache queue according to the receiving time.
[0119] In one embodiment, the cache server receives token acquisition requests sent by one or more business servers in the business server cluster, and performs the above token allocation operation for each token acquisition request.
[0120] 406, receiving a credit limit query request sent by the business server; the credit limit query request carries a token and a product identifier.
[0121] Specifically, the cache server receives the quota query request sent by the business server, parses the quota query request to obtain the token and product identification, and verifies the token according to the product identification in a preset verification method. The preset verification method is, for example, to query the pre-configured target token according to the product identification, and compare the parsed token with the target token. When the two are consistent, it is determined that the token verification has passed.
[0122] 408, query the product amount corresponding to the product identifier in the memory based on the token, and feed back the queried product amount to the business server.
[0123] Specifically, when the token verification passes, the cache server queries the product amount corresponding to the product identifier in the memory according to the product identifier, and feeds back the queried product amount to the corresponding business server.
[0124] 410, receiving a token release instruction sent by a business server; the token release instruction carries the token and the remaining amount of the product corresponding to the product identifier.
[0125] Specifically, the cache server receives a token release instruction generated and sent by a business server holding the token, parses the token release instruction to obtain the token to be released, and the remaining amount of the product calculated according to the product amount corresponding to the product identifier and the application amount.
[0126] 412, update the product quota in the memory according to the remaining product quota, and release the token.
[0127] Specifically, the cache server queries the corresponding product quota in the memory according to the product remaining quota and / or token obtained by parsing, updates the queried product quota in the memory according to the product remaining quota, and releases the token. In one embodiment, the token release instruction also carries a product identifier. The cache server queries the product quota in the memory according to the product identifier obtained by parsing, and updates the queried product quota according to the product remaining quota.
[0128] In one embodiment, after the token is allocated to the business server, the above-mentioned product data processing method also includes: performing occupancy processing on the token and counting the occupancy time of the token; when the occupancy time is greater than or equal to the preset time, the token is released, and according to the ranking of the token acquisition request, the token is allocated to the business server corresponding to the token acquisition request whose ranking is equal to the preset ranking.
[0129] The occupation duration refers to the length of time that a token is in an occupied state, that is, the length of time that the business server holds the token from the time the token is allocated to the business server. The preset duration is a pre-set time length, which can be customized, such as 10 seconds, or calculated based on multiple historical occupation durations corresponding to the token, such as averaging the multiple historical occupation durations to obtain the preset duration.
[0130] Specifically, when the cache server allocates the queried token to the business server, it obtains the current system time as the allocation time, and after allocating the token to the business server, it performs occupation processing on the token, that is, marks the status of the token as an occupied state or updates the status identifier of the token to an occupied identifier. Before receiving the token released by the business server, the cache server counts the occupation time of the token with the allocation time as the starting time, and compares the counted occupation time with the preset time. When the occupation time is greater than or equal to the preset time, the cache server determines that the business server holding the token is down and automatically releases the token, that is, marks the status of the token as an idle state or updates the status identifier of the token to an idle identifier, and allocates the released token to the business server corresponding to the token acquisition request whose ranking is equal to the preset ranking according to the ranking of each token acquisition request in the sorted cache.
[0131] In the above embodiment, when a token is allocated to a business server and a preset period of time has passed without receiving the token released by the business server, the business server is determined to be down, and the token is automatically released. This can avoid long waiting times due to too many token acquisition requests in the sorted cache, which may cause the cache server to crash due to resource exhaustion. This can ensure the response efficiency of token acquisition requests, thereby ensuring the processing efficiency of product data.
[0132] like Figure 5 As shown, in one embodiment, a product data processing method is provided, and the method specifically includes the following steps:
[0133] S502: The business server obtains a product application request carrying an applicant identifier, an application amount, and a product identifier.
[0134] S504, the business server verifies the applicant according to the applicant information corresponding to the applicant identifier, and when the verification passes, sends a token acquisition request generated according to the product identifier to the cache server.
[0135] S506: The cache server searches the memory for a token in an idle state according to the product identifier in the token acquisition request.
[0136] S508: When the token is found, the cache server distributes the token to the business server.
[0137] S510, the business server generates a credit limit query request according to the token and the product identifier, and sends the credit limit query request to the cache server.
[0138] S512, the cache server queries the product amount corresponding to the product identifier in the memory based on the token, and feeds back the queried product amount to the business server.
[0139] S514, when the product quota is greater than or equal to the application amount, the business server calculates the remaining product quota based on the product quota and the application amount.
[0140] S516, the business server generates a token release instruction according to the remaining amount of the product and the token, and sends the token release instruction to the cache server.
[0141] S518, the cache server updates the product quota in the memory according to the remaining product quota and releases the token.
[0142] It should be understood that although Figure 2-5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0143] In one embodiment, Figure 1 As shown, a product data processing system is provided, which includes: a business server cluster 102 and a cache server 104; wherein the business server cluster 102 includes a business server 102a;
[0144] The business server 102a is used to obtain a product application request carrying an applicant identifier, an application amount, and a product identifier; verify the applicant according to the applicant information corresponding to the applicant identifier, and when the verification passes, send a token acquisition request generated according to the product identifier to the cache server 104;
[0145] The cache server 104 is used to query the idle token in the memory according to the product identification in the token acquisition request; when the token is found, the token is allocated to the business server 102a;
[0146] The business server 102a is further used to generate a credit limit query request according to the token and the product identifier, and send the credit limit query request to the cache server 104;
[0147] The cache server 104 is further used to query the product quota corresponding to the product identifier in the memory based on the token, and feed back the queried product quota to the business server 102a;
[0148] The business server 102a is also used to calculate the remaining amount of the product according to the product amount and the application amount when the product amount is greater than or equal to the application amount; generate a token release instruction according to the remaining amount of the product and the token, and send the token release instruction to the cache server 104;
[0149] The cache server 104 is also used to update the product quota in the memory according to the remaining product quota in the token release instruction and release the token.
[0150] In one embodiment, the business server 102a is also used to wait for the allocation of the token when there is no token corresponding to the product identifier and in an idle state in the cache server; the cache server 104 is also used to sort and cache the token acquisition requests according to the reception time of the token acquisition requests to wait for the allocation of the token; when releasing the token according to the received token release instruction, the token is allocated to the business server corresponding to the token acquisition request with a sorting rank equal to a preset rank according to the sorting of the token acquisition requests; the business server 102a is also used to receive the token allocated by the cache server 104 when the cache server 104 releases the token according to the received token release instruction and the sorting rank of the token acquisition request is equal to the preset rank.
[0151] like Figure 6 As shown, in one embodiment, the product data processing system further includes: a processing server 106 and a storage server 108;
[0152] The business server 102a is also used to forward the product application request to the processing server 106;
[0153] Processing server 106, used for product application processing;
[0154] The business server 102a is further configured to generate a credit limit update instruction according to the product identifier and the application amount when receiving an application result indicating a successful application from the processing server 106 in response to the product application request; and send the credit limit update instruction to the storage server 108;
[0155] The storage server 108 is used to update the product quota corresponding to the product identifier in the database according to the application amount.
[0156] In one embodiment, the cache server 104 is the master server in the cache server cluster; the business server 102a is also used to monitor the master-slave switching event in real time; the master-slave switching event refers to switching the current master server in the cache server cluster to the slave server to obtain the switched master server; when the master-slave switching event is monitored, trigger the generation of a permission acquisition request; send the permission acquisition request to the master server, and when the permission certificate assigned by the master server is received, obtain the latest version of the product quota from the database of the storage server; send the permission certificate and the latest version of the product quota to the master server, so that the master server stores the latest version of the product quota in the memory based on the permission certificate. It can be understood that after the cache server cluster triggers the master-slave switching event, the switched master server is used as the cache server 104 to perform the operations performed by the cache server 104 in one or more of the above embodiments, such as allocating tokens according to the token acquisition request, querying the product quota in the memory according to the quota query request, and updating the product quota in the memory and releasing the token according to the token release instruction.
[0157] In one embodiment, the cache server 104 is also used to process the occupancy of the token and count the occupancy time of the token; when the occupancy time is greater than or equal to the preset time, the token is released and, according to the ranking of the token acquisition request, the token is allocated to the business server corresponding to the token acquisition request whose ranking is equal to the preset ranking.
[0158] In one embodiment, each business server in the business server cluster is used to verify the applicant according to the product application request when obtaining a product application request triggered by a user, and to seize the token corresponding to the product identifier and in an idle state from the cache server after the verification is passed, and to seize the product quota from the cache server according to the seized token, so as to determine whether to perform corresponding product application processing for the product application request according to the seized product quota and the application amount in the product application request, and whether to update the product quota in the cache server according to the seized product quota and the application amount. The cache server is used to store the token and product quota corresponding to each product identifier in the memory, and is also used to allocate the token corresponding to the product identifier and in an idle state to the business server corresponding to the token acquisition request with the earliest reception time according to the token acquisition request sent by each business server, and is also used to feedback the product quota to the business server that currently seizes the token according to the quota query request.
[0159] Furthermore, the processing server is used to receive a product application request sent by the business server when the business server determines that the product quota is greater than or equal to the application amount, and to process the product application according to the product application request. It can be understood that the processing server is similar to a central server of an exchange. The storage server is used to persistently store the successful application amount in the database when the application result corresponding to the product application request is a successful application, and to update the corresponding product quota in the database according to the application amount. It can be understood that the cache server stores the product quota in the memory so that the corresponding product quota can be quickly queried and fed back according to the quota query request. When the product quota in the memory of the cache server is lost due to a failure or downtime, the product quota in the cache server memory can be restored according to the product quota stored in the database by the storage server to ensure the security and reliability of the product quota.
[0160] For the specific limitations on the product data processing system, please refer to the limitations on the product data processing method above, which will not be repeated here.
[0161] In one embodiment, a computer device is provided. The computer device may be a service server or a cache server. The internal structure diagram thereof may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store applicant information, or the token and product quota corresponding to the product identification. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a product data processing method is implemented.
[0162] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0163] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the product data processing method in each of the above embodiments when executing the computer program.
[0164] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the product data processing method in each of the above embodiments are implemented.
[0165] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0166] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0167] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A product data processing method, applied to a business server in a business server cluster, the method comprising: Obtain a product application request with an applicant ID, an application amount, and a product ID; Query the corresponding product status according to the product identification, and when the queried product status is an applicable status, verify the applicant according to the applicant information corresponding to the applicant identification, and when the verification passes, send the token acquisition request generated according to the product identification to the cache server; wherein the cache server is pre-configured with the corresponding token for each product identification locally; When there is no token corresponding to the product identifier and in an idle state in the cache server, wait for the allocation of the token; the sent token acquisition request is used to instruct the cache server to sort and cache the token acquisition request according to the reception time of the token acquisition request to wait for the allocation of the token; when the cache server releases the token according to the received token release instruction and the sorting rank of the token acquisition request is equal to the preset rank, receive the token allocated by the cache server; When there is a token corresponding to the product identifier and in an idle state in the cache server, receiving the token allocated by the cache server; the state identifier of the allocated token is updated to an occupied identifier; generating a credit limit query request according to the token and the product identifier, and sending the credit limit query request to the cache server; receiving the product quota fed back by the cache server, and when the product quota is greater than or equal to the application amount, calculating the remaining product quota according to the product quota and the application amount; A token release instruction is generated according to the remaining amount of the product and the token, and the token release instruction is sent to the cache server; the token release instruction is used to instruct the cache server to update the product amount in the memory according to the remaining amount of the product, and release the token corresponding to the product identifier, and update the status identifier of the released token to the idle identifier.
2. The method according to claim 1, characterized in that After sending the token release instruction to the cache server, the method further includes: forwarding the product application request to a processing server; the forwarded product application request is used to instruct the processing server to process the product application; When receiving an application result indicating a successful application fed back by the processing server in response to the product application request, generating a quota update instruction according to the product identifier and the application amount; The credit limit update instruction is sent to the storage server; the credit limit update instruction is used to instruct the storage server to update the product credit limit corresponding to the product identifier in the database according to the application amount.
3. The method according to claim 2, characterized in that The cache server is a master server in a cache server cluster; the method further comprises: Monitor the master-slave switching event in real time; the master-slave switching event refers to switching the current master server in the cache server cluster to a slave server to obtain the switched master server; When the master-slave switching event is monitored, triggering the generation of a permission acquisition request; Sending the permission acquisition request to the main server, and upon receiving the permission certificate assigned by the main server, acquiring the latest version of the product quota from the database of the storage server; The authority certificate and the latest version of the product quota are sent to the main server, so that the main server stores the latest version of the product quota in a memory based on the authority certificate.
4. A product data processing method, applied to a cache server, the method comprising: Receive a token acquisition request sent by a business server; The token acquisition request is generated by the business server according to the product identification after it is found that the product status corresponding to the product identification is in the application status and the applicant corresponding to the applicant identification has passed the verification; Querying a token in an idle state in the memory according to the product identification in the token acquisition request; wherein the cache server is pre-configured with a corresponding token for each product identification locally; When the token is not found, the token acquisition request is sorted and cached according to the reception time of the token acquisition request; when the token is released according to the received token release instruction, the token is allocated to the business server corresponding to the token acquisition request with a ranking equal to the preset ranking according to the ranking of the token acquisition request; When the token is found, the token is allocated to the service server; the state flag of the allocated token is updated to an occupied flag; receiving a credit limit query request sent by the business server; the credit limit query request carries the token and the product identifier; Based on the token, query the product amount corresponding to the product identifier in the memory, and feed back the queried product amount to the business server; Receiving a token release instruction sent by the business server; the token release instruction carries the token and the remaining amount of the product corresponding to the product identifier; The product quota in the memory is updated according to the remaining quota of the product, and the token corresponding to the product identifier is released, and the state identifier of the released token is updated to an idle identifier.
5. The method according to claim 4, characterized in that After allocating the token to the service server, the method further includes: Performing occupation processing on the token and counting the occupation time of the token; When the occupation time is greater than or equal to the preset time, the token is released, and according to the ranking of the token acquisition request, the token is allocated to the business server corresponding to the token acquisition request with a ranking equal to the preset ranking.
6. A product data processing system, characterized in that: The system comprises: a business server and a cache server; The business server is used to obtain a product application request carrying an applicant identifier, an application amount, and a product identifier; query the corresponding product status according to the product identifier, and when the queried product status is an applicable status, verify the applicant according to the applicant information corresponding to the applicant identifier, and when the verification passes, send a token acquisition request generated according to the product identifier to the cache server; wherein the cache server is pre-configured with a corresponding token for each product identifier locally; The cache server is used to query the idle token in the memory according to the product identification in the token acquisition request; when the token is not found, the token acquisition request is sorted and cached according to the reception time of the token acquisition request; when the token is released according to the received token release instruction, the token is allocated to the business server corresponding to the token acquisition request with a ranking equal to the preset ranking according to the ranking of the token acquisition request; when the token is found, the token is allocated to the business server; the state identifier of the allocated token is updated to the occupied identifier; The business server is further configured to generate a quota query request according to the token and the product identifier, and send the quota query request to the cache server; the cache server is further configured to query the product quota corresponding to the product identifier in the memory based on the token, and feed back the queried product quota to the business server; The business server is further configured to calculate the remaining amount of the product according to the product amount and the application amount when the product amount is greater than or equal to the application amount; generate a token release instruction according to the remaining amount of the product and the token, and send the token release instruction to the cache server; The cache server is further used to update the product quota in the memory according to the remaining product quota in the token release instruction, release the token corresponding to the product identifier, and update the state identifier of the released token to an idle identifier.
7. A product data processing device, applied to a business server in a business server cluster, characterized in that: The device comprises: An acquisition module is used to acquire a product application request carrying an applicant identifier, an application amount, and a product identifier; A first determination module is used to query the corresponding product status according to the product identification, and when the queried product status is an applicable status, verify the applicant according to the applicant information corresponding to the applicant identification, and when the verification is passed, send a token acquisition request generated according to the product identification to the cache server; wherein the cache server is pre-configured with a corresponding token for each product identification locally; The first determination module is further used for waiting for the allocation of the token when there is no token corresponding to the product identifier and in an idle state in the cache server; the token acquisition request sent is used to instruct the cache server to sort and cache the token acquisition request according to the reception time of the token acquisition request to wait for the allocation of the token; when the cache server releases the token according to the received token release instruction and the sorting rank of the token acquisition request is equal to the preset rank, receiving the token allocated by the cache server; An updating module, configured to receive the token allocated by the cache server when there is a token corresponding to the product identifier and in an idle state in the cache server; the state identifier of the allocated token is updated to an occupied identifier; A second determination module, configured to generate a credit limit query request according to the token and the product identifier, and send the credit limit query request to the cache server; The second determination module is further configured to receive the product quota fed back by the cache server, and when the product quota is greater than or equal to the application amount, calculate the remaining product quota according to the product quota and the application amount; The update module is also used to generate a token release instruction based on the remaining amount of the product and the token, and send the token release instruction to the cache server; the token release instruction is used to instruct the cache server to update the product amount in the memory according to the remaining amount of the product, and release the token corresponding to the product identifier, and update the status identifier of the released token to an idle identifier.
8. A product data processing device, applied to a cache server, characterized in that: The device comprises: A receiving module, used to receive a token acquisition request sent by a business server; the token acquisition request is generated by the business server according to the product identification after it is found that the product status corresponding to the product identification is in the application status and the applicant corresponding to the applicant identification passes the verification; A query module, used to query a token in an idle state in a memory according to a product identifier in the token acquisition request; wherein the cache server is pre-configured with a corresponding token for each product identifier locally; when the token is not queried, the token acquisition request is sorted and cached according to the reception time of the token acquisition request; when the token is released according to the received token release instruction, the token is allocated to a business server corresponding to the token acquisition request with a ranking equal to a preset ranking according to the ranking of the token acquisition request; when the token is queried, the token is allocated to the business server; the state identifier of the allocated token is updated to an occupied identifier; The receiving module is further used to receive a credit limit query request sent by the business server; the credit limit query request carries the token and the product identifier; The query module is further used to query the product quota corresponding to the product identifier in the memory based on the token, and feed back the queried product quota to the business server; The receiving module is further used to receive a token release instruction sent by the business server; the token release instruction carries the token and the remaining amount of the product corresponding to the product identifier; The query module is also used to update the product quota in the memory according to the remaining quota of the product, release the token corresponding to the product identifier, and update the state identifier of the released token to an idle identifier.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Panic buying request processing method, application server cluster and storage medium
CN108897615A