Data processing method, device and equipment and computer storage medium
By generating key values based on channel source identification and transaction identification, dynamically adjusting the circuit breaking function of thread pools, the problem that Hystrix components cannot be applied to requests from different channels is solved, and the applicability of circuit breaking strategies and system availability is improved.
Patent Information
- Application Number
- CN202411268227.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-31
AI Technical Summary
The existing Hystrix components can only implement URL-level circuit breaking and downgrade function, and cannot be applied to request traffic from different channels, resulting in low applicability of the circuit breaking strategy.
By obtaining the channel source identifier and transaction identifier in the access request information, generating key values, and finding the target circuit breaker parameters based on the preset correspondence, turning on or off the circuit breaker function, and processing successful times of access request information and system resource usage based on the historical thread pool. Dynamic adjustment of circuit breaker strategy.
It improves the applicability of the circuit breaker strategy, enables requests from different channels to be processed in the corresponding thread pool, dynamically adjusts the circuit breaker strategy to adapt to traffic changes and resource conditions, and improves the availability of the system.
Smart Images

Figure CN119226017A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a method, device, equipment, computer storage medium and computer program product for data processing. Background Art
[0002] In recent years, Internet systems have emphasized the concept of high availability, aiming to improve the system's ability to continue to provide stable and reliable operation when it encounters failures or abnormal situations. In related technologies, circuit breaking, current limiting and degradation strategies are usually used to make the system highly available.
[0003] At present, the related technology usually adopts the Hystrix component to configure the circuit breaker strategy, but the Hystrix component can only realize the circuit breaker degradation function at the URL level, that is, the Hystrix component can only configure the corresponding circuit breaker strategy for different interfaces. Since requests from different channels may enter the system from the same interface, the requests from these different channels are configured with the same circuit breaker strategy in the same thread pool, that is, the circuit breaker is triggered when the request flow reaches a certain level. However, the flow size of requests from different channels is also different, resulting in the circuit breaker strategy cannot be applied to requests from different channels, and the applicability is low. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, apparatus, device, computer storage medium, and computer program product for data processing, which can improve the applicability of a fuse strategy.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for data processing, the method comprising:
[0006] Obtain access request information, which carries a channel source identifier and a transaction identifier;
[0007] Generate a key value corresponding to the access request information based on the channel source identifier and the transaction identifier in the access request information;
[0008] Input the access request information into the corresponding thread pool according to the key value;
[0009] From the preset corresponding relationship, find the target circuit breaker parameter corresponding to the key value, where the preset corresponding relationship is the corresponding relationship between the preset key value and the parameter representing whether the circuit breaker needs to be turned on; the preset key value is determined according to the channel source identifier and the transaction identifier in the preset access request information;
[0010] When the target circuit breaker parameter indicates that circuit breaker needs to be turned on, the circuit breaker function is turned on for the thread pool.
[0011] In one practicable implementation, when the target fuse parameter indicates that the fuse needs to be turned on, after turning on the fuse function for the thread pool, the method further includes:
[0012] Detecting the number of successful processing of historical access request information in the thread pool within a first preset period;
[0013] When it is detected that the number of successful processing of historical access request information is less than the first preset threshold, the control thread pool stops obtaining access request information and executes the fuse degradation strategy within a second preset period.
[0014] In an achievable implementation, executing the fuse degradation strategy within the second preset period includes:
[0015] Obtaining the downgrade program execution path parameter corresponding to the key value from the preset configuration file;
[0016] In the second preset period, a target instruction is sent to the target server corresponding to the downgrade program execution path parameter for executing the corresponding downgrade strategy, and the target instruction includes a downgrade method used to enable the target server to execute the corresponding downgrade strategy.
[0017] In an achievable implementation, after executing the fuse degradation strategy within the second preset period, the data processing method further includes:
[0018] Obtain a preset number of access request information;
[0019] Detecting the number of successful processing of a preset number of access request information in the thread pool;
[0020] When it is detected that the number of successful processing of a preset number of access request information is less than a second preset threshold, the control thread pool stops acquiring access request information and re-executes the fuse degradation strategy within a second preset period;
[0021] When it is detected that the number of successful processing of a preset number of access request information is greater than or equal to a second preset threshold, the access request information is obtained and the execution of the fuse degradation strategy is stopped.
[0022] In one possible implementation, the data processing method further includes:
[0023] Detect the number of access request messages and system resource usage;
[0024] When the system resource usage is less than a preset usage threshold, the thread pool is expanded to process the access request information.
[0025] In an achievable implementation, generating a key value corresponding to the access request information based on the channel source identifier and the transaction identifier in the request information includes:
[0026] The channel source identifier and the transaction identifier in the access request information are respectively concatenated to obtain concatenated parameters;
[0027] The splicing parameters are encrypted using an encryption algorithm to obtain a key value corresponding to the access request information.
[0028] In one possible implementation, before obtaining the access request information, the method further includes:
[0029] Load the preset configuration file and obtain multiple preset target parameters saved in the preset configuration file;
[0030] Create multiple thread pools based on multiple preset target parameters;
[0031] Among them, multiple thread pools are isolated from each other.
[0032] In a second aspect, an embodiment of the present disclosure provides a data processing device, the device comprising:
[0033] An acquisition module is used to acquire access request information, where the access request information carries a channel source identifier and a transaction identifier;
[0034] A generating module, used for generating a key value corresponding to the access request information based on the channel source identifier and the transaction identifier in the access request information;
[0035] An input module, used to input access request information into corresponding thread pools according to key values;
[0036] A search module, used to search for a target fuse parameter corresponding to a key value from a preset corresponding relationship, where the preset corresponding relationship is a corresponding relationship between a preset key value and a parameter representing whether the fuse needs to be turned on; the preset key value is determined according to a channel source identifier and a transaction identifier in a preset access request information;
[0037] The enabling module is used to enable the fusing function for the thread pool when the target fusing parameter indicates that fusing needs to be enabled.
[0038] In a third aspect, an embodiment of the present disclosure provides a data processing device, the device comprising a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement a data processing method as described in any one of the first aspects.
[0039] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, a method for data processing as described in any one of the first aspects is implemented.
[0040] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the data processing method as described in any one of the first aspects when the computer program is executed by a processor.
[0041] The embodiments of the present disclosure provide a method, apparatus, device, computer storage medium and computer program product for data processing. The method obtains access request information. Based on the channel source identifier and transaction identifier in the access request information, a key value corresponding to the access request information is generated. The access request information is input into the corresponding thread pool according to the key value. From the preset corresponding relationship, the target fuse parameter corresponding to the key value is searched. When the target fuse parameter indicates that the fuse needs to be turned on, the fuse function is turned on for the thread pool. It can be seen that after obtaining the request information, the present disclosure inputs the request information into the corresponding thread pool for processing according to the target parameter in the request information, so that different request information is processed in the corresponding thread pool, and the fuse function is turned on in the thread pool, thereby improving the applicability of the fuse strategy. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following is a brief introduction to the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 is a flowchart of a data processing method provided by an embodiment of the present disclosure;
[0044] Figure 2 It is a flowchart of a method for determining to execute a fuse downgrade strategy provided by an embodiment of the present disclosure;
[0045] Figure 3 It is a flowchart of a method for executing a circuit breaker downgrade strategy provided by an embodiment of the present disclosure;
[0046] Figure 4 It is a flowchart of a method for determining whether to cancel the execution of a circuit breaker downgrade strategy provided by an embodiment of the present disclosure;
[0047] Figure 5 is a flowchart of another data processing method provided by an embodiment of the present disclosure;
[0048] Figure 6is a flowchart of another data processing method provided by an embodiment of the present disclosure;
[0049] Figure 7 is a flowchart of another data processing method provided by an embodiment of the present disclosure;
[0050] Figure 8 is a structural diagram of a data processing device provided by an embodiment of the present disclosure;
[0051] Fig. 9 It is a structural diagram of a data processing device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0052] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present invention, rather than to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.
[0053] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0054] It should be noted that the acquisition, storage, use and processing of data in the embodiments of the present application are in compliance with the relevant provisions of national laws and regulations.
[0055] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0056] Before describing the technical solutions provided by the embodiments of the present disclosure, in order to facilitate understanding of the embodiments of the present disclosure, the present disclosure specifically describes the problems existing in the related technologies:
[0057] Currently, systems facing Internet users all emphasize the concept of high availability, aiming to improve the system's ability to continue to provide stable and reliable operation when encountering failures or abnormal situations. For example, during a promotion, the backend system of a shopping application receives a large number of access request information without downtime and can still provide stable and reliable services to users.
[0058] In the related art, the system usually implements circuit breaking, current limiting and degradation strategies to improve the availability of the system. At present, the system mainly relies on the Hystrix component to implement the circuit breaking strategy. However, the Hystrix component can only implement the circuit breaking and degradation function at the URL level, that is, the Hystrix component can only configure the corresponding circuit breaking strategy for different interfaces. For example, the system can receive access request information through different interfaces, so the corresponding circuit breaking strategy is configured for the system interface through the Hystrix component.
[0059] However, requests from different channels may enter the system from the same interface, so these requests from different channels are configured with the same fuse strategy in the same thread pool, that is, the fuse is triggered when the request flow rate reaches a certain level. However, the flow rate of requests from different channels is also different, which makes the fuse strategy unable to apply to requests from different channels and has low applicability.
[0060] In view of the above research findings of the inventors, the embodiments of the present disclosure provide a method, apparatus, device, computer storage medium and computer program product for data processing, which can solve the technical problems existing in the related technologies.
[0061] The embodiment of the present disclosure obtains access request information. Based on the channel source identifier and the transaction identifier in the access request information, a key value corresponding to the access request information is generated. The access request information is input into the corresponding thread pool according to the key value. From the preset corresponding relationship, the target fuse parameter corresponding to the key value is found. When the target fuse parameter indicates that the fuse needs to be turned on, the fuse function is turned on for the thread pool. It can be seen that after obtaining the request information, the present disclosure inputs the request information into the corresponding thread pool for processing according to the target parameters in the request information, so that different request information is processed in the corresponding thread pool, and the fuse function is turned on in the thread pool, thereby improving the applicability of the fuse strategy.
[0062] The following is an introduction to the data processing method provided by the embodiments of the present disclosure.
[0063] Figure 1 FIG. 1 is a flow chart showing a method for data processing provided by an embodiment of the present disclosure. Figure 1 , the method includes steps S110-S150.
[0064] S110: Obtain access request information.
[0065] The system obtains access request information.
[0066] The access request information corresponds to multiple applications. The access request information carries a channel source identifier and a transaction identifier. The channel source identifier is used to indicate which application the access request information is issued by. The transaction identifier is used to indicate the transaction type.
[0067] In one example, the access request information obtained from multiple applications includes access request information A of a chat application and access request information B of a shopping application. The channel source identifier of access request information A is 9000, and the transaction identifier is KJ200. The channel source identifier of access request information B is 9001, and the transaction identifier is KJ200.
[0068] S120: Generate a key value corresponding to the access request information based on the channel source identifier and the transaction identifier in the access request information.
[0069] After the access request information is obtained, a key value (key) corresponding to the access request information is generated according to the characteristic information of the channel source identifier and the transaction identifier in the access request information.
[0070] The key value is used to uniquely identify the channel source identifier and the transaction identifier in the access request information. The key value may be generated by using the channel source identifier and the transaction identifier in the access request information.
[0071] In an example, a key value can be generated based on the channel source identifier, transaction identifier and transaction date of the access request information. For example, the channel source identifier of the access request information is 800, the transaction identifier is BNS99, and the transaction date is YYYY-RR-QQ. The key value generated based on the channel source identifier, transaction identifier and transaction date is "800-BNS99-YYYYRRQQ".
[0072] In one embodiment, generating a key value corresponding to the access request information based on the channel source identifier and the transaction identifier in the access request information may include step S121 and step S122.
[0073] S121: Concatenate the channel source identifier and the transaction identifier in the access request information to obtain concatenated parameters.
[0074] After obtaining the channel source identifier and the transaction identifier in the access request information, the channel source identifier and the transaction identifier may be concatenated in a preset order to obtain concatenation parameters.
[0075] In an example, the channel source identifier 9000 and the transaction identifier KJ200 of the access request information A may be concatenated to generate concatenated parameters "9000-KJ200".
[0076] S122: Encrypt the splicing parameters using an encryption algorithm to obtain a key value corresponding to the access request information.
[0077] After the splicing parameters are obtained, the splicing parameters are encrypted using an encryption algorithm to obtain a key value corresponding to the access request information.
[0078] The disclosed embodiment obtains a splicing parameter by splicing the channel source identifier and the transaction identifier, and encrypts the splicing parameter by using an encryption algorithm to obtain a key value, thereby improving the security of the key value.
[0079] S130: Input the access request information into the corresponding thread pool according to the key value.
[0080] After the key value of the access request information is generated, the access request information is input into a thread pool corresponding to the key value to process the access request information.
[0081] Among them, different thread pools correspond to a unique key value.
[0082] S140: Searching for a target fuse parameter corresponding to the key value from a preset corresponding relationship.
[0083] From the preset correspondence, find the target fuse parameter corresponding to the key value.
[0084] The number of preset corresponding relationships is not fixed. The preset corresponding relationship is the corresponding relationship between the preset key value and the parameter representing whether the circuit breaker needs to be turned on; the preset key value is determined according to the channel source identifier and transaction identifier in the preset access request information, and the preset corresponding relationship is stored in the preset configuration file.
[0085] In one example, the key value corresponding to the access request information B is N1, and the key value corresponding to the access request information C is M1. The preset corresponding relationships include the corresponding relationships "N1-able" and "M1-unable". After finding the corresponding relationship "N1-able" according to the key value N1, the target fuse parameter able corresponding to the key value N1 can be obtained, where able represents turning on the fuse function. After finding the corresponding relationship "M1-unable" according to the key value M1, the target fuse parameter unable corresponding to the key value M1 can be obtained, where unable represents not turning on the fuse function.
[0086] S150: When the target fusing parameter indicates that fusing needs to be enabled, the fusing function is enabled for the thread pool.
[0087] After the target parameters are obtained according to the key values, if the target fuse parameter indicates that the fuse needs to be turned on, the fuse function is turned on for the thread pool.
[0088] After obtaining the request information, the embodiment of the present disclosure inputs the request information into the corresponding thread pool for processing according to the target parameters in the request information, so that different request information is processed in the corresponding thread pool, and the fuse function is enabled in the thread pool, thereby improving the applicability of the fuse strategy.
[0089] In one embodiment, when the target fuse parameter indicates that the fuse needs to be turned on, after the fuse function is turned on for the thread pool, the data processing method further includes steps S160 and S170. Figure 2 shown.
[0090] S160: Detecting the number of successful processing of historical access request information in the thread pool within a first preset period.
[0091] The thread pool with the fuse function turned on detects the number of successful processing of historical access request information within a first preset period.
[0092] The duration of the first preset period is not fixed.
[0093] In an example, the number of successful processing of historical access request information within one hour may be detected for the thread pool H with the fuse function enabled.
[0094] S170: When it is detected that the number of successful processing of historical access request information is less than a first preset threshold, the control thread pool stops acquiring access request information and executes the fuse degradation strategy within a second preset period.
[0095] If it is detected that the number of successful processing of historical access request information within the first preset period is less than the first preset threshold, the fuse control thread pool stops obtaining access request information and executes the fuse degradation strategy within the second preset period.
[0096] The first preset threshold is not fixed, and the second preset period is not fixed. The fuse degradation strategy is used to provide a degradation service to the downstream target server, such as returning to the default preset value, when the thread pool cannot respond to the access request information.
[0097] In one example, when the thread pool cannot respond to and process access request information, it returns a default value "Current function is not available, please try again later" to the source channel corresponding to the access request information, that is, the downstream target server.
[0098] In one example, the threshold information of the first preset threshold corresponding to each thread pool with the fuse function enabled may be different.
[0099] The disclosed embodiment detects the number of successful processing of historical access request information in a thread pool within a preset period, and determines whether to execute a circuit breaker and downgrade strategy based on the detection result, thereby improving the flexibility of executing the circuit breaker and downgrade strategy.
[0100] In one embodiment, executing the fuse degradation strategy within the second preset period may include steps S171 and S172. Figure 3 shown.
[0101] S171: Obtaining a downgrade program execution path parameter corresponding to the key value from a preset configuration file.
[0102] After determining to execute the circuit breaker downgrade strategy, the downgrade program execution path parameter corresponding to the key value is obtained from the preset configuration file in the circuit breaker.
[0103] The downgrade program execution path parameter represents the downstream target server corresponding to the execution of the downgrade service.
[0104] S172: within a second preset period, sending a target instruction to a target server corresponding to the downgrade program execution path parameter for executing a corresponding downgrade strategy.
[0105] In the second preset period, according to the downgrade program execution path parameter, a target instruction is sent to a server corresponding to the downgrade program execution path parameter, thereby executing the corresponding downgrade strategy.
[0106] The target instruction includes a downgrade method used to make the target server execute the corresponding downgrade strategy, and the downgrade method includes returning to a default value.
[0107] The embodiment of the present disclosure can execute the downgrade strategy to the corresponding target server by downgrading the program execution path parameters from the preset configuration file, thereby improving the accuracy of executing the downgrade strategy.
[0108] In one embodiment, after the fuse degradation strategy is executed within the second preset period, the data processing method further includes steps S210-S240, such as Figure 4 shown.
[0109] S210: Obtain a preset amount of access request information.
[0110] After the second preset period ends, a preset amount of access request information is reacquired.
[0111] S220: Detecting the number of successful processing of a preset number of access request information in the thread pool.
[0112] The obtained preset number of access request information is input into the corresponding thread pool according to the key value for processing, and the number of successful processing of the preset number of access request information in the thread pool is detected.
[0113] S230: When it is detected that the number of successful processing of a preset number of access request information is less than a second preset threshold, the control thread pool stops acquiring access request information and re-executes the fuse degradation strategy within a second preset period.
[0114] If it is detected that the number of times a preset number of access request information is successfully processed in the thread pool is less than a second preset threshold, the fuse controls the thread pool to stop obtaining access request information and re-executes the fuse degradation strategy within a second preset period.
[0115] The size of the second preset threshold is not fixed.
[0116] S240: When it is detected that the number of successful processing of a preset number of access request information is greater than or equal to a second preset threshold, the access request information is obtained and the execution of the fuse degradation strategy is stopped.
[0117] If it is detected that a preset number of access request information is successfully processed in the thread pool a number of times greater than or equal to a second preset threshold, the fuse controls the thread pool to continue obtaining access request information and stops executing the fuse degradation strategy.
[0118] The disclosed embodiment can improve the flexibility of the circuit breaker downgrade strategy by detecting the number of successful processing of a preset number of access request information in the thread pool and performing different actions according to the detection results.
[0119] In one embodiment, the flowchart of the data processing method is as follows: Figure 5As shown, in S501, the channel source identifier and transaction identifier of application S are obtained. The channel source identifier of application S is 1000, and the transaction identifier is TXN01. In S502, based on the key value composed of the channel source identifier and transaction identifier of application S, the access request information of application S is input into the corresponding thread pool. The key value corresponding to the thread pool is "1000-TXN01".
[0120] In S503, when it is detected that the number of successful times of the thread pool processing the access request information of the application S is lower than the preset first threshold, the acquisition of the access request information is stopped and the first degradation strategy is executed.
[0121] In one embodiment, the flowchart of the data processing method is as follows: Figure 6 As shown, in S601, the channel source identifier and transaction identifier of application D are obtained. The channel source identifier of application D is 1001, and the transaction identifier is TXN01. In S602, based on the key value composed of the channel source identifier and transaction identifier of application D, the access request information of application D is input into the corresponding thread pool. The key value corresponding to the thread pool is "1001-TXN01". In S603, when it is detected that the number of successful times of the thread pool processing the access request information of application D is lower than the preset first threshold, stop obtaining the access request information and execute the second downgrade strategy.
[0122] In one embodiment, the flowchart of the data processing method is as follows: Figure 7 As shown, in S701, the channel source identifier and transaction identifier of application F are obtained. The channel source identifier of application F is 1002, and the transaction identifier is TXN01. In S702, based on the key value composed of the channel source identifier and transaction identifier of application F, the access request information of application F is input into the corresponding thread pool. The key value corresponding to the thread pool is "1002-TXN01". In S703, when it is detected that the number of successful times of the thread pool processing the access request information of application F is lower than the preset first threshold, stop obtaining the access request information and execute the third downgrade strategy.
[0123] In one embodiment, the data processing method further includes step S250 and step S260.
[0124] S250: Detect the number of access request information and the amount of system resource usage.
[0125] Detect access requests received within a preset time period and the current resource usage of the system.
[0126] The resource usage includes physical resource usage such as the occupancy rate of a central processing unit (CPU) and the occupancy rate of a memory.
[0127] S260: When the system resource usage is less than a preset usage threshold, the thread pool is expanded to process the access request information.
[0128] If the system resource usage is less than the preset usage threshold, the thread pool corresponding to the access request information is expanded to process more access request information.
[0129] The disclosed embodiment detects the number of access request messages and the usage of system resources, and expands the thread pool according to the detection results, thereby increasing the number of processed access request messages and the number of times the processed access request messages are successfully processed, thereby reducing the probability of executing the circuit breaker downgrade strategy.
[0130] In one embodiment, before obtaining the access request information, the data processing method further includes step S270 and step S280.
[0131] S270: Load a preset configuration file, and obtain a plurality of preset target parameters saved in the preset configuration file.
[0132] Load the preset configuration file in the fuse and read multiple preset target parameters from the preset configuration file.
[0133] S280: Create multiple thread pools based on multiple preset target parameters.
[0134] After obtaining multiple preset target parameters, multiple thread pools are created corresponding to the multiple preset target parameters.
[0135] Among them, multiple thread pools are isolated from each other, that is, each thread pool only processes corresponding access request information.
[0136] The disclosed embodiment can create multiple thread pools by acquiring multiple preset target parameters, so that each thread pool processes corresponding access request information, thereby improving the processing efficiency of the access request information.
[0137] like Figure 8 As shown, the embodiment of the present disclosure further provides a data processing device 800, and the data processing device 800 includes:
[0138] An acquisition module 801 is used to acquire access request information, where the access request information carries a channel source identifier and a transaction identifier;
[0139] A generating module 802, which is used to generate a key value corresponding to the access request information based on the channel source identifier and the transaction identifier in the access request information;
[0140] An input module 803, the input module is used to input the access request information into the corresponding thread pool according to the key value;
[0141] A search module 804 is used to search for a target fuse parameter corresponding to a key value from a preset corresponding relationship, where the preset corresponding relationship is a corresponding relationship between a preset key value and a parameter representing whether a fuse needs to be opened; the preset key value is determined according to a channel source identifier and a transaction identifier in the preset access request information;
[0142] The enabling module 805 is used to enable the fusing function for the thread pool when the target fusing parameter indicates that the fusing needs to be enabled.
[0143] In some embodiments, the data processing device 800 includes a detection module, which is used to detect the number of successful processing of historical access request information in the thread pool within a first preset period;
[0144] When it is detected that the number of successful processing of historical access request information is less than the first preset threshold, the control thread pool stops obtaining access request information and executes the fuse degradation strategy within a second preset period.
[0145] In some embodiments, the acquisition module 801 is specifically used to:
[0146] Obtaining the downgrade program execution path parameter corresponding to the key value from the preset configuration file;
[0147] In the second preset period, a target instruction is sent to the target server corresponding to the downgrade program execution path parameter for executing the corresponding downgrade strategy, and the target instruction includes a downgrade method used to enable the target server to execute the corresponding downgrade strategy.
[0148] In some embodiments, the acquisition module 801 is specifically used to:
[0149] Obtain a preset number of access request information;
[0150] Detecting the number of successful processing of a preset number of access request information in the thread pool;
[0151] When it is detected that the number of successful processing of a preset number of access request information is less than a second preset threshold, the control thread pool stops acquiring access request information and re-executes the fuse degradation strategy within a second preset period;
[0152] When it is detected that the number of successful processing of a preset number of access request information is greater than or equal to a second preset threshold, the access request information is obtained and the execution of the fuse degradation strategy is stopped.
[0153] In some embodiments, the data processing apparatus 800 includes a detection module, the detection module is used to detect the number of access request information and the amount of system resource usage;
[0154] When the system resource usage is less than a preset usage threshold, the thread pool is expanded to process the access request information.
[0155] In some embodiments, the data processing device 800 includes a splicing module, which is used to splice the channel source identifier and the transaction identifier in the access request information to obtain a splicing parameter;
[0156] The splicing parameters are encrypted using an encryption algorithm to obtain a key value corresponding to the access request information.
[0157] In some embodiments, the data processing device 800 includes a loading module, which is used to load a preset configuration file and obtain a plurality of preset target parameters saved in the preset configuration file;
[0158] Create multiple thread pools based on multiple preset target parameters;
[0159] Among them, multiple thread pools are isolated from each other.
[0160] Figure 8 Each module / unit in the device shown has the function of realizing Figures 1 to 4 The functions of each step executed by the application system in the present invention can achieve the corresponding technical effects. For the sake of brevity, they will not be repeated here.
[0161] Fig. 9 A schematic diagram of the hardware structure of data processing provided by an embodiment of the present disclosure is shown.
[0162] The data processing device may include a processor 901 and a memory 902 storing computer program instructions.
[0163] Specifically, the processor 901 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0164] The memory 902 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 902 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 902 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 902 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 902 is a non-volatile solid-state memory.
[0165] The memory 902 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present disclosure.
[0166] The processor 901 implements any one of the data processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 902 .
[0167] In one example, the data processing device may further include a communication interface 903 and a bus 904. Fig. 9 As shown, the processor 901, the memory 902, and the communication interface 903 are connected via a bus 904 and communicate with each other.
[0168] The communication interface 903 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0169] Bus 904 includes hardware, software or both, and couples the components of online data flow billing equipment to each other. For example, but not limitation, the bus may include Accelerated Graphics Port (AGP) or other graphics bus, Enhanced Industry Standard Architecture (EISA) bus, Front Side Bus (FSB), Hyper Transport (HT) interconnection, Industry Standard Architecture (ISA) bus, InfiniBand interconnection, Low Pin Count (LPC) bus, Memory bus, Micro Channel Architecture (MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-X) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association Local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 904 may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection. In addition, in conjunction with the method for data processing in the above-mentioned embodiment, the embodiment of the present application also provides a computer storage medium to realize. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data processing methods in the above embodiments is implemented.
[0170] An embodiment of the present application also provides a computer program product, including a computer program, which implements any one of the data processing methods in the above embodiments when the computer program is executed by a processor.
[0171] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0172] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable ReadOnly Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0173] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0174] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0175] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A method for data processing, characterized in that: include: Obtaining access request information, where the access request information carries a channel source identifier and a transaction identifier; Based on the channel source identifier and the transaction identifier in the access request information, generating a key value corresponding to the access request information; Input the access request information into the corresponding thread pool according to the key value; Searching for a target fuse parameter corresponding to the key value from a preset corresponding relationship, wherein the preset corresponding relationship is a corresponding relationship between a preset key value and a parameter indicating whether the fuse needs to be opened; The preset key value is determined according to the channel source identifier and the transaction identifier in the preset access request information; When the target fusing parameter indicates that fusing needs to be turned on, the fusing function is turned on for the thread pool.
2. The method according to claim 1, characterized in that When the target fusing parameter indicates that fusing needs to be turned on, after turning on the fusing function for the thread pool, the method further includes: Detecting the number of successful processing of historical access request information in the thread pool within a first preset period; When it is detected that the number of successful processing of historical access request information is less than a first preset threshold, the thread pool is controlled to stop acquiring access request information and execute the fuse degradation strategy within a second preset period.
3. The method according to claim 2, characterized in that The executing of the fuse downgrade strategy within the second preset period includes: Acquire a downgrade program execution path parameter corresponding to the key value from a preset configuration file; In the second preset period, a target instruction is sent to a target server corresponding to the downgrade program execution path parameter for executing a corresponding downgrade strategy, wherein the target instruction includes a downgrade method used to enable the target server to execute the corresponding downgrade strategy.
4. The method according to claim 2, characterized in that: After executing the fuse downgrade strategy within the second preset period, the method further includes: Obtain a preset number of access request information; Detecting the number of successful processing of the preset number of access request information in the thread pool; When it is detected that the number of successful processing of the preset number of access request information is less than the second preset threshold, controlling the thread pool to stop acquiring access request information and re-execute the fuse degradation strategy within the second preset period; When it is detected that the number of successful processing of the preset number of access request information is greater than or equal to the second preset threshold, the access request information is obtained and the execution of the fuse degradation strategy is stopped.
5. The method according to claim 1, characterized in that The method further comprises: Detect the number of access request messages and system resource usage; When the system resource usage is less than a preset usage threshold, the thread pool is expanded to process the access request information.
6. The method according to claim 1, characterized in that The generating a key value corresponding to the access request information based on the channel source identifier and the transaction identifier in the request information includes: Concatenate the channel source identifier and the transaction identifier in the access request information to obtain concatenated parameters; The splicing parameters are encrypted using an encryption algorithm to obtain a key value corresponding to the access request information.
7. The method according to claim 1, characterized in that Before obtaining the access request information, the method further includes: Loading a preset configuration file, and obtaining a plurality of preset target parameters saved in the preset configuration file; Creating a plurality of thread pools corresponding to the plurality of preset target parameters; Wherein, the multiple thread pools are isolated from each other.
8. A data processing device, characterized in that: The device comprises: An acquisition module, the acquisition module is used to acquire access request information, the access request information carries a channel source identifier and a transaction identifier; A generating module, the generating module being used to generate a key value corresponding to the access request information based on the channel source identifier and the transaction identifier in the access request information; An input module, the input module is used to input the access request information into corresponding thread pools according to the key values; A search module, the search module is used to search for a target fuse parameter corresponding to the key value from a preset corresponding relationship, the preset corresponding relationship is a corresponding relationship between a preset key value and a parameter representing whether the fuse needs to be turned on; the preset key value is determined according to a channel source identifier and a transaction identifier in a preset access request information; An enabling module, wherein the enabling module is used to enable the fusing function for the thread pool when a target fusing parameter indicates that the fusing needs to be enabled.
9. A data processing device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for data processing according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the data processing method according to any one of claims 1 to 7.
