Transaction processing method and device, electronic equipment, storage medium and program
By dynamically instantiating the target forwarder class by a non-gray server and calling the public grayscale forwarder code, the problem of the difference in transaction forwarding function code in multi-grayscale trading scenarios without cookies is solved, and the unity of transaction forwarding and system scalability is realized.
Patent Information
- Application Number
- CN202411867853.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
AI Technical Summary
The lack of a unified implementation mechanism and solution ideas in the existing technology has led to a large difference in the transaction forwarding function code in the multi-grayscale trading scenarios from server to server, resulting in complex code functions and high redundancy, which increases development and maintenance costs.
The non-gray server obtains the pending target transaction request for the pending transaction, determines its transaction request type, and dynamically instantiates the target forwarder class, and calls the common grayscale forwarder code for grayscale forwarding to achieve the unity of transaction forwarding.
It realizes the unity of transaction forwarding in grayscale transaction forwarding scenarios, improves the simplicity of functional codes, reduces development and maintenance costs, and improves the scalability of the system.
Smart Images

Figure CN119806613A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of financial technology, and in particular, to a transaction processing method, device, electronic device, storage medium and program. Background Art
[0002] Grayscale release refers to the process of upgrading a software product from an old version to a new version, in which a portion of users or a certain proportion of traffic is selected to use the new version, while the rest of the users continue to use the old version. Grayscale release allows the new version to be tested in a real user environment to evaluate the new version's functions, performance, and stability, while keeping possible risks and problems to a smaller scope.
[0003] Currently, in overseas payment transaction scenarios, the main method used is to implement grayscale release based on Cookie (small text file) tagging. This method supports browser / server (Browser / Server, B / S) and client / server (C / S) request methods that carry Cookies to maintain correct grayscale routing.
[0004] However, for server-to-server (S2S) cookie-free multi-grayscale transaction scenarios, there is no unified implementation mechanism and overall solution in the existing technology, resulting in large differences in the transaction forwarding function codes in various grayscale forwarding scenarios. In addition, grayscale forwarding is only implemented through code logic, which makes the code functions of various grayscale forwarding scenarios complicated, highly redundant and difficult to reuse, greatly increasing development and maintenance costs. Summary of the invention
[0005] The embodiments of the present invention provide a transaction processing method, device, electronic device, storage medium and program, which can achieve the uniformity of transaction forwarding in the Grayscale transaction forwarding scenario, improve the simplicity of the functional code of the Grayscale transaction forwarding scenario, reduce the development cost and maintenance cost of the Grayscale transaction forwarding scenario, and improve the scalability of the Grayscale transaction forwarding system.
[0006] According to one aspect of the present invention, a transaction processing method is provided, which is applied to a non-grey server and includes:
[0007] Obtaining a pending target transaction request of a pending transaction; wherein the pending target transaction request includes a transaction request without Cookie;
[0008] Determining the transaction request type of the target transaction request to be processed;
[0009] Dynamically instantiate a target forwarder class according to the transaction request type of the target transaction request to be processed;
[0010] The target forwarder class calls the public grayscale forwarder code to perform grayscale forwarding on the pending target transaction request.
[0011] According to another aspect of the present invention, there is provided a transaction processing device, which is configured on a non-gray server and includes:
[0012] A transaction request acquisition module, used to acquire a pending target transaction request of a pending transaction; wherein the pending target transaction request includes a transaction request without Cookie;
[0013] A transaction request type determination module, used to determine the transaction request type of the target transaction request to be processed;
[0014] A forwarder class acquisition module, used for dynamically instantiating a target forwarder class according to the transaction request type of the target transaction request to be processed;
[0015] The grayscale forwarding module is used to call the public grayscale forwarder code through the target forwarder class to perform grayscale forwarding on the target transaction request to be processed.
[0016] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the transaction processing method described in any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the transaction processing method described in any embodiment of the present invention when executed.
[0021] According to another aspect of the present invention, there is further provided a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the transaction processing method described in any embodiment of the present invention is implemented.
[0022] The embodiment of the present invention obtains the pending target transaction request of the pending transaction through a non-gray server and determines the transaction request type of the pending target transaction request. Furthermore, the non-gray server dynamically instantiates the target forwarder class according to the transaction request type of the pending target transaction request, so that the public grayscale forwarder code can be called through the target forwarder class to perform grayscale forwarding on the pending target transaction request, which solves the problem of differences in transaction forwarding function codes in existing cookie-free multi-grayscale type transaction scenarios, can achieve the uniformity of transaction forwarding in grayscale transaction forwarding scenarios, improve the simplicity of function codes of grayscale transaction forwarding scenarios, reduce development costs and maintenance costs of grayscale transaction forwarding scenarios, and improve the scalability of grayscale transaction forwarding systems.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 is a flow chart of a transaction processing method provided by Embodiment 1 of the present invention;
[0026] Figure 2 is a flow chart of a transaction processing method provided by Embodiment 2 of the present invention;
[0027] Figure 3 It is a program logic static diagram of a transaction processing method provided in the second embodiment of the present invention;
[0028] Figure 4 This is a flow chart of a multi-party interactive transaction processing method provided in Embodiment 3 of the present invention;
[0029] Figure 5 is a schematic diagram of a transaction processing device provided by a fourth embodiment of the present invention;
[0030] Figure 6 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "target", "original", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] Embodiment 1
[0034] Figure 1 This is a flow chart of a transaction processing method provided by the first embodiment of the present invention. This embodiment is applicable to the case of grayscale forwarding for multi-grayscale transaction scenarios without cookies. The method can be executed by a transaction processing device, which can be implemented by software and / or hardware and can generally be integrated in an electronic device, which can be a non-gray server. Figure 1 As shown, the method includes the following operations:
[0035] S110. Obtain a pending target transaction request of a pending transaction; wherein the pending target transaction request includes a transaction request without Cookie.
[0036] Among them, the pending transaction may be a transaction that has been initiated but has not yet completed the entire processing process. The pending target transaction request may be used to request a non-gray server to process the pending transaction. A non-gray server may be a server that is not used to test new functions, new configurations, or new versions of software. Exemplarily, the pending target transaction request may include but is not limited to a cookieless transaction request. The so-called cookieless transaction request may be understood as a transaction request that does not include cookie information.
[0037] In an embodiment of the present invention, in order to realize grayscale forwarding in a cookie-free multi-grayscale transaction scenario, the non-gray server may first obtain the pending target transaction request of the pending transaction as basic data for the subsequent grayscale forwarding process.
[0038] S120: Determine the transaction request type of the target transaction request to be processed.
[0039] The transaction request type may be the type of transaction request initiated by the client or the relevant system during the transaction process. Exemplarily, the transaction request type may include, but is not limited to, cross-border remittance, third-party payment platform payment, and offline payment, etc. As long as it is a transaction request that can be initiated by the client or the relevant system during the transaction process, the embodiment of the present invention does not limit the specific types of transaction request types and the request initiator.
[0040] Accordingly, after the non-gray server obtains the pending target transaction request of the pending transaction, the transaction request type of the pending target transaction request can be judged, and the judgment result of the transaction request type of the pending target transaction request can be used as the basis for dynamically instantiating the target forwarder class.
[0041] S130. Dynamically instantiate a target forwarder class according to the transaction request type of the target transaction request to be processed.
[0042] The target forwarder class may be a set of forwarders with similar grayscale forwarding functions. Exemplarily, the target forwarder class may include, but is not limited to, an online payment forwarder class, a cross-border remittance forwarder class, and an offline payment forwarder class, etc. As long as it is a target forwarder class corresponding to the transaction request type, the embodiment of the present invention does not limit the specific types included in the target forwarder class.
[0043] Accordingly, after the non-grey server determines the transaction request type of the target transaction request to be processed, it can dynamically instantiate a target forwarder class that matches the transaction request type of the target transaction request according to the transaction request type of the target transaction request to be processed. It can be understood that one transaction request type can correspond to one target forwarder class.
[0044] S140. Calling a public grayscale forwarder code through the target forwarder class to perform grayscale forwarding on the target transaction request to be processed.
[0045] Among them, the public Grayscale forwarder code can be the public code responsible for forwarding the pending target transaction request to the next node during the Grayscale forwarding process.
[0046] Correspondingly, after the non-gray server dynamically instantiates the target forwarder class according to the transaction request type of the target transaction request to be processed, the target forwarder class can generate a corresponding forwarder instance object. Furthermore, the forwarder instance object can perform grayscale judgment on the target transaction request to be processed, and thus can call the public grayscale forwarder code to perform grayscale forwarding on the target transaction request to be processed according to the grayscale judgment result.
[0047] The embodiment of the present invention obtains the pending target transaction request of the pending transaction through a non-gray server and determines the transaction request type of the pending target transaction request. Furthermore, the non-gray server dynamically instantiates the target forwarder class according to the transaction request type of the pending target transaction request, so that the public grayscale forwarder code can be called through the target forwarder class to perform grayscale forwarding on the pending target transaction request, which solves the problem of differences in transaction forwarding function codes in existing cookie-free multi-grayscale type transaction scenarios, can achieve the uniformity of transaction forwarding in grayscale transaction forwarding scenarios, improve the simplicity of function codes of grayscale transaction forwarding scenarios, reduce development costs and maintenance costs of grayscale transaction forwarding scenarios, and improve the scalability of grayscale transaction forwarding systems.
[0048] Embodiment 2
[0049] Figure 2 is a flowchart of a transaction processing method provided by the second embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, a specific optional implementation method of obtaining a pending target transaction request for a pending transaction and calling a public grayscale forwarder code through a target forwarder class to forward the pending target transaction request in grayscale is provided. Figure 2 As shown, the method of this embodiment may include:
[0050] S210: Receive a first external network transaction request distributed by the external network server load balancer as the target transaction request to be processed.
[0051] Among them, the external network server load balancer can be a device or software located at the front end of the external network server, which can evenly distribute the external network transaction request to multiple back-end servers to prevent a single server from experiencing performance degradation, response delay or even crash due to overload. The external network server load balancer can be used to: receive the second external network transaction request distributed by the external network F5 load balancer; use the first load balancing strategy to load balance the second external network transaction request to obtain the first external network transaction request; distribute the first external network transaction request to the non-grey server.
[0052] Among them, the external network F5 load balancer can be an application delivery controller in the external network, which can improve the performance, availability and security of the application system by reasonably distributing network traffic to multiple servers. The external network F5 load balancer can be used to: receive the original external network transaction request sent by the external network device for the target transaction to be processed; use the second load balancing strategy to load balance the original external network transaction request to obtain a second external network transaction request; distribute the second external network transaction request to the external network F5 load balancer.
[0053] Among them, the original external network transaction request may be a transaction request sent by the external network device for the pending transaction. The second load balancing strategy may be a rule or algorithm for determining how to allocate the original transaction request to the external network F5 load balancer. Exemplarily, the second load balancing strategy may include but is not limited to basic polling, weighted polling, and the minimum number of connections strategy, etc., and the embodiment of the present invention does not limit the specific strategy included in the second load balancing strategy. The second external network transaction request may be an external network transaction request obtained by load balancing the original external network transaction request using the second load balancing strategy. The first load balancing strategy may be a rule or algorithm for determining how to allocate the second external network transaction request to a non-gray server. Exemplarily, the first load balancing strategy may include but is not limited to basic polling, weighted polling, and the minimum number of connections strategy, etc., and the embodiment of the present invention does not limit the specific strategy included in the first load balancing strategy. The first external network transaction request may be an external network transaction request obtained by load balancing the second external network transaction request using the first load balancing strategy.
[0054] In an embodiment of the present invention, the external network device will send the original external network transaction request to the external network F5 load balancer for the transaction to be processed, and then the external network F5 load balancer can use the second load balancing strategy to load balance the original external network transaction request to obtain the second external network transaction request, and distribute the second external network transaction request to the external network server load balancer. Further, the external network server load balancer receives the second external network transaction request distributed by the external network F5 load balancer, and can use the first load balancing strategy to load balance the second external network transaction request to obtain the first external network transaction request, and distribute the first external network transaction request to the non-gray server. Performing load balancing twice on the original external network transaction request through the load balancing strategy can reduce the system response time, increase system availability, and achieve the scalability of the gray transaction forwarding system.
[0055] In an optional embodiment of the present invention, the receiving of the first external network transaction request distributed by the external network server load balancer as the target transaction request to be processed may include: obtaining the URL (Uniform Resource Locator) address of the first external network transaction request through an interceptor; and when it is determined that the URL address of the first external network transaction request hits the grayscale forwarder transaction scenario, taking the first external network transaction request as the target transaction request to be processed.
[0056] Among them, the interceptor can be a mechanism for intercepting and processing requests or messages in the program execution process. The Grayscale forwarder transaction scenario can be a special transaction scenario that uses the Grayscale forwarder to control traffic during software system updates or new function testing. Exemplarily, the Grayscale forwarder transaction scenario can include but is not limited to online payment and scanning scenarios, etc. The embodiment of the present invention does not limit the specific transaction scenarios included in the Grayscale forwarder transaction scenario.
[0057] In an optional embodiment of the present invention, the receiving of the first external network transaction request distributed by the external network server load balancer as the target transaction request to be processed may also include: when it is determined that the URL address of the first external network transaction request does not hit the grayscale forwarder transaction scenario, obtaining a default transaction processing strategy; and directly performing transaction processing on the first external network transaction request according to the default transaction processing strategy.
[0058] Among them, the default transaction processing strategy can be a set of rules and processes for processing transactions automatically adopted by the non-gray server when the URL address of the first external network transaction request does not hit the grayscale forwarder transaction scenario.
[0059] Specifically, the first external network transaction request distributed by the external network server load balancer is received as the target transaction request to be processed. First, the URL address of the first external network transaction request can be obtained through the interceptor. Further, it can be determined whether the URL address of the first external network transaction request hits the Grayscale forwarder transaction scenario. If the URL address of the first external network transaction request hits the Grayscale forwarder transaction scenario, the first external network transaction request can be used as the target transaction request to be processed; if the URL address of the first external network transaction request does not hit the Grayscale forwarder transaction scenario, the default transaction processing strategy can be obtained, and then the non-gray server can directly process the first external network transaction request according to the default transaction processing strategy. In the above scheme, the URL address of the first external network transaction request is matched with the Grayscale forwarder transaction scenario, and different operations are implemented according to the matching results. New functions can be introduced in stages and the user experience can be optimized according to the Grayscale forwarder transaction scenarios represented by different URL addresses.
[0060] S220: Determine the transaction request type of the target transaction request to be processed.
[0061] S230. Dynamically instantiate a target forwarder class according to the transaction request type of the target transaction request to be processed.
[0062] S240. Instantiate a target forwarder instance object through the target forwarder class.
[0063] The target forwarder instance object may be a specific object generated after the target forwarder class is instantiated.
[0064] Specifically, after the target forwarder class is dynamically instantiated according to the transaction request type of the target transaction request to be processed, the target forwarder instance object can be instantiated through the target forwarder class, and the target transaction request can be forwarded through the forwarder class instance object.
[0065] S250. Determine the grayscale type of the target transaction request to be processed according to the transaction request type of the target transaction request to be processed through the target forwarder instance object.
[0066] The grayscale type of the target transaction request to be processed may be the grayscale type to which the target transaction request to be processed belongs in a grayscale release environment.
[0067] Specifically, after the target forwarder instance object is instantiated through the target forwarder class, the grayscale type of the target transaction request to be processed can be determined according to the transaction request type of the target transaction request to be processed through the target forwarder instance object. Exemplarily, the grayscale type of the target transaction request to be processed may include but is not limited to non-gray, grayscale, and Gaussian non-gray.
[0068] S260: Setting a grayscale mark field in a request header of the target transaction request to be processed according to the grayscale type of the target transaction request to be processed through the target forwarder instance object to obtain a target transaction request.
[0069] Among them, the grayscale mark field can be a field representing the grayscale type of the target transaction request to be processed in the request header of the target transaction request to be processed. Exemplarily, the grayscale mark field can be located in the distribution type DispatchType field in the request header of the target transaction request to be processed. It can be understood that different data dictionaries set in the grayscale mark field can represent different grayscale types. Exemplarily, 0 can represent non-gray, 1 can represent grayscale, and 2 can represent surface Gaussian grayscale. The target transaction request can be a target transaction request to be processed with a grayscale type judgment field.
[0070] Specifically, after determining the grayscale type of the target transaction request to be processed, the target forwarder instance object can set a grayscale mark field in the request header of the target transaction request to be processed according to the grayscale type of the target transaction request to be processed, thereby obtaining the target transaction request.
[0071] S270. Call the public grayscale forwarder code through the target forwarder instance object to perform grayscale forwarding on the target transaction request.
[0072] Specifically, after setting the grayscale mark field in the request header of the target transaction request to be processed to obtain the target transaction request, the non-gray server can call the public grayscale forwarder code through the target forwarder instance object to perform grayscale forwarding on the target transaction request. It should be noted that the public code called when performing grayscale forwarding on different transaction requests can be the same. Therefore, calling the public grayscale forwarder code to perform grayscale forwarding on the target transaction can simplify the code of each grayscale forwarding scenario and reduce the development and maintenance costs of the system.
[0073] In an embodiment of the present invention, the grayscale forwarding of the pending target transaction request by calling the public grayscale forwarder code through the target forwarder class may include: sending the target transaction request to the intranet F5 server by calling the public grayscale forwarder code through the target forwarder instance object. Wherein, the intranet F5 server can be used to: receive the target transaction request sent by the non-gray server; use the third load balancing strategy to perform load balancing processing on the target transaction request to obtain the second target transaction request; distribute the second target transaction request to the intranet server load balancer; the intranet server load balancer can be used to: receive the second target transaction request distributed by the intranet F5 load balancer; use the fourth load balancing strategy to perform load balancing processing on the second target transaction request to obtain the third target transaction request; distribute the third target transaction request to the corresponding grayscale server according to the grayscale tag field; the grayscale server can be used to: perform transaction processing on the pending transaction according to the third target transaction request.
[0074] The third load balancing strategy may be a rule or algorithm for determining how to allocate the target transaction request to the load balancer of the intranet server. The fourth load balancing strategy may be a rule or algorithm for determining how to allocate the second target transaction request to the gray server. The third target transaction request may be a target transaction request obtained by load balancing the second target transaction request using the fourth load balancing strategy.
[0075] Figure 3 is a program logic static diagram of a transaction processing method provided in the second embodiment of the present invention. In a specific example, Figure 3As shown, the factory class interface can be used to create an instantiation object of the factory class. The factory class is a forwarder factory class, which is enumerated as different distribution strategies, and can determine how to assign transaction requests to different processing units. The specific transaction scenario factory class is a factory class for different grayscale forwarder transaction scenarios, and can distribute tasks according to the specific business scenario distribution strategy. For a specific transaction scenario, the factory class interface can instantiate the corresponding forwarder instance object. The forwarder instance object can perform grayscale type judgment according to the corresponding transaction scenario distribution strategy, and call the public grayscale forwarder code to perform grayscale forwarding on the transaction request. It can be understood that different transaction scenario factory classes correspond to different transaction scenario distribution strategies, and different transaction scenario distribution strategies call the same public grayscale forwarder code.
[0076] In an embodiment of the present invention, a non-gray server can call a public grayscale forwarder code through a target forwarder instance object to send a target transaction request to an intranet F5 server. After receiving the target transaction request sent by the non-gray server, the intranet F5 server can use a third load balancing strategy to perform load balancing processing on the target transaction request to obtain a second target transaction request. Further, the intranet F5 server can distribute the second target transaction request to the intranet server load balancer. After receiving the second target transaction request distributed by the intranet F5 load balancer, the intranet server load balancer can use a fourth load balancing strategy to perform load balancing processing on the second target transaction request to obtain a third target transaction request. Further, the intranet server load balancer can distribute the third target transaction request to the corresponding grayscale server according to the grayscale tag field. After receiving the third target transaction request sent by the intranet server load balancer, the grayscale server can perform transaction processing on the pending transaction according to the third target transaction request. The above solution can fully utilize server resources and improve the utilization rate of server resources by load balancing the target transaction requests through the intranet F5 server; the intranet server load balancer distributes the third target transaction request to the corresponding grayscale server according to the grayscale tag field to realize the diversion and forwarding function and collect user feedback in a targeted manner.
[0077] In the embodiment of the present invention, a non-gray server receives a first external network transaction request distributed by an external network server load balancer as a target transaction request to be processed and determines the transaction request type of the target transaction request to be processed. Further, the non-gray server dynamically instantiates a target forwarder class according to the transaction request type of the target transaction request to be processed, and then instantiates a target forwarder instance object through the target forwarder class, and determines the grayscale type of the target transaction request to be processed according to the transaction request type of the target transaction request to be processed through the target forwarder instance object. Further, the non-gray server can obtain the target transaction request by setting a grayscale mark field in the request header of the target transaction request to be processed according to the grayscale type of the target transaction request to be processed through the target forwarder instance object, so that the target transaction request can be grayscale forwarded by calling a public grayscale forwarder code through the target forwarder instance object, which solves the problem of differences in transaction forwarding function codes in existing cookie-free multi-grayscale type transaction scenarios, can achieve the uniformity of transaction forwarding in grayscale transaction forwarding scenarios, improve the simplicity of function codes of grayscale transaction forwarding scenarios, reduce the development cost and maintenance cost of grayscale transaction forwarding scenarios, and improve the scalability of grayscale transaction forwarding systems.
[0078] Embodiment 3
[0079] Figure 4 This is a flow chart of a multi-party interactive transaction processing method provided in the third embodiment of the present invention. This embodiment is applicable to the case of grayscale forwarding for multi-grayscale transaction scenarios without Cookies. Figure 4 As shown, the method of this embodiment may include:
[0080] S310. The external network device sends the original external network transaction request of the transaction to be processed to the external network F5 load balancer.
[0081] S320, the external network F5 load balancer receives the original external network transaction request sent by the external network device for the transaction to be processed; uses the second load balancing strategy to load balance the original external network transaction request to obtain the second external network transaction request; distributes the second external network transaction request to the external network server load balancer.
[0082] S330, the external network server load balancer receives the second external network transaction request distributed by the external network F5 load balancer; uses the first load balancing strategy to perform load balancing on the second external network transaction request to obtain the first external network transaction request; distributes the first external network transaction request to the non-gray server.
[0083] S340, the non-gray server obtains a pending target transaction request of a pending transaction; determines the transaction request type of the pending target transaction request; dynamically instantiates a target forwarder class according to the transaction request type of the pending target transaction request; and calls a public grayscale forwarder code through the target forwarder class to perform grayscale forwarding on the pending target transaction request.
[0084] S350, the intranet F5 load balancer receives the target transaction request sent by the non-gray server; uses the third load balancing strategy to perform load balancing on the target transaction request to obtain the second target transaction request; and distributes the second target transaction request to the intranet server load balancer.
[0085] S360, the intranet server load balancer receives the second target transaction request distributed by the intranet F5 load balancer; uses the fourth load balancing strategy to load balance the second target transaction request to obtain a third target transaction request; and distributes the third target transaction request to the corresponding grayscale server according to the grayscale mark field.
[0086] S370. The Grayscale server performs transaction processing on the pending transaction according to the third target transaction request.
[0087] The technical solution of this embodiment first sends the original external network transaction request of the pending transaction to the external network F5 load balancer through the external network device. Further, the external network F5 load balancer can adopt the second load balancing strategy to load balance the original external network transaction request to obtain the second external network transaction request, and distribute the second external network transaction request to the external network server load balancer. Further, the external network server load balancer can adopt the first load balancing strategy to load balance the second external network transaction request to obtain the first external network transaction request, and distribute the first external network transaction request to the non-gray server. Further, the non-gray server can use the first external network transaction request as the pending target transaction request, and determine the transaction request type of the pending target transaction request, and then dynamically instantiate the target forwarder class according to the transaction request type of the pending target transaction request, so that the target forwarder class can call the public grayscale forwarder code to grayscale forward the pending target transaction request. The intranet F5 server can adopt the third load balancing strategy to load balance the target transaction request to obtain the second target transaction request and distribute the second target transaction request to the intranet server load balancer. Furthermore, the intranet server load balancer can adopt the fourth load balancing strategy to load balance the second target transaction request to obtain the third target transaction request, and distribute the third target transaction request to the corresponding grayscale server according to the grayscale tag field. Finally, the grayscale server can perform transaction processing on the pending transaction according to the third target transaction request, which solves the problem of differences in transaction forwarding function codes in existing cookie-free multi-grayscale type transaction scenarios, can achieve the uniformity of transaction forwarding in grayscale transaction forwarding scenarios, improve the simplicity of the function code of grayscale transaction forwarding scenarios, reduce the development cost and maintenance cost of grayscale transaction forwarding scenarios, and improve the scalability of grayscale transaction forwarding systems.
[0088] In the technical solution of the present disclosure, the information collected is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0089] It should be noted that, in the embodiment of the present invention, a corresponding operation entry may be provided for the user to choose to agree or reject the automated decision result; if the user chooses to reject, the expert decision process is entered.
[0090] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.
[0091] Embodiment 4
[0092] Figure 5 is a schematic diagram of a transaction processing device provided by Embodiment 4 of the present invention, such as Figure 5 As shown, the device is configured on a non-grey server, and includes: a transaction request acquisition module 410, a transaction request type determination module 420, a forwarder type acquisition module 430, and a grey forwarding module 440, wherein:
[0093] The transaction request acquisition module 410 is used to acquire a pending target transaction request of a pending transaction; wherein the pending target transaction request includes a transaction request without Cookie.
[0094] The transaction request type determination module 420 is used to determine the transaction request type of the target transaction request to be processed.
[0095] The forwarder class acquisition module 430 is used to dynamically instantiate a target forwarder class according to the transaction request type of the target transaction request to be processed.
[0096] The grayscale forwarding module 440 is used to call the public grayscale forwarder code through the target forwarder class to perform grayscale forwarding on the target transaction request to be processed.
[0097] The embodiment of the present invention obtains the pending target transaction request of the pending transaction through a non-gray server and determines the transaction request type of the pending target transaction request. Furthermore, the non-gray server dynamically instantiates the target forwarder class according to the transaction request type of the pending target transaction request, so that the public grayscale forwarder code can be called through the target forwarder class to perform grayscale forwarding on the pending target transaction request, which solves the problem of differences in transaction forwarding function codes in existing cookie-free multi-grayscale type transaction scenarios, can achieve the uniformity of transaction forwarding in grayscale transaction forwarding scenarios, improve the simplicity of function codes of grayscale transaction forwarding scenarios, reduce development costs and maintenance costs of grayscale transaction forwarding scenarios, and improve the scalability of grayscale transaction forwarding systems.
[0098] Optionally, the transaction request acquisition module 410 is specifically used to receive a first external network transaction request distributed by an external network server load balancer as the target transaction request to be processed; wherein the external network server load balancer is used to: receive a second external network transaction request distributed by an external network F5 load balancer; use a first load balancing strategy to perform load balancing processing on the second external network transaction request to obtain the first external network transaction request; distribute the first external network transaction request to the non-gray server; the external network F5 load balancer is used to: receive an original external network transaction request sent by an external network device for the transaction to be processed; use a second load balancing strategy to perform load balancing processing on the original external network transaction request to obtain the second external network transaction request; distribute the second external network transaction request to the external network server load balancer.
[0099] Optionally, the transaction request acquisition module 410 is also used to obtain the URL address of the first external network transaction request through an interceptor; when it is determined that the URL address of the first external network transaction request hits the Grayscale forwarder transaction scenario, the first external network transaction request is used as the target transaction request to be processed.
[0100] Optionally, the transaction request acquisition module 410 is also used to obtain a default transaction processing strategy when it is determined that the URL address of the first external network transaction request does not hit the Grayscale forwarder transaction scenario; and directly perform transaction processing on the first external network transaction request according to the default transaction processing policy.
[0101] Optionally, the grayscale forwarding module 440 is specifically used to instantiate a target forwarder instance object through the target forwarder class; determine the grayscale type of the target transaction request to be processed according to the transaction request type of the target transaction request to be processed through the target forwarder instance object; set the grayscale mark field in the request header of the target transaction request to be processed according to the grayscale type of the target transaction request to be processed through the target forwarder instance object to obtain the target transaction request; and call the public grayscale forwarder code through the target forwarder instance object to perform grayscale forwarding on the target transaction request.
[0102] Optionally, the grayscale forwarding module 440 is also used to call the public grayscale forwarder code through the target forwarder example object to send the target transaction request to the intranet F5 server; the intranet F5 server is used to: receive the target transaction request sent by the non-gray server; use the third load balancing strategy to perform load balancing processing on the target transaction request to obtain the second target transaction request; distribute the second target transaction request to the intranet server load balancer; the intranet server load balancer is used to: receive the second target transaction request distributed by the intranet F5 load balancer; use the fourth load balancing strategy to perform load balancing processing on the second target transaction request to obtain a third target transaction request; distribute the third target transaction request to the corresponding grayscale server according to the grayscale tag field; the grayscale server is used to: perform transaction processing on the pending transaction according to the third target transaction request.
[0103] The transaction processing device can execute the transaction processing method performed by the non-gray server provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the transaction processing method performed by the non-gray server provided in any embodiment of the present invention.
[0104] Since the transaction processing device introduced above is a device that can execute the transaction processing method executed by the non-gray server in the embodiment of the present invention, based on the transaction processing method executed by the non-gray server introduced in the embodiment of the present invention, the technical personnel of the field can understand the specific implementation of the transaction processing device of this embodiment and its various variations, so how the transaction processing device implements the transaction processing method executed by the non-gray server in the embodiment of the present invention is not described in detail here. As long as the technical personnel of the field implement the device used by the transaction processing method in the embodiment of the present invention, it belongs to the scope of protection of this application.
[0105] Embodiment 5
[0106] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0107] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0108] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0109] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a transaction processing method.
[0110] In some embodiments, the transaction processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the transaction processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the transaction processing method in any other appropriate manner (e.g., by means of firmware).
[0111] Optionally, a transaction processing method, applied to a non-gray server, may include: obtaining a pending target transaction request of a pending transaction; wherein the pending target transaction request includes a transaction request without Cookie; determining a transaction request type of the pending target transaction request; dynamically instantiating a target forwarder class according to the transaction request type of the pending target transaction request; and calling a public grayscale forwarder code through the target forwarder class to perform grayscale forwarding on the pending target transaction request.
[0112] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0113] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0114] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0115] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0116] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0117] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0118] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0119] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A transaction processing method, characterized in that: Applicable to non-gray servers, including: Obtaining a pending target transaction request of a pending transaction; wherein the pending target transaction request includes a transaction request without a small text file cookie; Determining the transaction request type of the target transaction request to be processed; Dynamically instantiate a target forwarder class according to the transaction request type of the target transaction request to be processed; The target forwarder class calls the public grayscale forwarder code to perform grayscale forwarding on the pending target transaction request.
2. The method according to claim 1, characterized in that The step of obtaining the pending target transaction request of the pending transaction includes: Receiving a first external network transaction request distributed by the external network server load balancer as the target transaction request to be processed; The external network server load balancer is used to: receive the second external network transaction request distributed by the external network F5 load balancer; perform load balancing processing on the second external network transaction request using the first load balancing strategy to obtain the first external network transaction request; and distribute the first external network transaction request to the non-grey server; The external network F5 load balancer is used to: receive the original external network transaction request sent by the external network device for the transaction to be processed; use the second load balancing strategy to load balance the original external network transaction request to obtain the second external network transaction request; and distribute the second external network transaction request to the external network server load balancer.
3. The method according to claim 2, characterized in that The receiving, as the target transaction request to be processed, the first external network transaction request distributed by the external network server load balancer includes: Obtaining the uniform resource locator URL address of the first external network transaction request through an interceptor; When it is determined that the URL address of the first external network transaction request hits the Grayscale forwarder transaction scenario, the first external network transaction request is used as the target transaction request to be processed.
4. The method according to claim 3, characterized in that: Also includes: When it is determined that the URL address of the first external network transaction request does not match the Grayscale forwarder transaction scenario, obtaining a default transaction processing strategy; Directly perform transaction processing on the first external network transaction request according to the default transaction processing policy.
5. The method according to claim 1, characterized in that The calling of the public grayscale forwarder code by the target forwarder class to perform grayscale forwarding on the pending target transaction request includes: Instantiate a target forwarder instance object through the target forwarder class; Determining the grayscale type of the target transaction request to be processed according to the transaction request type of the target transaction request to be processed by the target forwarder instance object; Setting a grayscale mark field in a request header of the target transaction request to be processed according to the grayscale type of the target transaction request to be processed by the target forwarder instance object to obtain a target transaction request; The target transaction request is forwarded in grayscale by calling the public grayscale forwarder code through the target forwarder example object.
6. The method according to claim 5, characterized in that The calling of the public grayscale forwarder code by the target forwarder class to perform grayscale forwarding on the pending target transaction request includes: Send the target transaction request to the intranet F5 server by calling the public grayscale forwarder code through the target forwarder example object; The intranet F5 server is used to: receive the target transaction request sent by the non-grey server; perform load balancing processing on the target transaction request using a third load balancing strategy to obtain the second target transaction request; and distribute the second target transaction request to the intranet server load balancer; The intranet server load balancer is used to: receive the second target transaction request distributed by the intranet F5 load balancer; perform load balancing processing on the second target transaction request using a fourth load balancing strategy to obtain a third target transaction request; and distribute the third target transaction request to a corresponding grayscale server according to the grayscale tag field; The grayscale server is used to: perform transaction processing on the pending transaction according to the third target transaction request.
7. A transaction processing device, characterized in that: Configured on a non-gray server, including: A transaction request acquisition module, used to acquire a pending target transaction request of a pending transaction; wherein the pending target transaction request includes a transaction request without Cookie; A transaction request type determination module, used to determine the transaction request type of the target transaction request to be processed; A forwarder class acquisition module, used for dynamically instantiating a target forwarder class according to the transaction request type of the target transaction request to be processed; The grayscale forwarding module is used to call the public grayscale forwarder code through the target forwarder class to perform grayscale forwarding on the target transaction request to be processed.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the transaction processing method described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the transaction processing method described in any one of claims 1-6 when executed.
10. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the transaction processing method according to any one of claims 1 to 6 is implemented.