Transaction processing method, apparatus, device and medium for distributed system

By performing keyword analysis on transaction requests and dynamically allocating servers to preload target processing models in distributed systems, the problem of low transaction processing efficiency in distributed systems is solved, and more efficient transaction processing is achieved.

CN115292008BActive Publication Date: 2026-03-31CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-09
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In distributed systems, multiple types of transaction requests cause servers to frequently switch processing models, resulting in low transaction processing efficiency.

Method used

By performing keyword analysis on the transaction requests to be processed, mapping them to the corresponding transaction categories, determining the target processing model, and dynamically allocating servers in the distributed system for preloading, the frequent switching of processing models can be avoided.

Benefits of technology

It improves the transaction processing efficiency of distributed systems, reduces the redundant waiting time of the processing model, and enhances processing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115292008B_ABST
    Figure CN115292008B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computers and networks, in particular to a transaction processing method and device for a distributed system, equipment and a medium. The method performs keyword analysis on a to-be-processed transaction request to determine a keyword, maps the keyword to a transaction category through a mapping table, compares the keyword with a transaction category keyword set to determine a target transaction category, and further determines a target processing model. If a server loaded with the target processing model does not exist in the distributed system, an idle server in the distributed system is selected as a target server, the target server is called to preload the target processing model, the to-be-processed transaction request is sent to the target server, a transaction processing result is obtained, the to-be-processed transaction request is dynamically distributed in the distributed system, frequent switching of processing models is avoided, the processing model is preloaded, the redundant waiting time is shortened, and the transaction processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer and network technology, and in particular to a transaction processing method, apparatus, device and medium for distributed systems. Background Technology

[0002] Currently, server transaction processing typically involves a complete processing cycle. Taking semantic analysis transactions as an example, it requires three stages: preprocessing, character recognition, and natural language processing. Character recognition is achieved through a recognition model, while natural language processing is achieved through a language model. Here, the recognition model and the language model are collectively referred to as the processing model. The server's transaction processing capacity is usually described using TPS (Transactions Per Second), which is the number of transactions a server can process per second.

[0003] However, in order to ensure transaction processing speed, the processing model is usually lightweight, that is, there is a corresponding processing model for specific transaction types. Therefore, different types of transactions need to use different processing models. In distributed, high-concurrency transaction processing scenarios, multiple types of transaction requests cause the server to frequently switch processing models during processing, resulting in low transaction processing efficiency. Therefore, how to improve the transaction processing efficiency in distributed scenarios has become an urgent problem to be solved. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a transaction processing method, apparatus, device and medium for distributed systems to solve the problem of low transaction processing efficiency in distributed scenarios.

[0005] In a first aspect, embodiments of the present invention provide a transaction processing method for a distributed system, the transaction processing method comprising:

[0006] Perform keyword analysis on the acquired pending transaction requests to identify N keywords, where N is a positive integer.

[0007] The N keywords are mapped through a preset mapping table to determine the transaction category of the corresponding keyword. The mapping table includes the mapping relationship between transaction categories and keywords.

[0008] Compare all keywords with at least one preset set of transaction category keywords, and determine the target transaction category to which the transaction request to be processed belongs based on the comparison results;

[0009] Based on the target transaction category, determine the target processing model corresponding to the target transaction category, and detect whether there is a server in the distributed system that has loaded the target processing model;

[0010] If there is no server in the distributed system that has loaded the target processing model, then any idle server in the distributed system is selected as the target server, and the target server is called to preload the target processing model.

[0011] After the target processing model is preloaded, the pending transaction request is sent to the target server that has completed the preloading to obtain the transaction processing result.

[0012] In a second aspect, embodiments of the present invention provide a transaction processing apparatus for a distributed system, the transaction processing apparatus comprising:

[0013] The keyword analysis module is used to analyze the acquired pending transaction requests and identify N keywords, where N is a positive integer.

[0014] The category mapping module is used to map the N keywords respectively through a preset mapping table to determine the transaction category of the corresponding keyword. The mapping table includes the mapping relationship between transaction categories and keywords.

[0015] The keyword comparison module is used to compare all keywords with at least one preset set of transaction category keywords, and determine the target transaction category to which the transaction request to be processed belongs based on the comparison results.

[0016] The model detection module is used to determine the target processing model corresponding to the target transaction category based on the target transaction category, and to detect whether there is a server in the distributed system that has loaded the target processing model;

[0017] The preloading module is used to select any idle server in the distributed system as the target server if there is no server in the distributed system that has already loaded the target processing model, and call the target server to preload the target processing model.

[0018] The transaction processing module is used to send the pending transaction request to the target server that has completed preloading after the target processing model has been preloaded, and obtain the transaction processing result.

[0019] Thirdly, embodiments of the present invention provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the transaction processing method as described in the first aspect.

[0020] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the transaction processing method as described in the first aspect.

[0021] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows:

[0022] The system performs keyword analysis on the acquired pending transaction requests to identify N keywords. These N keywords are then mapped using a pre-defined mapping table to determine the corresponding transaction category. All keywords are compared with at least one pre-defined set of transaction category keywords. Based on the comparison results, the target transaction category to which the pending transaction request belongs is determined. Based on the target transaction category, the target processing model for that category is determined. The system checks if a server in the distributed system has already loaded the target processing model. If no server has loaded the target processing model, an idle server is randomly selected from the distributed system as the target server, and the target server is invoked to preload the target processing model. After the target processing model is preloaded, the pending transaction request is sent to the preloaded target server to obtain the transaction processing result. This distributed system allocates pending transaction requests, avoiding frequent switching of processing models on a single server and the resulting additional time consumption, thus improving the transaction processing efficiency of the distributed system. Furthermore, preloading the processing model when it is needed reduces redundant waiting time when the processing model processes transaction requests, further improving the transaction processing efficiency of the distributed system. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a schematic diagram of an application environment for a transaction processing method for a distributed system provided in Embodiment 1 of the present invention;

[0025] Figure 2 This is a flowchart illustrating a transaction processing method for a distributed system provided in Embodiment 1 of the present invention;

[0026] Figure 3 This is a flowchart illustrating a transaction processing method for a distributed system provided in Embodiment 2 of the present invention;

[0027] Figure 4 This is a schematic diagram of the structure of a transaction processing device for a distributed system provided in Embodiment 3 of the present invention;

[0028] Figure 5This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Detailed Implementation

[0029] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0030] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0031] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0032] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0033] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0034] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0035] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0036] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0037] The method provided in Embodiment 1 of the present invention can be applied to, for example... Figure 1 In this application environment, the local client communicates with the distributed server. The local client includes, but is not limited to, PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud terminal devices, and personal digital assistants (PDAs). The distributed server can be implemented using a server cluster consisting of multiple servers.

[0038] See Figure 2 This is a flowchart illustrating a transaction processing method for a distributed system provided in Embodiment 1 of the present invention. The transaction processing method described above can be applied to... Figure 1 The local client, a computer device corresponding to the local client, communicates with the distributed server. Upon receiving a transaction request, the local client accesses the distributed server to obtain loading information for each server. The local client's computer device has storage capabilities, storing a mapping table and a set of transaction category keywords. The mapping table maps keywords to transaction categories, and the set of transaction category keywords is used to compare with the keywords to determine the target transaction category. For example... Figure 2 As shown, the transaction processing method may include the following steps:

[0039] Step S201: Perform keyword analysis on the acquired pending transaction requests to determine N keywords.

[0040] Here, the pending transaction request can refer to the request message received by the local client. The request message can include the request method, protocol, header and request data. Keywords can refer to words in the request data that can represent the request content. N is an integer greater than zero.

[0041] Specifically, keyword analysis can refer to comparing and searching the request data using a pre-set keyword thesaurus, extracting keywords that exist in the keyword thesaurus from the request data. The keyword thesaurus may include several keywords. For any keyword, a search is performed in the request data. If the search result shows that the request data contains the keyword, then the keyword is retained. If the search result shows that the request data does not contain the keyword, then the keyword is filtered out, resulting in N retained keywords.

[0042] The above steps of analyzing keywords in the acquired pending transaction requests to determine N keywords facilitate the determination of the transaction category of the pending transaction requests based on the keywords. This avoids the need for subsequent analysis of interfering or generic words in the pending transaction requests, effectively improving the efficiency of the process of determining the transaction category of pending transaction requests, thereby improving transaction processing efficiency.

[0043] Step S202: Map the N keywords through a preset mapping table to determine the transaction category of the corresponding keywords.

[0044] The mapping table includes the mapping relationship between transaction categories and keywords. In this embodiment, transaction processing can refer to text information extraction, and correspondingly, transaction category can refer to the semantic category to which the text information belongs.

[0045] Specifically, semantic categories can include categories such as international, sports, and society. Implementers can refer to the label data of existing text classification datasets to divide semantic categories. Existing datasets can be selected such as the THUCNews dataset, the SogouCA dataset, and the Datahub dataset.

[0046] The mapping in the mapping table is {x1, x2, ..., x...} w}→y, where x can refer to a keyword and y can refer to a transaction category, meaning that multiple keywords can be mapped to the same transaction category.

[0047] The above steps, which map N keywords to a pre-defined mapping table to determine the corresponding transaction category, obtain the transaction category of the keyword through the mapping table. This process is efficient and accurate, facilitating subsequent analysis and determination of the target transaction category, thereby effectively improving transaction processing efficiency.

[0048] Step S203: Compare all keywords with at least one preset set of transaction category keywords, and determine the target transaction category to which the transaction request to be processed belongs based on the comparison results.

[0049] The transaction category keyword set can be a set of keywords belonging to the same transaction category, and the target transaction category can be the transaction category to which the transaction request to be processed belongs.

[0050] Specifically, based on the mapping results of each keyword, several transaction categories are obtained. Each transaction category corresponds to a set of transaction category keywords. Since the keywords contained in the same request data may correspond to different transaction categories, it is necessary to determine the transaction category to which the request data belongs.

[0051] It should be noted that the mapping relationships contained in the mapping table are not complete, meaning that there may be cases where keywords do not belong to any mapping relationship. Therefore, after determining the transaction category to which the requested data belongs, a mapping relationship can be constructed based on the transaction category to which the requested data belongs and the keywords contained in the requested data, and the mapping table can be updated.

[0052] In this embodiment, the number of keywords mapped to each transaction category is counted, and the transaction category with the largest number of statistics is determined as the target transaction category.

[0053] Optionally, the transaction category keyword set includes at least one storage keyword;

[0054] Compare all keywords with at least one pre-defined set of transaction category keywords, including:

[0055] For any given keyword, calculate the distance between the keyword and any stored keyword, and obtain the distance calculation result;

[0056] The system checks whether the distance calculation result is less than a preset distance threshold. If the distance calculation result is less than the distance threshold, it determines that the keyword and the stored keyword are consistent.

[0057] Among them, the stored keyword can refer to the element in the set of transaction category keywords, the distance can be used to characterize the similarity between the keyword and the stored keyword, and the distance threshold can be used to determine whether the keyword and the stored keyword are the same word.

[0058] Specifically, keywords can be viewed as strings composed of characters. When calculating the distance, the keywords and stored keywords need to be expanded to the same size, that is, the number of characters contained in the strings is the same. The string lengths of the keywords and stored keywords can be obtained by using a character statistics function, which can be the len() function. The longest string length is determined as the size to be expanded. In this embodiment, the distance threshold is set to 0.5.

[0059] Compare the keyword characters at each position with the stored keyword characters. If the characters match, the comparison result is 0; otherwise, the comparison result is 1. The distance calculation formula is:

[0060]

[0061] Where D can refer to the distance calculation result between the keyword and the stored keyword, G can refer to the number of characters in the expanded size, and s g This could refer to the comparison result between the keyword character at position g and the stored keyword character.

[0062] This embodiment calculates the distance between keywords and stored keywords by comparing characters, avoiding inaccurate matching of similar keywords, thereby improving the accuracy of keyword matching.

[0063] The above steps compare all keywords with at least one preset set of transaction category keywords and determine the target transaction category to which the transaction request to be processed belongs based on the comparison results. By determining the target transaction category through comparison analysis, the accuracy of transaction processing is improved, avoiding the situation where the determined target transaction category is inaccurate.

[0064] Step S204: Based on the target transaction category, determine the target processing model corresponding to the target transaction category, and detect whether there is a server in the distributed system that has loaded the target processing model.

[0065] The target processing model can refer to the processing model trained based on training samples under the target transaction category. In other words, the target processing model can obtain accurate transaction processing results only when processing pending transaction requests under the target transaction category.

[0066] A distributed system can refer to a distributed server, which consists of a cluster of several independent servers.

[0067] Specifically, due to the diversity and complexity of the text corresponding to the pending transaction requests, using a processing model with strong generalization will inevitably result in a certain loss of accuracy. That is, when the processing model can handle pending transaction requests of multiple transaction categories, the accuracy of the transaction processing results of the processing model will be low. Therefore, in order to ensure the accuracy of transaction processing, it is necessary to train multiple processing models to handle pending transaction requests under different transaction categories.

[0068] The model needs to be preloaded to run. In application scenarios with multiple processing models, the received transaction requests do not always belong to a specific transaction category. Therefore, when using a separate server for transaction processing, it is necessary to frequently preload and unload the processing model, which greatly reduces the efficiency of transaction processing.

[0069] In a distributed system, the independent servers can communicate with each other, and thus distribute the pending transaction requests received by the local client to the target processing model that has been loaded with the corresponding transaction category of the pending transaction request. This minimizes the overhead of model preloading and unloading, and improves transaction processing efficiency.

[0070] Optionally, after detecting whether a server with the target processing model has been loaded in the distributed system, the following steps are also included:

[0071] If a server with the target processing model already loaded is detected in the distributed system, then the server with the target processing model loaded is determined to be the target server.

[0072] Send the pending transaction request to the target server and obtain the transaction processing result.

[0073] In this context, the target server can refer to the server that will process the pending transaction request. In this embodiment, the transaction request can refer to semantic extraction, and correspondingly, the transaction processing result can refer to the semantic extraction result.

[0074] Specifically, after detecting a server that has loaded the target processing model, the implementer can read the server's pending transaction request queue. If the number of pending transaction requests in the queue is less than a preset threshold, the server is identified as the target server. This avoids the server's pending transaction request queue becoming too long, making it difficult to process the current pending transaction requests in a timely manner. In this embodiment, the threshold is preset to 8. The implementer can adjust this threshold according to the actual processing time limit of the current pending transaction requests and the average length of the pending transaction request queue of each server in the distributed system. For example, the shorter the actual processing time limit of the current pending transaction requests, the smaller the threshold; the shorter the average length of the pending transaction request queue of each server in the distributed system, the smaller the threshold.

[0075] It should be noted that when multiple servers with the target processing model already loaded are detected, the server that meets the condition that the number of pending transaction requests in the pending transaction request queue is less than the preset threshold and has the shortest pending transaction request queue is determined as the target server.

[0076] This embodiment queries the distributed system for servers that have loaded the target processing model and dynamically allocates the transaction requests to be processed, thereby minimizing the preloading process of the target processing model and improving the transaction processing efficiency of the distributed system.

[0077] The above steps, which determine the target processing model corresponding to the target transaction category and detect whether there are servers in the distributed system that have already loaded the target processing model, enable targeted queries of the target processing model on each server in the distributed system based on the target transaction category. This avoids frequent preloading of processing models and improves the overall transaction processing efficiency of the distributed system.

[0078] Step S205: If there is no server in the distributed system that has loaded the target processing model, then select any idle server in the distributed system as the target server and call the target server to preload the target processing model.

[0079] Here, an idle server can refer to a server that has not loaded any processing model, while preloading can refer to loading the parameters of the trained target processing model into the server.

[0080] Optionally, the target processing model includes a target recognition model and a target language model;

[0081] Invoking the target server to preload the target processing model includes:

[0082] Based on the request timestamp sent to the target server by the pending transaction request, the preloading process of the target recognition model is initiated;

[0083] Based on the historical average loading time and request timestamp of the target language model, the preloading timestamp of the target language model is determined. When the current timestamp matches the preloading timestamp, the preloading process of the target language model is started.

[0084] Among them, the target recognition model can be used to perform text recognition on the transaction processing content to obtain the text recognition result, and the target language model can be used to extract semantics from the text recognition result to obtain the semantic extraction result.

[0085] The request timestamp can refer to the timestamp when the target server receives the request for the pending transaction. The historical average loading time can refer to the average time taken by the target language model in multiple historical preloading processes. The preloading timestamp can refer to the timestamp when the target language model starts preloading. The current timestamp can refer to the timestamp of the current moment.

[0086] Specifically, the sum of the request timestamp and the historical average loading time is determined as the preloading timestamp, thereby maximizing the guarantee that the pending transaction requests are processed by the target recognition model and then processed by the target language model in the shortest possible time interval.

[0087] This embodiment preloads the target recognition model and target language model in the target processing model by recognizing the timestamp and preloading the timestamp, thereby saving redundant model loading waiting time, reducing server load, and improving transaction processing efficiency.

[0088] If no server in the distributed system has loaded the target processing model, the above steps involve selecting an idle server from the distributed system as the target server and calling the target server to preload the target processing model. This preloading process saves redundant waiting time during the processing model calculation process, improves the processing efficiency of a single pending transaction request, and thus improves the transaction processing efficiency of the distributed system.

[0089] Step S206: After the target processing model is preloaded, the transaction request to be processed is sent to the target server that has completed the preloading, and the transaction processing result is obtained.

[0090] The transaction processing result can refer to the processing result corresponding to the transaction request to be processed. In this embodiment, the transaction processing request to be processed is a semantic extraction request, and correspondingly, the transaction processing result is the semantic extraction result.

[0091] Optionally, after obtaining the transaction result, the following may also be included:

[0092] Retrieve the historical transaction request queue of the distributed system;

[0093] Based on the historical transaction request queue, the predicted probability of the pending transaction request recurring is obtained through a trained temporal convolutional network model.

[0094] Check if the predicted probability meets the preset conditions. If the predicted probability meets the preset conditions, deregister the target server.

[0095] The historical transaction request queue can refer to a sequence of transaction requests received by a distributed system within a historical time period, arranged in chronological order of receipt. Temporal convolutional network models can be used to predict future transaction requests based on this historical queue. It should be noted that the prediction can refer to the transaction category of future pending transaction requests.

[0096] Predicted probability can refer to the probability that a target transaction category will reappear within a preset time period, while unregistering can refer to deleting the loaded target processing model parameters, which is to initialize the model architecture within the server.

[0097] Specifically, arbitrarily select a sample transaction request queue of length L, set the window length to S, set the window step size to 1, and set the starting position of the window to the leftmost position of the sample transaction request queue. Use the window to truncate the sample transaction request queue to obtain a single training sample. The label corresponding to the training sample is the rightmost sample transaction request of the rightmost sample transaction request of the training sample. Then, slide the window from left to right according to the window step size to obtain L-S+1 training samples and their corresponding labels.

[0098] It should be noted that each sample transaction request in the above sample transaction request queue is a transaction type, that is, the output of the temporal convolutional network model is a classification layer. In this embodiment, the classification layer is implemented by using a fully connected layer combined with a normalized exponential function.

[0099] Cross-entropy loss is used as the loss function during the training of the temporal convolutional network model. The cross-entropy loss is calculated based on the output of the classification layer and the label. Based on the cross-entropy loss, the parameters of the temporal convolutional network model are updated using gradient descent until the cross-entropy loss converges, thus obtaining the trained temporal convolutional network model.

[0100] The historical transaction request queue is input into the trained temporal convolutional network model. Similarly, a window of length S is slid with a stride of 1 to determine the input quantity for each step. For example, if the length of the historical transaction request queue is l, the initial input quantity corresponds to the l-S+1 to l-th transaction requests. The l+1-th transaction request is predicted. After obtaining the l+1-th transaction request, the window slides to the right by one stride, and the second input quantity corresponds to the l-S+2 to l+1-th transaction requests. This process continues until the l+Q-th transaction request is obtained, where Q can refer to the length of a preset time period.

[0101] It should be noted that the implementer can start extracting the input from any historical transaction request. In this case, the input from the transaction request before the (l-S+1)th transaction request can be used to verify the accuracy of the model.

[0102] The output of the fully connected layer is the confidence score for each transaction category. The number of transaction categories is C. For example, assuming there are 3 transaction categories, the output will be 2, 15, 7. The formula for the normalized exponential function is: Where, m c It can refer to the confidence level of the c-th transaction category, softmax(m c ) can refer to the exponentially normalized result of the confidence level of the c-th transaction category.

[0103] The normalized confidence index results of the corresponding target transaction requests within the preset time period are averaged, and the average result is determined as the predicted probability of the pending transaction request recurring.

[0104] This embodiment uses a temporal convolutional network model to predict the probability of a pending transaction request recurring, and then determines whether to deregister the target server. This avoids receiving pending transaction requests of the same transaction type again after the target server has been deregistered, which would require reloading the target processing model and reduce transaction processing efficiency. This effectively improves the transaction processing efficiency of the distributed system.

[0105] Optionally, after detecting whether the predicted probability meets the preset conditions, the following steps are also included:

[0106] If the predicted probability does not meet the preset conditions, retain the preloaded content of the target processing model in the target server;

[0107] Preload information is generated based on the preloaded content, and the preload information is synchronized to the distributed system.

[0108] The preloaded content can refer to the parameters of the target processing model being loaded, and the preloaded information can refer to the correspondence between the server ID and the corresponding transaction category of the loaded target processing model.

[0109] Specifically, the target server synchronizes the preloaded information to other distributed servers in the distributed system. That is, each distributed server has real-time loading information. Synchronization is the process of information transmission. To ensure the security of information transmission between distributed servers, the implementer can use asymmetric encryption to transmit the loading information.

[0110] In this embodiment, the pre-loaded target processing model information to be retained is sent to the distributed system, so that the client only needs to access a distributed server to obtain the loading information, which effectively saves the time consumed by the client to obtain information, thereby improving the efficiency of transaction processing in the distributed system.

[0111] The steps described above, which involve sending the transaction request to be processed to the preloaded target server after the target processing model has been preloaded, and obtaining the transaction processing result, directly process the transaction request using the preloaded target processing model. This eliminates the need for model loading during the processing, thereby effectively improving transaction processing efficiency.

[0112] See Figure 3 This is a flowchart illustrating a transaction processing method based on artificial intelligence provided in Embodiment 2 of the present invention. In this transaction processing method, the target transaction category can be determined by statistically analyzing the keywords of each transaction category and determining the transaction category with the largest statistical quantity as the target transaction category, or by calculating the keyword proportion of each transaction category and determining the transaction category that meets the preset conditions as the target transaction category.

[0113] The process of statistically analyzing the keywords of each transaction category and determining the transaction category with the largest statistical value as the target transaction category can be found in Example 1, and will not be repeated here.

[0114] When calculating the keyword proportion for each transaction category, the comparison results include those showing consistency. The process of determining the transaction category that meets the preset conditions as the target transaction category includes:

[0115] Step S301: For any set of keywords for a transaction category, retain the preset keywords in the set of keywords for the transaction category that match the comparison results of each keyword, and obtain K reference keywords;

[0116] Step S302: Calculate the intersection of the set of reference keywords and the set of transaction category keywords;

[0117] Step S303: Count the number of reference keywords within the intersection and calculate the ratio of the statistical result to K. If the ratio is greater than the preset ratio threshold, then the transaction category of the corresponding transaction category keyword set is determined as the target transaction category.

[0118] Where K is an integer greater than zero, the set of transaction category keywords contains at least one preset keyword, and the reference keyword can refer to a preset keyword that matches the keyword comparison result.

[0119] The set of reference keywords can refer to the set of words with reference keywords as elements, and the intersection can refer to the duplicate elements between the set of reference keywords and the set of transaction category keywords.

[0120] The ratio of the statistical result to K can represent the proportion of keywords in each transaction category. The ratio threshold can be used to determine whether a reference keyword can correspond to a transaction category. In this embodiment, the ratio threshold is set to 0.6.

[0121] Specifically, the preset ratio thresholds can include a first ratio threshold and a second ratio threshold. The first ratio threshold can be used to determine whether a reference keyword corresponds to a transaction category, while the second ratio threshold can be used to determine whether the corresponding result can be used to expand the mapping table. For example, the first ratio threshold can be set to 0.6. When the ratio of the statistical result to K is greater than 0.6, it indicates that many reference keywords belong to the same transaction category, and the pending transaction request can likely be processed as that transaction category. The second ratio threshold can be set to 0.9. When the ratio of the statistical result to K is greater than 0.9, it indicates that almost all reference keywords belong to the same transaction category, and the pending transaction request can be determined as that transaction category. If the ratio of the statistical result to K is not 1, it indicates that a mapping relationship can be constructed between the keyword and the transaction category, and the mapping table can be expanded to improve the accuracy of subsequent target transaction category determination.

[0122] This embodiment determines the target transaction category by the proportion of keywords in the transaction category, avoiding mapping complex text to unsuitable transaction categories, avoiding invalid processing, ensuring the accuracy of the assigned target transaction category, and also helping to provide a reference for the expansion of the mapping table.

[0123] Corresponding to the AI-based transaction processing method in the above embodiments, Figure 4 A structural block diagram of an AI-based transaction processing device according to Embodiment 3 of the present invention is shown. This transaction processing device is applied to a local client. The computer device corresponding to the local client communicates with a distributed server. After receiving a transaction request to be processed, the local client accesses the distributed server to obtain loading information for each distributed server. The computer device corresponding to the local client has a storage function, storing a mapping table and a set of transaction category keywords. The mapping table can be used to map keywords to transaction categories, and the set of transaction category keywords can be used to compare with the keywords to determine the target transaction category. For ease of explanation, only the parts relevant to the embodiments of the present invention are shown.

[0124] See Figure 4 The transaction processing apparatus includes:

[0125] Keyword analysis module 41 is used to perform keyword analysis on the acquired pending transaction requests to determine N keywords, where N is an integer greater than zero;

[0126] The category mapping module 42 is used to map N keywords through a preset mapping table to determine the transaction category of the corresponding keywords. The mapping table includes the mapping relationship between transaction categories and keywords.

[0127] Keyword comparison module 43 is used to compare all keywords with at least one preset set of transaction category keywords, and determine the target transaction category to which the transaction request to be processed belongs based on the comparison results;

[0128] The model detection module 44 is used to determine the target processing model corresponding to the target transaction category based on the target transaction category, and to detect whether there is a server in the distributed system that has loaded the target processing model.

[0129] The preloading module 45 is used to select any idle server in the distributed system as the target server if there is no server in the distributed system that has loaded the target processing model, and call the target server to preload the target processing model.

[0130] The transaction processing module 46 is used to send the transaction request to be processed to the target server that has completed preloading after the target processing model has been preloaded, and obtain the transaction processing result.

[0131] Optionally, the transaction category keyword set includes at least one storage keyword;

[0132] The keyword comparison module 43 mentioned above includes:

[0133] The distance calculation unit is used to calculate the Euclidean distance between any keyword and any stored keyword, and obtain the distance calculation result.

[0134] The distance comparison unit is used to detect whether the distance calculation result is less than the preset distance threshold. If the distance calculation result is less than the distance threshold, it is determined that the keyword is consistent with the comparison result of the stored keyword.

[0135] Optionally, the comparison results include those that are consistent with each other;

[0136] The keyword comparison module 43 mentioned above includes:

[0137] The keyword filtering unit is used to retain the preset keywords in the keyword set of any transaction category that match the comparison results of each keyword, and obtain K reference keywords, where K is an integer greater than zero;

[0138] The intersection calculation unit is used to calculate the intersection of the set of reference keywords and the set of transaction category keywords;

[0139] The ratio comparison unit is used to count the number of reference keywords within the intersection and calculate the ratio of the statistical result to K. If the ratio is greater than the preset ratio threshold, the transaction category of the corresponding transaction category keyword set is determined as the target transaction category.

[0140] Optionally, the above transaction processing apparatus further includes:

[0141] The server determination module is used to determine the server that has loaded the target processing model as the target server if the distributed system detects that there is a server that has loaded the target processing model.

[0142] The request processing module is used to send the transaction request to be processed to the target server and obtain the transaction processing result.

[0143] Optionally, the target processing model includes a target recognition model and a target language model;

[0144] The aforementioned preloading module 45 includes:

[0145] The identification preloading unit is used to initiate the preloading process of the target identification model based on the request timestamp sent to the target server by the transaction request to be processed;

[0146] The language preloading unit is used to determine the preloading timestamp of the target language model based on the historical average loading time and request timestamp of the target language model. When the current timestamp matches the preloading timestamp, the preloading process of the target language model is started.

[0147] Optionally, the above transaction processing apparatus further includes:

[0148] The queue acquisition module is used to acquire the historical transaction request queue of the distributed system.

[0149] The probability prediction module is used to obtain the predicted probability of the pending transaction request recurring based on the historical transaction request queue and a trained temporal convolutional network model.

[0150] The server deregistration module is used to detect whether the predicted probability meets the preset conditions. If the predicted probability meets the preset conditions, the target server is deregistered.

[0151] Optionally, the above transaction processing apparatus further includes:

[0152] The content retention module is used to retain the preloaded content of the target processing model in the target server if the predicted probability does not meet the preset conditions.

[0153] The information synchronization module is used to generate preloaded information based on the preloaded content and synchronize the preloaded information to the distributed system.

[0154] It should be noted that the information interaction and execution process between the above modules and units are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0155] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, wherein the processor executes the computer program to implement the steps in any of the above-described transaction processing method embodiments.

[0156] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 5 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.

[0157] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0158] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of a computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.

[0159] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the functions described above can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0160] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be accomplished by a computer program product. When the computer program product is run on a computer device, the computer device executes the steps in the above method embodiments.

[0161] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0162] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0163] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0164] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0165] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A transaction processing method for a distributed system, characterized by, The method comprises: performing keyword analysis on the obtained to-be-processed transaction request to determine N keywords, N being an integer greater than zero; mapping the N keywords through a preset mapping table respectively to determine a transaction category corresponding to the keywords, the mapping table comprising a mapping relationship between transaction categories and keywords; obtaining a plurality of transaction categories according to the mapping results of the keywords, each transaction category corresponding to a transaction category keyword set; comparing all the keywords with at least one preset transaction category keyword set to determine a target transaction category to which the to-be-processed transaction request belongs according to the comparison result; determining a target processing model corresponding to the target transaction category, and detecting whether there is a server in the distributed system that has loaded the target processing model; if there is no server in the distributed system that has loaded the target processing model, selecting an idle server from the distributed system as a target server, and calling the target server to preload the target processing model; after the target processing model is preloaded, sending the to-be-processed transaction request to the target server that has completed preloading to obtain a transaction processing result; the target processing model comprises a target recognition model and a target language model; the calling of the target server to preload the target processing model comprises: starting a preloading process of the target recognition model according to a request timestamp of the to-be-processed transaction request sent to the target server; determining a preloading timestamp of the target recognition model according to a historical average loading duration of the target language model obtained and the request timestamp, and starting the preloading process of the target recognition model when the current timestamp is consistent with the preloading timestamp.

2. The transaction processing method of claim 1, wherein, The transaction category keyword set comprises at least one storage keyword. The comparison of all the keywords with at least one preset transaction category keyword set comprises: for any keyword, calculating the distance between the keyword and any storage keyword to obtain a distance calculation result; detecting whether the distance calculation result is less than a preset distance threshold, if the distance calculation result is less than the distance threshold, determining that the comparison result of the keyword and the storage keyword is consistent, and the distance threshold is used to determine whether the keyword and the storage keyword are the same word.

3. The transaction processing method of claim 1, wherein, After the detection of whether there is a server in the distributed system that has loaded the target processing model, the method further comprises: if there is a server in the distributed system that has loaded the target processing model, determining the server that has loaded the target processing model as the target server; sending the to-be-processed transaction request to the target server to obtain a transaction processing result.

4. The transaction processing method according to any one of claims 1 to 3, characterized by, After the transaction processing result is obtained, the method further comprises: obtaining a historical transaction request queue of the distributed system; obtaining a prediction probability of the to-be-processed transaction request from the trained time convolution network model according to the historical transaction request queue; detecting whether the prediction probability meets a preset condition, if the prediction probability meets the preset condition, deregistering the target server.

5. The transaction processing method of claim 4, wherein, After the detection of whether the prediction probability meets the preset condition, the method further comprises: If the prediction probability does not meet the preset condition, keeping the preloading content of the target processing model in the target server; Generating preloading information according to the preloading content, and synchronizing the preloading information to the distributed system.

6. A transaction processing apparatus for a distributed system, characterized in that, The transaction processing device comprises: a keyword analysis module configured to perform keyword analysis on the obtained transaction request to be processed to determine N keywords, N being an integer greater than zero; a category mapping module configured to map the N keywords through a preset mapping table to determine a transaction category corresponding to the keywords, the mapping table comprising a mapping relationship between transaction categories and keywords; and obtain a plurality of transaction categories according to the mapping results of the keywords, each transaction category corresponding to a transaction category keyword set; a keyword comparison module configured to compare all the keywords with at least one preset transaction category keyword set, and determine a target transaction category to which the transaction request to be processed belongs according to the comparison result; a model detection module configured to determine a target processing model corresponding to the target transaction category according to the target transaction category, and detect whether there is a server in the distributed system that has loaded the target processing model; a preloading module configured to select an idle server as a target server from the distributed system if there is no server in the distributed system that has loaded the target processing model, and call the target server to pre-load the target processing model; a transaction processing module configured to send the transaction request to be processed to the target server after the target processing model is pre-loaded to obtain a transaction processing result. The target processing model comprises a target recognition model and a target language model. The calling of the target server to pre-load the target processing model comprises: starting a pre-loading process of the target recognition model according to a request timestamp of the transaction request to be processed sent to the target server; determining a pre-loading timestamp of the target recognition model according to a historical average loading duration of the target language model and the request timestamp, and starting the pre-loading process of the target recognition model when a current timestamp is consistent with the pre-loading timestamp.

7. A computer device, comprising: The computer device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the transaction processing method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program is executed by the processor to implement the transaction processing method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Query method and device of event processing scheme, equipment and computer storage medium

    CN110020002A

  • Information loading method and device, electronic equipment and storage medium

    CN113282539A