Service flow switching method, device, computer equipment and storage medium
By receiving business requests, querying configuration class instances and determining traffic switching strategies, the performance issues of the old system in the face of business growth are resolved, efficient business traffic switching and real-time updating of traffic switching strategies between systems are achieved, and the stability and adaptability of the system are improved.
Patent Information
- Application Number
- CN202310266749.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-03-20
AI Technical Summary
In the existing technology, when facing the growth of business volume and user groups, the old system shows problems such as long online service return time, slow batch task execution speed, and surge in database pressure. An effective business flow switching method is needed to switch the background data and front-end access of the old system to the new system.
By receiving business requests, querying configuration class instances, reading traffic switching policies, determining the target system based on customer information and traffic switching policies, and forwarding the request to the target system, it supports configuration modifications and real-time updates of traffic switching policies without system restart, thus achieving business traffic switching between systems.
It achieves efficient business flow switching between systems, improves the accuracy and adaptability of flow switching, supports real-time updating of flow switching strategies, and reduces system downtime and complexity.
Smart Images

Figure CN116233254B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a service flow switching method, apparatus, computer equipment, storage medium, and computer program product. Background Art
[0002] How to quickly launch business functions is a key consideration during the initial development of many computer systems, especially those with advanced features. As business volume and user base grow, these legacy systems often become overwhelmed, exhibiting problems such as lengthy online service response times, slow batch task execution, and increased database pressure. This necessitates a new system reconstruction, perhaps through modularization. While there are a thousand different business systems, there are a thousand different customized solutions. However, no matter which solution is chosen, the process of business migration ultimately entails migrating backend data and frontend access from the old system to the new one.
[0003] Therefore, a business flow switching method is urgently needed to achieve business flow switching between systems. Summary of the Invention
[0004] Based on this, it is necessary to provide a service flow switching method, apparatus, computer equipment, computer-readable storage medium and computer program product that can implement service flow switching between systems in order to address the above technical problems.
[0005] In a first aspect, the present application provides a service flow switching method. The method comprises:
[0006] Receiving a business request for a target business service; the business request includes customer information requesting the target business service; the target business service is a service supported by the first system and the second system;
[0007] In the preset correspondence between business services and configuration class instances, query the configuration class instance corresponding to the target business service;
[0008] Read the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service;
[0009] Based on the customer information and the target traffic switching strategy, a target system corresponding to the business request is determined, and the business request is forwarded to the target system; the target system is one of the first system and the second system.
[0010] In one embodiment, the method further comprises:
[0011] Receive configuration modification information; the configuration modification information includes a target business service and a modified flow switching strategy corresponding to the target business service;
[0012] In the preset correspondence between business services and configuration class instances, query the target configuration class instance corresponding to the target business service;
[0013] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated.
[0014] In one embodiment, updating the variable attributes of the target configuration class instance according to the modified traffic switching strategy corresponding to the target business service includes:
[0015] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
[0016] In one embodiment, before receiving the configuration modification information, the method further includes:
[0017] Determining the service type of the target business service according to the business volume and execution time of the target business service;
[0018] In the preset correspondence between service types and traffic switching strategies, the traffic switching strategy corresponding to the target business service is queried according to the service type of the target business service; the traffic switching strategy is a traffic switching rule sequence consisting of at least one traffic switching rule.
[0019] In one embodiment, the second system is a unitized system, and the second system includes a public parameter service node; when the target system is the second system, the method further includes:
[0020] Determining whether the target business service meets preset public parameter service conditions based on the business type, execution frequency, and execution time of the target business service;
[0021] If the target business service meets the preset public parameter service conditions, the business request is forwarded to the public parameter service node.
[0022] In one embodiment, the method further comprises:
[0023] If the target business service does not meet the preset public parameter service conditions, the target unit corresponding to the business request is determined according to the customer information and a preset unit determination rule, and the business request is forwarded to the target unit.
[0024] In a second aspect, the present application further provides a service flow switching device. The device includes:
[0025] A first receiving module is configured to receive a service request for a target service; the service request includes information about a customer requesting the target service; the target service is a service supported by the first system and the second system;
[0026] A first query module is used to query the configuration class instance corresponding to the target business service in the preset correspondence relationship between business services and configuration class instances;
[0027] A reading module, configured to read the variable attributes of the configuration class instance and obtain the target flow switching strategy corresponding to the target business service;
[0028] The first determination module is configured to determine a target system corresponding to the business request based on the customer information and the target traffic switching strategy, and forward the business request to the target system; the target system is one of the first system and the second system.
[0029] In one embodiment, the apparatus further comprises:
[0030] A second receiving module is configured to receive configuration modification information; the configuration modification information includes a target business service and a modified traffic switching policy corresponding to the target business service;
[0031] A second query module is used to query the target configuration class instance corresponding to the target business service in the preset correspondence relationship between business services and configuration class instances;
[0032] An updating module is used to update the variable attributes of the target configuration class instance according to the modified flow switching strategy corresponding to the target business service.
[0033] In one embodiment, the update module is specifically configured to:
[0034] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
[0035] In one embodiment, the apparatus further comprises:
[0036] A second determining module is configured to determine a service type of the target business service according to the business volume and execution time of the target business service;
[0037] The third query module is used to query the traffic switching policy corresponding to the target business service according to the service type of the target business service in the preset correspondence between the service type and the traffic switching policy; the traffic switching policy is a traffic switching rule sequence composed of at least one traffic switching rule.
[0038] In one embodiment, the second system is a unitized system, and the second system includes a common parameter service node; when the target system is the second system, the apparatus further includes:
[0039] A judgment module, configured to judge whether the target business service meets a preset public parameter service condition according to the business type, execution frequency and execution time of the target business service;
[0040] The forwarding module is configured to forward the service request to the public parameter service node if the target service meets a preset public parameter service condition.
[0041] In one embodiment, the apparatus further comprises:
[0042] The third determination module is used to determine the target unit corresponding to the business request according to the customer information and a preset unit determination rule if the target business service does not meet the preset public parameter service condition, and forward the business request to the target unit.
[0043] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0044] Receiving a business request for a target business service; the business request includes customer information requesting the target business service; the target business service is a service supported by the first system and the second system;
[0045] In the preset correspondence between business services and configuration class instances, query the configuration class instance corresponding to the target business service;
[0046] Read the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service;
[0047] Based on the customer information and the target traffic switching strategy, a target system corresponding to the business request is determined, and the business request is forwarded to the target system; the target system is one of the first system and the second system.
[0048] In one embodiment, the method further comprises:
[0049] Receive configuration modification information; the configuration modification information includes a target business service and a modified flow switching strategy corresponding to the target business service;
[0050] In the preset correspondence between business services and configuration class instances, query the target configuration class instance corresponding to the target business service;
[0051] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated.
[0052] In one embodiment, updating the variable attributes of the target configuration class instance according to the modified traffic switching strategy corresponding to the target business service includes:
[0053] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
[0054] In one embodiment, before receiving the configuration modification information, the method further includes:
[0055] Determining the service type of the target business service according to the business volume and execution time of the target business service;
[0056] In the preset correspondence between service types and traffic switching strategies, the traffic switching strategy corresponding to the target business service is queried according to the service type of the target business service; the traffic switching strategy is a traffic switching rule sequence consisting of at least one traffic switching rule.
[0057] In one embodiment, the second system is a unitized system, and the second system includes a public parameter service node; when the target system is the second system, the method further includes:
[0058] Determining whether the target business service meets preset public parameter service conditions based on the business type, execution frequency, and execution time of the target business service;
[0059] If the target business service meets the preset public parameter service conditions, the business request is forwarded to the public parameter service node.
[0060] In one embodiment, the method further comprises:
[0061] If the target business service does not meet the preset public parameter service conditions, the target unit corresponding to the business request is determined according to the customer information and a preset unit determination rule, and the business request is forwarded to the target unit.
[0062] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0063] Receiving a business request for a target business service; the business request includes customer information requesting the target business service; the target business service is a service supported by the first system and the second system;
[0064] In the preset correspondence between business services and configuration class instances, query the configuration class instance corresponding to the target business service;
[0065] Read the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service;
[0066] Based on the customer information and the target traffic switching strategy, a target system corresponding to the business request is determined, and the business request is forwarded to the target system; the target system is one of the first system and the second system.
[0067] In one embodiment, the method further comprises:
[0068] Receive configuration modification information; the configuration modification information includes a target business service and a modified flow switching strategy corresponding to the target business service;
[0069] In the preset correspondence between business services and configuration class instances, query the target configuration class instance corresponding to the target business service;
[0070] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated.
[0071] In one embodiment, updating the variable attributes of the target configuration class instance according to the modified traffic switching strategy corresponding to the target business service includes:
[0072] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
[0073] In one embodiment, before receiving the configuration modification information, the method further includes:
[0074] Determining the service type of the target business service according to the business volume and execution time of the target business service;
[0075] In the preset correspondence between service types and traffic switching strategies, the traffic switching strategy corresponding to the target business service is queried according to the service type of the target business service; the traffic switching strategy is a traffic switching rule sequence consisting of at least one traffic switching rule.
[0076] In one embodiment, the second system is a unitized system, and the second system includes a public parameter service node; when the target system is the second system, the method further includes:
[0077] Determining whether the target business service meets preset public parameter service conditions based on the business type, execution frequency, and execution time of the target business service;
[0078] If the target business service meets the preset public parameter service conditions, the business request is forwarded to the public parameter service node.
[0079] In one embodiment, the method further comprises:
[0080] If the target business service does not meet the preset public parameter service conditions, the target unit corresponding to the business request is determined according to the customer information and a preset unit determination rule, and the business request is forwarded to the target unit.
[0081] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0082] Receiving a business request for a target business service; the business request includes customer information requesting the target business service; the target business service is a service supported by the first system and the second system;
[0083] In the preset correspondence between business services and configuration class instances, query the configuration class instance corresponding to the target business service;
[0084] Read the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service;
[0085] Based on the customer information and the target traffic switching strategy, a target system corresponding to the business request is determined, and the business request is forwarded to the target system; the target system is one of the first system and the second system.
[0086] In one embodiment, the method further comprises:
[0087] Receive configuration modification information; the configuration modification information includes a target business service and a modified flow switching strategy corresponding to the target business service;
[0088] In the preset correspondence between business services and configuration class instances, query the target configuration class instance corresponding to the target business service;
[0089] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated.
[0090] In one embodiment, updating the variable attributes of the target configuration class instance according to the modified traffic switching strategy corresponding to the target business service includes:
[0091] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
[0092] In one embodiment, before receiving the configuration modification information, the method further includes:
[0093] Determining the service type of the target business service according to the business volume and execution time of the target business service;
[0094] In the preset correspondence between service types and traffic switching strategies, the traffic switching strategy corresponding to the target business service is queried according to the service type of the target business service; the traffic switching strategy is a traffic switching rule sequence consisting of at least one traffic switching rule.
[0095] In one embodiment, the second system is a unitized system, and the second system includes a public parameter service node; when the target system is the second system, the method further includes:
[0096] Determining whether the target business service meets preset public parameter service conditions based on the business type, execution frequency, and execution time of the target business service;
[0097] If the target business service meets the preset public parameter service conditions, the business request is forwarded to the public parameter service node.
[0098] In one embodiment, the method further comprises:
[0099] If the target business service does not meet the preset public parameter service conditions, the target unit corresponding to the business request is determined according to the customer information and a preset unit determination rule, and the business request is forwarded to the target unit.
[0100] In the above-mentioned business flow switching method, apparatus, computer equipment, storage medium and computer program product, a terminal receives a business request for a target business service, then queries the configuration class instance corresponding to the target business service in the preset correspondence between the business service and the configuration class instance, reads the variable attributes of the configuration class instance, obtains the target flow switching strategy corresponding to the target business service, and then, based on the customer information and the target flow switching strategy, determines the target system corresponding to the business request in the first system and the second system, and forwards the business request to the target system, thereby realizing business flow switching between the first system and the second system. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] Figure 1 1 is a flow chart of a service flow switching method in one embodiment;
[0102] Figure 2 Schematic diagram of a flow chart of a service flow switching method in another embodiment;
[0103] Figure 3 Schematic diagram of a flow chart of a service flow switching method in another embodiment;
[0104] Figure 4 1 is a flow chart of a service flow switching method in an embodiment when the target system is the second system;
[0105] Figure 5 is a structural block diagram of a service flow switching device in one embodiment;
[0106] Figure 6 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0107] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0108] In one embodiment, Figure 1 As shown, a service flow switching method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers. In this embodiment, the method includes the following steps:
[0109] Step 101: Receive a business request for a target business service.
[0110] The service request includes customer information requesting a target service, which is a service supported by the first system and the second system.
[0111] In an embodiment of the present application, a terminal receives a service request for a target service. The first system and the second system are systems for performing service traffic switching, i.e., service traffic switching is performed between the first system and the second system. The first system may be the system from which traffic is switched out, and the second system may be the system from which traffic is switched in. The first system may be an old system, and the second system may be a new system. Customer information is information about the customer for whom the service request is being made. Customer information may include a customer number and the customer's region.
[0112] Step 102: In the preset correspondence between business services and configuration class instances, query the configuration class instance corresponding to the target business service.
[0113] In an embodiment of the present application, a terminal pre-stores a correspondence between business services and configuration class instances. The terminal then searches for the configuration class instance corresponding to the target business service within this correspondence. The configuration class instance is used to record information that enables the operation of the target business service. This information includes the traffic switching policy corresponding to the target business service.
[0114] In one example, the terminal pre-stores the correspondence between the business service and the configuration class instance in the memory.
[0115] Step 103: Read the variable attributes of the configuration class instance to obtain the target traffic switching strategy corresponding to the target business service.
[0116] In an embodiment of the present application, the terminal reads the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service. Among them, the target flow switching strategy is used to indicate how the target business service switches between systems. For example, the target flow switching strategy can be whitelist routing, grayscale area routing, or full flow switching. Whitelist routing means that if the customer number is in the whitelist, the business service of the customer number is implemented on the new system. If the customer number is not in the whitelist, the business service of the customer number continues to be completed in the old system. Grayscale area routing means that if the customer's region is in the whitelist, the business service of the customer's region is implemented on the new system. If the customer's region is not in the whitelist, the business service of the customer's region continues to be completed in the old system. Full flow switching means that all business services will be forwarded to the new system for implementation.
[0117] In one example, the terminal retrieves the inheritance chain from the cache based on the fully qualified name of the configuration class. The terminal then retrieves the configuration class instance corresponding to the target business service from the inheritance chain. The terminal then reads the variable attributes of the configuration class instance to obtain the target traffic switching policy corresponding to the target business service.
[0118] Step 104 : Based on the customer information and the target traffic switching strategy, determine the target system corresponding to the business request, and forward the business request to the target system.
[0119] The target system is one of the first system and the second system.
[0120] In the embodiment of the present application, the terminal determines the target system corresponding to the service request based on the customer information and the target switching strategy, and then forwards the service request to the target system.
[0121] In one example, the target traffic switching policy is whitelist routing, and the customer information includes a customer number. The terminal determines whether the customer number is on the whitelist. If the customer number is on the whitelist, the terminal determines that the target system for the service request is the second system. If the customer number is not on the whitelist, the terminal determines that the target system for the service request is the first system.
[0122] In one example, the target traffic switching strategy is grayscale regional routing, and the customer information includes the customer number. Based on the customer number, the terminal searches the preset mapping relationship between customer numbers and customer regions to find the customer's region for the service request. The terminal then determines whether the customer's region is on a whitelist. If so, the terminal determines that the target system for the service request is the second system. If not, the terminal determines that the target system for the service request is the first system.
[0123] In the above-mentioned business flow switching method, the terminal receives a business request for a target business service, and then searches for the configuration class instance corresponding to the target business service in the preset correspondence between the business service and the configuration class instance, reads the variable attributes of the configuration class instance, obtains the target flow switching strategy corresponding to the target business service, and then, based on the customer information and the target flow switching strategy, determines the target system corresponding to the business request in the first system and the second system, and forwards the business request to the target system, thereby realizing business flow switching between the first system and the second system. In addition, by presetting the correspondence between the business service and the configuration class instance, the terminal enables each business service to correspond to a different flow switching strategy, so that each business service can perform business flow switching according to different flow switching strategies, thereby realizing service-level business flow switching and improving the accuracy and adaptability of flow switching between multiple service systems.
[0124] In one embodiment, Figure 2As shown, the service flow switching method further includes the following steps:
[0125] Step 201: Receive configuration modification information.
[0126] The configuration modification information includes the target business service and the modified traffic switching policy corresponding to the target business service.
[0127] In an embodiment of the present application, a terminal receives configuration modification information, wherein the configuration modification information is used to indicate a change in a traffic switching policy of a target business service.
[0128] In one example, the terminal receives configuration modification information through a listener.
[0129] Step 202: In the preset correspondence between business services and configuration class instances, query the target configuration class instance corresponding to the target business service.
[0130] In the embodiment of the present application, the terminal queries the target configuration class instance corresponding to the target business service in the preset correspondence relationship between the business service and the configuration class instance.
[0131] Step 203: Update the variable attributes of the target configuration class instance according to the modified flow switching strategy corresponding to the target business service.
[0132] In the embodiment of the present application, the terminal updates the variable attributes of the target configuration class instance according to the modified traffic switching policy corresponding to the target business service, wherein the variable attributes of the target configuration class instance are used to represent the traffic switching policy corresponding to the target business service.
[0133] In the above-mentioned business flow switching method, when the flow switching strategy of the target business service changes, the configuration modification information of the target business service is received in a timely manner, and the target configuration class instance corresponding to the target business service is queried in the preset correspondence between the business service and the configuration class instance, and then the variable attributes of the target configuration class instance are updated according to the modified flow switching strategy, so as to realize the real-time update and effectiveness of the flow switching strategy of the target business service, and facilitate the upgrade or rollback of the flow switching strategy. Not only that, this method does not require system restart and container regeneration, does not affect the operation of the system, and is also time-saving. Moreover, the configuration of the flow switching strategy is implemented outside the business code and registered as a service, which is transmitted to the system that needs to switch the flow through the network, and then the configuration is implemented on the application side through reflection, thereby realizing the decoupling of the flow switching strategy and the business code. In addition, developers only need to write JavaBeans and introduce annotations to use it, without having to write complex logic code, and the usage is also unified and simple.
[0134] In one embodiment, the specific process of updating the variable attributes of the target configuration class instance according to the modified flow switching strategy corresponding to the target business service includes the following steps: according to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
[0135] In an embodiment of the present application, the terminal updates the variable attributes of the target configuration class instance by calling a preset function of the target configuration class instance based on the modified traffic switching policy corresponding to the target business service. The preset function is used to implement the update of the variable attributes of the target configuration class instance. For example, the preset function can be a set function.
[0136] In the above-mentioned business switching method, the terminal updates the variable attributes of the target configuration class instance by calling the preset function of the target configuration class instance according to the modified switching strategy corresponding to the target business service, thereby realizing real-time update and effectiveness of the switching strategy of the target business service without restarting the system and regenerating the container, which does not affect the system operation and takes less time.
[0137] In one embodiment, Figure 3 As shown, before receiving the configuration modification information, the service flow switching method further includes the following steps:
[0138] Step 301: Determine the service type of the target business service according to the business volume and execution time of the target business service.
[0139] In an embodiment of the present application, a terminal determines the service type of a target business service based on the traffic volume and execution time of the target business service. The service type may include a first service type and a second service type. The first service type may be a business service with high traffic volume and time sensitivity. The second service type may be a business service with low traffic volume or not time sensitive.
[0140] Specifically, the terminal compares the traffic volume of the target business service with a preset traffic volume threshold. Simultaneously, the terminal compares the execution time of the target business service with a preset execution time threshold. If the traffic volume of the target business service is greater than or equal to the preset traffic volume threshold, and the execution time of the target business service is less than or equal to the preset execution time threshold, the terminal determines that the service type of the target business service is the first service type. If the traffic volume of the target business service is less than the preset traffic volume threshold, and the execution time of the target business service is greater than the preset execution time threshold, the terminal determines that the service type of the target business service is the second service type.
[0141] Step 302 : In the preset correspondence between service types and traffic switching policies, the traffic switching policy corresponding to the target business service is searched according to the service type of the target business service.
[0142] The traffic switching strategy is a traffic switching rule sequence consisting of at least one traffic switching rule.
[0143] In an embodiment of the present application, the terminal pre-stores the mapping between service types and traffic switching policies. The terminal then searches for the traffic switching policy corresponding to the target service based on the service type of the target service within the pre-set mapping between service types and traffic switching policies. The traffic switching rules indicate how the service switches between systems. For example, traffic switching rules can include whitelist routing, grayscale region routing, or full traffic switching.
[0144] Specifically, if the service type of the target business service is the first service type, the terminal determines that the traffic switching policy corresponding to the target business service is the first traffic switching policy. If the service type of the target business service is the second service type, the terminal determines that the traffic switching policy corresponding to the target business service is the second traffic switching policy. In one example, the first traffic switching policy may be whitelist routing first, then grayscale region routing, and then full traffic switching. The second traffic switching policy may be whitelist routing first, then full traffic switching.
[0145] In the aforementioned service switching method, the terminal determines the service type of the target service based on its traffic volume and execution time. Then, based on the preset correspondence between service types and switching policies, it searches for the corresponding switching policy for the target service based on its service type. This method determines the appropriate switching policy for the target service based on its traffic volume and execution time. This not only allows the target service's switching policy to be determined, but also improves the stability of service switching for target services of different service types by assigning different switching policies to them. A switching policy is a sequence of switching rules consisting of at least one switching rule.
[0146] In one embodiment, Figure 4 As shown, the second system is a unitized system, and the second system includes a public parameter service node. In the case where the target system is the second system, the service flow switching method further includes the following steps:
[0147] Step 401 : judging whether the target business service meets the preset public parameter service conditions according to the business type, execution frequency and execution time of the target business service.
[0148] In an embodiment of the present application, the unitized system includes at least two units. The service type may include a first service type and a second service type. The first service type may not be able to perform service splitting. The second service type may be able to perform service splitting.
[0149] The terminal compares the execution frequency of the target business service with the preset execution frequency threshold. At the same time, the terminal compares the execution time of the target business service with the preset execution time threshold. If the business type of the target business service is the first business type, and the execution frequency of the target business service is less than or equal to the preset execution frequency threshold, and the execution time of the target business service is greater than or equal to the preset execution time threshold, then the terminal determines that the target business service meets the preset public parameter service condition. If the business type of the target business service is the second business type, or the execution frequency of the target business service is greater than the preset execution frequency threshold, or the execution time of the target business service is less than the preset execution time threshold, then the terminal determines that the target business service does not meet the preset public parameter service condition.
[0150] In one example, the terminal presets a service type of the target service.
[0151] In one example, the terminal identifies the service type of the target service according to a preset identification algorithm.
[0152] Step 402: If the target business service meets the preset public parameter service conditions, the business request is forwarded to the public parameter service node.
[0153] In an embodiment of the present application, if the target business service meets the preset public parameter service conditions, the terminal forwards the business request to the public parameter service node.
[0154] In the above-mentioned business flow switching method, the second system is a unitized system, and the second system includes a public parameter service node. When the target system is the second system, it is determined whether the target business service meets the preset public parameter service conditions based on the business type, execution frequency and execution time of the target business service. If the target business service meets the preset public parameter service conditions, the business request is forwarded to the public parameter service node. In this way, by setting up a public parameter service node in the newly constructed unitized system, and forwarding the business requests of the target business service that cannot be split, is low-frequency, and is not time-sensitive to the public parameter service node for processing based on the business type, execution frequency and execution time of the target business service, it is more in line with the diversity of the target business service and can further improve the accuracy of business flow switching.
[0155] In one embodiment, the service flow switching method further includes the following steps: if the target service does not meet the preset public parameter service conditions, the target unit corresponding to the service request is determined according to the customer information and the preset unit determination rules, and the service request is forwarded to the target unit.
[0156] In an embodiment of the present application, if the target service does not meet the preset public parameter service conditions, the terminal determines the target unit corresponding to the service request based on the customer information and the preset unit determination rules. The terminal then forwards the service request to the target unit. The target unit is one of the units in the unitized system. Specifically, the terminal determines the target unit corresponding to the service request based on the customer number and the hash modulus algorithm.
[0157] In one example, the terminal performs a hash operation on the customer number to obtain a hash value of the customer number. The terminal then modulo a preset array length using the hash value of the customer number to obtain a calculation result corresponding to the service request. The terminal then determines the target unit corresponding to the service request based on the calculation result corresponding to the service request. If the number of units in the second system is 4, the preset array length may be 128.
[0158] In the aforementioned service flow switching method, if the target service does not meet the preset public parameter service conditions, the target unit corresponding to the service request is determined based on the customer information and the preset unit determination rules, and the service request is forwarded to the target unit. In this way, by using the preset unit determination rules, service requests for target service that do not meet the preset public parameter service conditions are forwarded to the target unit for processing, further improving the accuracy of service flow switching.
[0159] In one embodiment, the process of establishing the second system includes the following steps: determining the number of units of the first system based on the business volume of the first system; replicating the first system according to the number of units to obtain the number of units units; creating a front-end node and a public parameter service node; wherein the front-end node is used to distribute business requests and business flow switching; establishing the second system based on the number of units units, the front-end node and the public parameter service node.
[0160] In an embodiment of the present application, the first system may include a database, a service node, and a batch node. The terminal determines the number of units of the first system based on the business volume of the first system. Then, the terminal copies the number of units of the first system according to the number of units to obtain the number of units of units. Then, the terminal creates a front-end node and a public parameter service node. Then, the terminal constructs the second system with the number of units of units, the front-end node, and the public parameter service node. In this way, by copying the first system, constructing the front-end node and the public parameter service node, and constructing the second system into a unitized system, each unit can process the target business service of its corresponding customer in a closed loop, and can thoroughly carry out the sub-library and table division, thereby solving the performance problems of the new and old systems caused by the growth of business volume and service user groups.
[0161] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0162] Based on the same inventive concept, embodiments of the present application also provide a service switching device for implementing the aforementioned service switching method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more of the following service switching device embodiments can be found in the aforementioned limitations on the service switching method and will not be further elaborated here.
[0163] In one embodiment, Figure 5 As shown, a service flow switching device 500 is provided, comprising: a first receiving module 510, a first query module 520, a reading module 530 and a first determining module 540, wherein:
[0164] The first receiving module 510 is configured to receive a service request for a target service; the service request includes information about a customer requesting the target service; the target service is a service supported by the first system and the second system;
[0165] A first query module 520 is configured to query the configuration class instance corresponding to the target business service in the preset correspondence between business services and configuration class instances;
[0166] A reading module 530 is configured to read the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service;
[0167] The first determination module 540 is configured to determine a target system corresponding to the service request based on the customer information and the target traffic switching strategy, and forward the service request to the target system; the target system is one of the first system and the second system.
[0168] Optionally, the apparatus 500 further includes:
[0169] A second receiving module is configured to receive configuration modification information; the configuration modification information includes a target business service and a modified traffic switching policy corresponding to the target business service;
[0170] A second query module is used to query the target configuration class instance corresponding to the target business service in the preset correspondence relationship between business services and configuration class instances;
[0171] An updating module is used to update the variable attributes of the target configuration class instance according to the modified flow switching strategy corresponding to the target business service.
[0172] Optionally, the update module is specifically configured to:
[0173] According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
[0174] Optionally, the apparatus 500 further includes:
[0175] A second determining module is configured to determine a service type of the target business service according to the business volume and execution time of the target business service;
[0176] The third query module is used to query the traffic switching policy corresponding to the target business service according to the service type of the target business service in the preset correspondence between the service type and the traffic switching policy; the traffic switching policy is a traffic switching rule sequence composed of at least one traffic switching rule.
[0177] Optionally, the second system is a unitized system, and the second system includes a common parameter service node; when the target system is the second system, the apparatus 500 further includes:
[0178] A judgment module, configured to judge whether the target business service meets a preset public parameter service condition according to the business type, execution frequency and execution time of the target business service;
[0179] The forwarding module is configured to forward the service request to the public parameter service node if the target service meets a preset public parameter service condition.
[0180] Optionally, the apparatus 500 further includes:
[0181] The third determination module is used to determine the target unit corresponding to the business request according to the customer information and a preset unit determination rule if the target business service does not meet the preset public parameter service condition, and forward the business request to the target unit.
[0182] Each module in the aforementioned service flow switching device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0183] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a service switching method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0184] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0185] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0186] Receiving a business request for a target business service; the business request includes customer information requesting the target business service; the target business service is a service supported by the first system and the second system;
[0187] In the preset correspondence between business services and configuration class instances, query the configuration class instance corresponding to the target business service;
[0188] Read the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service;
[0189] Based on the customer information and the target traffic switching strategy, a target system corresponding to the business request is determined, and the business request is forwarded to the target system; the target system is one of the first system and the second system.
[0190] In one embodiment, when the processor executes the computer program, it also implements the following steps: receiving configuration modification information; the configuration modification information includes a target business service and a modified flow switching strategy corresponding to the target business service; querying a target configuration class instance corresponding to the target business service in a preset correspondence between business services and configuration class instances; and updating variable attributes of the target configuration class instance according to the modified flow switching strategy corresponding to the target business service.
[0191] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: updating the variable attributes of the target configuration class instance by calling the preset function of the target configuration class instance according to the modified flow switching strategy corresponding to the target business service.
[0192] In one embodiment, when the processor executes the computer program, it further implements the following steps: determining the service type of the target business service based on the business volume and execution time of the target business service; querying the flow switching policy corresponding to the target business service based on the service type of the target business service in the preset correspondence between the service type and the flow switching policy; the flow switching policy is a flow switching rule sequence consisting of at least one flow switching rule.
[0193] In one embodiment, when the processor executes the computer program, it further implements the following steps: judging whether the target business service meets the preset public parameter service conditions based on the business type, execution frequency, and execution time of the target business service; if the target business service meets the preset public parameter service conditions, forwarding the business request to the public parameter service node.
[0194] In one embodiment, when the processor executes the computer program, it also implements the following steps: if the target business service does not meet the preset public parameter service conditions, then determine the target unit corresponding to the business request based on the customer information and the preset unit determination rules, and forward the business request to the target unit.
[0195] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0196] Receiving a business request for a target business service; the business request includes customer information requesting the target business service; the target business service is a service supported by the first system and the second system;
[0197] In the preset correspondence between business services and configuration class instances, query the configuration class instance corresponding to the target business service;
[0198] Read the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service;
[0199] Based on the customer information and the target traffic switching strategy, a target system corresponding to the business request is determined, and the business request is forwarded to the target system; the target system is one of the first system and the second system.
[0200] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: receiving configuration modification information; the configuration modification information includes a target business service and a modified flow switching strategy corresponding to the target business service; querying a target configuration class instance corresponding to the target business service in a preset correspondence between business services and configuration class instances; and updating variable attributes of the target configuration class instance according to the modified flow switching strategy corresponding to the target business service.
[0201] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: according to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
[0202] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: determining the service type of the target business service based on the business volume and execution time of the target business service; querying the flow switching policy corresponding to the target business service based on the service type of the target business service in the preset correspondence between the service type and the flow switching policy; the flow switching policy is a flow switching rule sequence consisting of at least one flow switching rule.
[0203] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: judging whether the target business service meets the preset public parameter service conditions based on the business type, execution frequency and execution time of the target business service; if the target business service meets the preset public parameter service conditions, forwarding the business request to the public parameter service node.
[0204] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the target business service does not meet the preset public parameter service conditions, the target unit corresponding to the business request is determined based on the customer information and the preset unit determination rules, and the business request is forwarded to the target unit.
[0205] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0206] Receiving a business request for a target business service; the business request includes customer information requesting the target business service; the target business service is a service supported by the first system and the second system;
[0207] In the preset correspondence between business services and configuration class instances, query the configuration class instance corresponding to the target business service;
[0208] Read the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service;
[0209] Based on the customer information and the target traffic switching strategy, a target system corresponding to the business request is determined, and the business request is forwarded to the target system; the target system is one of the first system and the second system.
[0210] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: receiving configuration modification information; the configuration modification information includes a target business service and a modified flow switching strategy corresponding to the target business service; querying a target configuration class instance corresponding to the target business service in a preset correspondence between business services and configuration class instances; and updating variable attributes of the target configuration class instance according to the modified flow switching strategy corresponding to the target business service.
[0211] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: according to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
[0212] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: determining the service type of the target business service based on the business volume and execution time of the target business service; querying the flow switching policy corresponding to the target business service based on the service type of the target business service in the preset correspondence between the service type and the flow switching policy; the flow switching policy is a flow switching rule sequence consisting of at least one flow switching rule.
[0213] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: judging whether the target business service meets the preset public parameter service conditions based on the business type, execution frequency and execution time of the target business service; if the target business service meets the preset public parameter service conditions, forwarding the business request to the public parameter service node.
[0214] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the target business service does not meet the preset public parameter service conditions, the target unit corresponding to the business request is determined based on the customer information and the preset unit determination rules, and the business request is forwarded to the target unit.
[0215] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0216] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0217] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0218] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A service flow switching method, characterized in that: The method comprises: Receiving a business request for a target business service; the business request includes customer information requesting the target business service; the target business service is a service supported by the first system and the second system; In the preset correspondence between business services and configuration class instances, query the configuration class instance corresponding to the target business service; Read the variable attributes of the configuration class instance to obtain the target flow switching strategy corresponding to the target business service; Determine the target system corresponding to the service request based on the customer information and the target traffic switching strategy, and forward the service request to the target system; the target system is one of the first system and the second system; The second system is a unitized system, and the second system includes a public parameter service node; when the target system is the second system, the method further includes: Determining whether the target business service meets preset public parameter service conditions based on the business type, execution frequency, and execution time of the target business service; If the target business service meets the preset public parameter service conditions, the business request is forwarded to the public parameter service node.
2. The method according to claim 1, characterized in that The method further comprises: Receive configuration modification information; the configuration modification information includes a target business service and a modified flow switching strategy corresponding to the target business service; In the preset correspondence between business services and configuration class instances, query the target configuration class instance corresponding to the target business service; According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated.
3. The method according to claim 2, characterized in that The updating of the variable attributes of the target configuration class instance according to the modified flow switching strategy corresponding to the target business service includes: According to the modified flow switching strategy corresponding to the target business service, the variable attributes of the target configuration class instance are updated by calling the preset function of the target configuration class instance.
4. The method according to claim 2, characterized in that Before receiving the configuration modification information, the method further includes: Determining the service type of the target business service according to the business volume and execution time of the target business service; In the preset correspondence between service types and traffic switching strategies, the traffic switching strategy corresponding to the target business service is queried according to the service type of the target business service; the traffic switching strategy is a traffic switching rule sequence consisting of at least one traffic switching rule.
5. The method according to claim 1, wherein The method further comprises: If the target business service does not meet the preset public parameter service conditions, the target unit corresponding to the business request is determined according to the customer information and a preset unit determination rule, and the business request is forwarded to the target unit.
6. A service flow switching device, characterized in that: The device comprises: A first receiving module is configured to receive a service request for a target service; the service request includes information about a customer requesting the target service; the target service is a service supported by the first system and the second system; A first query module is used to query the configuration class instance corresponding to the target business service in the preset correspondence relationship between business services and configuration class instances; A reading module, configured to read the variable attributes of the configuration class instance and obtain the target flow switching strategy corresponding to the target business service; A first determining module is configured to determine a target system corresponding to the service request based on the customer information and the target traffic switching strategy, and forward the service request to the target system; the target system is one of the first system and the second system; The second system is a unitized system, and the second system includes a public parameter service node; when the target system is the second system, the apparatus further includes: A judgment module, configured to judge whether the target business service meets a preset public parameter service condition according to the business type, execution frequency and execution time of the target business service; The forwarding module is configured to forward the service request to the public parameter service node if the target service meets a preset public parameter service condition.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.