Intelligent request distribution method and apparatus, and network attached storage device
Through the intelligent request distribution method, the effective conditions of the application are judged based on the request parameters and credential settings results, flexible and accurate request distribution is achieved, the security and stability of the application is improved, resource occupation is reduced, and the uniqueness and data isolation of credentials are enhanced.
Patent Information
- Application Number
- CN202510311737.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-07-22
AI Technical Summary
In the prior art, the request distribution method has the problems of high risk of credential leakage, low flexibility and accuracy, resulting in insufficient security and efficiency of application operation.
By determining the request parameters of the target application, performing user credential settings, judging valid request conditions based on the credential setting results and application status information, and using the preset response stage or error processing stage for corresponding operations, including empty processing and error processing.
It improves the accuracy and flexibility of request distribution, enhances the operational security and stability of the application, reduces resource usage, ensures the uniqueness of credentials and data isolation, and improves the targetedness and timeliness of the response phase.
Smart Images

Figure CN120358284A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network requests, and in particular to an intelligent request distribution method, device and network attached storage device. Background Art
[0002] With the rapid development of Internet technologies, especially the widespread application of cloud computing, big data and Internet of Things technologies, applications are facing unprecedented request processing challenges, among which request distribution plays a vital role in the entire request processing process.
[0003] Currently, the main method for request distribution is that each suite has its own business interface. When making interface requests, all suites use a unified user credential. When the suite is opened, the main application sends the user credential to the suite at one time, which increases the risk of credential leakage. Furthermore, request distribution is based on fixed policies and rules, and the flexibility and accuracy of request distribution are low. Therefore, it is particularly important to provide a method that can improve the accuracy and flexibility of request distribution. Summary of the invention
[0004] The present invention provides an intelligent request distribution method, device and network attached storage device, which can improve the distribution accuracy and distribution flexibility of requests, thereby improving the operation security and operation simplicity of applications.
[0005] In order to solve the above technical problems, the first aspect of the present invention discloses an intelligent request distribution method, which is applied to an electronic device, and the electronic device is installed with a client that can access a network attached storage device. The method includes:
[0006] Determine a target request corresponding to the target application, wherein the target request includes basic request parameters;
[0007] According to the basic request parameters and the determined target storage area, a corresponding user credential setting operation is performed to obtain a user credential setting result;
[0008] Determining request status information according to the user credential setting result and the target application;
[0009] Determining whether the target application meets a preset valid request condition according to the request status information;
[0010] When it is determined that the target application satisfies the valid request condition, a sequential scheme and its corresponding response phase are entered based on a preset response phase, and the target application and / or the target interceptor are controlled to perform corresponding null processing operations;
[0011] When it is determined that the target application does not meet the valid request conditions, based on a preset error handling response phase, control the target application and / or the target interceptor to perform corresponding error handling operations.
[0012] As an alternative implementation manner, in the first aspect of the present invention, the controlling the target application and / or the target interceptor to perform corresponding error handling operations based on a preset error handling response phase includes:
[0013] Determine the first configuration and data information corresponding to the target application;
[0014] Perform corresponding data parsing operations on the first configuration and data information to obtain one or more target errors and their corresponding error information, where the error information includes an error type and / or specific error content, and the error type includes a general error type or a non-general error type;
[0015] According to each of the target errors and their corresponding error information, control the target application and / or the target interceptor to perform the error handling operations.
[0016] As an alternative implementation manner, in the first aspect of the present invention, the controlling the target application and / or the target interceptor to perform the error handling operations according to each of the target errors and their corresponding error information includes:
[0017] According to each of the target errors and their corresponding error information, divide all the target errors into first target errors that meet the general error type and / or second target errors that meet the non-general error type;
[0018] For the first target errors, according to a preset business general custom error handling method, control the main application interceptor included in the target interceptor to perform corresponding general error handling operations on the first target errors;
[0019] For the second target errors, determine a target error handling object according to the error information corresponding to the second target errors, the target application, and / or the target interceptor; according to a preset non-general custom error handling method, control the target error handling object to perform corresponding non-general error handling operations on the second target errors.
[0020] As an alternative implementation manner, in the first aspect of the present invention, the controlling the target application and / or the target interceptor to perform corresponding null handling operations based on a preset response phase entry sequence scheme and its corresponding response phase includes:
[0021] Based on a preset response phase entry sequence scheme and its corresponding response phase, determine the second configuration and data information corresponding to the target application, and perform corresponding data parsing operations on the second configuration and data information to obtain the private service to be processed;
[0022] According to a preset business custom processing method, control the target application to perform corresponding processing operations on the private service to be processed, and control the target interceptor to perform the null processing operation.
[0023] As an optional implementation manner, in the first aspect of the present invention, the determining the request status information according to the user credential setting result and the target application includes:
[0024] Determine the modified application configuration information corresponding to the target application according to the user credential setting result;
[0025] Send the modified application configuration information to the target application, and based on the target application, perform corresponding request processing operations to obtain a target issued request;
[0026] Determine the request status information according to the target issued request.
[0027] As an optional implementation manner, in the first aspect of the present invention, the obtaining a target issued request based on the target application performing corresponding request processing operations includes:
[0028] According to the determined function configuration information of the target application, determine whether the target application meets the preset condition for calling the interceptor;
[0029] When it is determined that the target application meets the condition for calling the interceptor, determine the configured interceptor of the target application itself, and control to enter the request phase corresponding to the configured interceptor to perform corresponding processing operations to obtain a target issued request.
[0030] As an optional implementation manner, in the first aspect of the present invention, the determining whether the target application meets the preset valid request condition according to the request status information includes:
[0031] Determine a request status code according to the request status information;
[0032] Determine whether the request status code matches a preset request status code threshold;
[0033] When it is determined that the request status code matches the request status code threshold, determine that the target application meets the preset valid request condition;
[0034] When it is determined that the request status code does not match the request status code threshold, it is determined that the target application does not meet the preset valid request condition.
[0035] A second aspect of the present invention discloses an intelligent request distribution device, the device includes an electronic device, and a client capable of accessing a network attached storage device is installed on the electronic device, and the device includes:
[0036] A request determination module, configured to determine a target request corresponding to a target application, where the target request includes basic request parameters;
[0037] A credential setting module, configured to perform corresponding user credential setting operations according to the basic request parameters and the determined target storage area, and obtain a user credential setting result;
[0038] A status determination module, configured to determine request status information according to the user credential setting result and the target application;
[0039] A judgment module, configured to judge whether the target application meets the preset valid request condition according to the request status information;
[0040] A first execution module, configured to, when the judgment module determines that the target application meets the valid request condition, enter the corresponding response phase based on a preset response phase entry sequence scheme, and control the target application and / or the target interceptor to perform corresponding null processing operations;
[0041] A second execution module, configured to, when the judgment module determines that the target application does not meet the valid request condition, control the target application and / or the target interceptor to perform corresponding error handling operations based on a preset processing error response phase.
[0042] As an optional implementation manner, in the second aspect of the present invention, the manner in which the second execution module controls the target application and / or the target interceptor to perform corresponding error handling operations based on a preset processing error response phase specifically includes:
[0043] Determine the first configuration and data information corresponding to the target application;
[0044] Perform corresponding data parsing operations on the first configuration and data information to obtain one or more target errors and their corresponding error information, where the error information includes error types and / or specific error contents, and the error types include general error types or non-general error types;
[0045] Control the target application and / or the target interceptor to perform the error handling operations according to each target error and its corresponding error information.
[0046] As an alternative implementation manner, in the second aspect of the present invention, the manner in which the second execution module controls the target application and / or the target interceptor to perform the error handling operation according to each of the target errors and their corresponding error information specifically includes:
[0047] According to each of the target errors and their corresponding error information, all the target errors are divided into first target errors that meet the general error type and / or second target errors that meet the non-general error type;
[0048] For the first target errors, according to the preset general business custom error handling manner, control the main application interceptor included in the target interceptor to perform corresponding general error handling operations on the first target errors;
[0049] For the second target errors, determine a target error handling object according to the error information corresponding to the second target errors, the target application, and / or the target interceptor; according to the preset non-general custom error handling manner, control the target error handling object to perform corresponding non-general error handling operations on the second target errors.
[0050] As an alternative implementation manner, in the second aspect of the present invention, the manner in which the first execution module controls the target application and / or the target interceptor to perform corresponding null processing operations based on a preset response phase entry sequence scheme and its corresponding response phase specifically includes:
[0051] Based on a preset response phase entry sequence scheme and its corresponding response phase, determine the second configuration and data information corresponding to the target application, and perform corresponding data parsing operations on the second configuration and data information to obtain the private service to be processed;
[0052] According to the preset business custom processing manner, control the target application to perform corresponding processing operations on the private service to be processed, and control the target interceptor to perform the null processing operation.
[0053] As an alternative implementation manner, in the second aspect of the present invention, the manner in which the status determination module determines the request status information according to the user credential setting result and the target application specifically includes:
[0054] According to the user credential setting result, determine the modified application configuration information corresponding to the target application;
[0055] Send the modified application configuration information to the target application, and based on the target application performing corresponding request processing operations, obtain the target issued request;
[0056] Send a request according to the target and determine the request status information.
[0057] As an alternative implementation, in the second aspect of the present invention, the manner in which the status determination module performs corresponding request processing operations based on the target application to obtain the manner of sending a request by the target specifically includes:
[0058] According to the determined function configuration information of the target application, determine whether the target application meets the preset callable interceptor condition;
[0059] When it is determined that the target application meets the callable interceptor condition, determine the configured interceptor configured by the target application itself, and control to enter the request phase corresponding to the configured interceptor to perform corresponding processing operations to obtain a request sent by the target.
[0060] As an alternative implementation, in the second aspect of the present invention, the manner in which the judgment module determines whether the target application meets the preset valid request condition according to the request status information specifically includes:
[0061] According to the request status information, determine the request status code;
[0062] Determine whether the request status code matches a preset request status code threshold;
[0063] When it is determined that the request status code matches the request status code threshold, determine that the target application meets the preset valid request condition;
[0064] When it is determined that the request status code does not match the request status code threshold, determine that the target application does not meet the preset valid request condition.
[0065] The third aspect of the present invention discloses another electronic device, which includes:
[0066] A memory storing executable program code;
[0067] A processor coupled to the memory;
[0068] The processor calls the executable program code stored in the memory and executes an intelligent request distribution method disclosed in the first aspect of the present invention.
[0069] A fourth aspect of the present invention discloses a network attached storage device, which is configured with a display screen and is used for interactive communication with an electronic device. Among them, the network attached storage device is used to perform data analysis and request distribution operations with a client capable of accessing the network attached storage device installed on the electronic device through an intelligent request distribution method disclosed in the first aspect of the present invention.
[0070] A fifth aspect of the present invention discloses a computer storage medium storing computer instructions, which are used to execute an intelligent request distribution method disclosed in the first aspect of the present invention when being called.
[0071] A sixth aspect of the present invention discloses an intelligent request distribution system, which includes an intelligent request distribution device disclosed in the second aspect of the present invention and a network attached storage device communicatively connected to the device; or,
[0072] The system includes an electronic device disclosed in the third aspect of the present invention and a network attached storage device communicatively connected to the electronic device.
[0073] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0074] In an embodiment of the present invention, a target request corresponding to a target application is determined, and the target request includes basic request parameters; according to the basic request parameters and the determined target storage area, a corresponding user credential setting operation is performed to obtain a user credential setting result; according to the user credential setting result and the target application, request status information is determined; according to the request status information, it is determined whether the target application meets a preset valid request condition; when it is determined that the target application meets the valid request condition, based on a preset response phase entry sequence scheme and its corresponding response phase, the target application and / or the target interceptor are controlled to perform corresponding null processing operations; when it is determined that the target application does not meet the valid request condition, based on a preset processing error response phase, the target application and / or the target interceptor are controlled to perform corresponding error processing operations. It can be seen that the present invention can achieve unified request planning and management, which is beneficial to improving the accuracy and flexibility of request distribution, and further beneficial to improving the accuracy and reliability of request management, thus being beneficial to improving the security and stability of application operation based on requests. In addition, it can also provide user credential setting and application methods, which is beneficial to improving the pertinence, uniqueness, isolation and accuracy of the obtained user credential setting result, and further beneficial to improving the data isolation, application security and controllability of the user credential setting result, reducing the resource occupancy space to a certain extent. In addition, corresponding response phase operations are respectively matched according to different valid request condition satisfaction results, which is beneficial to improving the execution pertinence, timeliness and accuracy of response phase operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for description in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0076] Figure 1 is a flowchart of an intelligent request distribution method disclosed in an embodiment of the present invention;
[0077] Figure 2 is a flowchart of another intelligent request distribution method disclosed in an embodiment of the present invention;
[0078] Figure 3 is a structural diagram of an intelligent request distribution device disclosed in an embodiment of the present invention;
[0079] Figure 4 is a structural diagram of an electronic device disclosed in an embodiment of the present invention;
[0080] Figure 5It is a schematic flowchart of another intelligent request distribution method disclosed in an embodiment of the present invention;
[0081] Figure 6 It is a schematic structural diagram of an intelligent request distribution system disclosed in an embodiment of the present invention. Detailed implementation manners
[0082] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present invention.
[0083] Terms such as "first" and "second" in the specification and claims of the present invention and the above drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or terminal that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes unlisted steps or units, or optionally further includes other steps or units inherent to these processes, methods, products or terminals.
[0084] Referring to "embodiment" herein means that a specific feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0085] The present invention discloses an intelligent request distribution method, device and network attached storage device, which can realize unified request planning and management, is beneficial to improving the accuracy and flexibility of request distribution, and further beneficial to improving the management accuracy and reliability of requests, thereby being beneficial to improving the operation security and stability of applications based on requests. In addition, it can also provide user credential setting and application methods, which is beneficial to improving the pertinence, uniqueness, isolation and accuracy of the obtained user credential setting results, and further beneficial to improving the data isolation, application security and controllability of user credential setting results, reducing the resource occupation space to a certain extent. In addition, corresponding response stage operations are respectively matched according to different valid request condition satisfaction results, which is beneficial to improving the execution pertinence, timeliness and accuracy of response stage operations. The following will be described in detail respectively.
[0086] Example 1
[0087] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of an intelligent request distribution method disclosed in an embodiment of the present invention. Among them, Figure 1 the described method can be applied to an electronic device, and a client capable of accessing a network attached storage device is installed on the electronic device, which is not limited in the embodiments of the present invention. As Figure 1 shown, the intelligent request distribution method includes the following operations:
[0088] 101. Determine a target request corresponding to a target application, where the target request includes basic request parameters.
[0089] Optionally, as Figure 5 shown, a schematic flowchart of another intelligent request distribution method is disclosed, which is not limited in the embodiments of the present invention.
[0090] Optionally, the target application may include, but is not limited to, a main application and / or a secondary application. Further, the main application can be understood as the application layer, and the secondary application can be an APP running on the main application, which is not limited in the embodiments of the present invention.
[0091] Optionally, for the above determination of the target request corresponding to the target application, for example: an APP running on the main application sends a request to obtain basic request parameters. Further, by using methods such as get / post / put to initiate a request, it will enter the request stage in the interceptor of the main application, including the most basic request parameters such as url, method, header, and params, which is not limited in the embodiments of the present invention.
[0092] Optionally, the basic request parameters may include, but are not limited to, one or more of the most basic request parameters such as url, method, header, and params, which is not limited in the embodiments of the present invention.
[0093] 102. According to the basic request parameters and the determined target storage area, perform corresponding user credential setting operations to obtain a user credential setting result.
[0094] Further optionally, for the above execution of corresponding user credential setting operations according to the basic request parameters and the determined target storage area to obtain a user credential setting result, for example: set user credentials for the incoming header in the request stage. Further, obtain the user credentials of the target storage area, such as: header.token = user.token, which is not limited in the embodiments of the present invention.
[0095] 103. Determine the request status information based on the user credential setting result and the target application.
[0096] Optionally, the request status information can be understood as the request result for the output send / cancel send request. Further, the request result can be used to indicate success or failure, which is not limited in the embodiments of the present invention.
[0097] Optionally, only the main application can manage and maintain it, with credential data isolation. The application layer cannot directly use it, and the credential lifecycle is globally unique, with low maintenance complexity; only the main application has the credential data, reducing the resource occupancy of the application layer and optimizing the performance; the expiration and renewal processing of the credential do not need to be implemented by each application and are all processed by the main application, which is more concise; the credential issued by the application through this technology has no storage in the application layer, which can ensure security to a certain extent and has higher security; there is no unified distribution process, and it is dynamically calculated in the main application during the request, which is more time-sensitive, and this is not limited in the embodiments of the present invention.
[0098] 104. According to the request status information, determine whether the target application meets the preset valid request condition. When the judgment result is yes, execute step 105; when the judgment result is no, execute step 106.
[0099] Further optionally, the above-mentioned determining whether the target application meets the preset valid request condition according to the request status information may include:
[0100] When the request status information is used to represent the success status, it is determined that the target application meets the preset valid request condition; when the request status information is used to represent the failure status, it is determined that the target application does not meet the preset valid request condition.
[0101] 105. Based on the preset response phase entry sequence scheme and its corresponding response phase, control the target application and / or the target interceptor to execute the corresponding null processing operation.
[0102] Optionally, an example of the preset response phase entry sequence scheme: first is the interceptor of the main application, and second is the interceptor of the application itself, that is, the self-interceptor of the APP running on the main application, which is not limited in the embodiments of the present invention.
[0103] Optionally, an example of the above-mentioned controlling the target application and / or the target interceptor to execute the corresponding null processing operation based on the preset response phase entry sequence scheme and its corresponding response phase: enter the response phase of the corresponding interceptor in the order of the main application and the application itself. The response phase is for the respective private business processing at the application side, and the main application interceptor does not perform processing, which is not limited in the embodiments of the present invention.
[0104] Optionally, the response phase can be understood as the response phase, and the embodiments of the present invention do not make any limitations.
[0105] 106. Based on a preset processing error response phase, control the target application and / or the target interceptor to perform corresponding error handling operations.
[0106] Optionally, for the above-mentioned operation of controlling the target application and / or the target interceptor to perform corresponding error handling operations based on a preset processing error response phase, for example: in the handleErrorResponse phase, private business processing is performed at the application side, and the main application interceptor performs general error handling, such as network exceptions, voucher expiration, etc. The embodiments of the present invention do not make any limitations.
[0107] Further optionally, configure an interceptor in the main application (base). Before the request, obtain the request configuration structure, including information such as the url; set the user voucher in the "before HTTP initiation" phase; the application layer decides whether to configure the interceptor at the application layer according to the business situation. The embodiments of the present invention do not make any limitations.
[0108] Optionally, the processing error response phase can be understood as the handleErrorResponse phase, and the embodiments of the present invention do not make any limitations.
[0109] It can be seen that an intelligent request distribution method described in the embodiments of the present invention can achieve unified request planning and management, which is beneficial to improving the accuracy and flexibility of request distribution, and further beneficial to improving the accuracy and reliability of request management, thus beneficial to improving the security and stability of application operation based on requests. In addition, it can also provide user voucher setting and application methods, which is beneficial to improving the pertinence, uniqueness, isolation and accuracy of the obtained user voucher setting results, and further beneficial to improving the data isolation, application security and controllability of user voucher setting results, reducing the resource occupation space to a certain extent. In addition, matching corresponding response phase operations for different valid request condition satisfaction results respectively is beneficial to improving the execution pertinence, timeliness and accuracy of response phase operations.
[0110] In an optional embodiment, the above-mentioned operation of controlling the target application and / or the target interceptor to perform corresponding error handling operations based on a preset processing error response phase may include:
[0111] Determine the first configuration and data information corresponding to the target application;
[0112] Perform corresponding data parsing operations on the first configuration and data information to obtain one or more target errors and their corresponding error information. The error information includes error types and / or specific error contents, and the error types include general error types or non-general error types;
[0113] According to each target error and its corresponding error information, control the target application and / or the target interceptor to perform error handling operations.
[0114] Optionally, the first configuration and data information may correspond to data and config, which are not limited in the embodiments of the present invention.
[0115] Optionally, examples of the target error include network exception, credential expiration, etc., which are not limited in the embodiments of the present invention.
[0116] It can be seen that this optional embodiment can provide specific operation methods for the error response handling phase, which is beneficial to improving the comprehensiveness and rationality of the operation methods for the error response handling phase, and further beneficial to improving the execution accuracy and reliability of the operations for the error response handling phase. Thus, it is beneficial to improve the error handling accuracy, efficiency, and timeliness, and to a certain extent, beneficial to improving the operation effectiveness, stability, and security of the application.
[0117] In another optional embodiment, the above-mentioned controlling the target application and / or the target interceptor to perform error handling operations according to each target error and its corresponding error information may include:
[0118] According to each target error and its corresponding error information, divide all target errors into first target errors that meet the general error type and / or second target errors that meet the non-general error type;
[0119] For the first target errors, according to the preset general business custom error handling method, control the main application interceptor included in the target interceptor to perform corresponding general error handling operations on the first target errors;
[0120] For the second target errors, determine the target error handling object according to the error information corresponding to the second target errors, the target application, and / or the target interceptor; according to the preset non-general custom error handling method, control the target error handling object to perform corresponding non-general error handling operations on the second target errors.
[0121] Further optionally, the method for determining the error type of the above-mentioned target error may also be determined by the user, which is not limited in the embodiments of the present invention.
[0122] Optionally, the above-mentioned controlling the main application interceptor included in the target interceptor to perform general error handling operations on the first target errors, for example, the application interceptor performs general error handling, which is not limited in the embodiments of the present invention.
[0123] Further optionally, the above-mentioned determining the target error handling object according to the error information corresponding to the second target errors, the target application, and / or the target interceptor may include:
[0124] Determine the required function for resolving the second target error based on the error information corresponding to the second target error, and determine the target application and the configured function for error resolution of the target interceptor;
[0125] Based on the required function and the configured function, determine whether the target application and / or the target interceptor meet the preset error resolvability condition for the second target error;
[0126] When it is determined that the target application and / or the target interceptor meet the error resolvability condition, determine the first comprehensive level of the target application and the second target error at the error resolution level based on the required function and the configured function, and determine the second comprehensive level of the target interceptor and the second target error at the error resolution level; when the first comprehensive level is better than or equal to the second comprehensive level, determine the target application as the target error handling object; when the first comprehensive level is lower than the second comprehensive level, determine the target interceptor as the target error handling object;
[0127] When it is determined that the target application and / or the target interceptor do not meet the error resolvability condition, determine the linkage support object for resolving the second target error based on the required function, and determine the linkage support object as the target error handling object.
[0128] Further optionally, the above-mentioned determining whether the target application and / or the target interceptor meet the preset error resolvability condition for the second target error based on the required function and the configured function may include:
[0129] Determine the functional relevance based on the required function and the configured function, and determine whether the functional relevance is greater than or equal to the preset functional relevance threshold;
[0130] When the judgment result is yes, determine that the target application and / or the target interceptor meet the preset error resolvability condition for the second target error;
[0131] When the judgment result is no, determine that the target application and / or the target interceptor do not meet the preset error resolvability condition for the second target error.
[0132] It can be seen that this optional embodiment can respectively match corresponding error handling methods for the first target error of the general error type and the second target error of the non-general error type, which is beneficial to improving the comprehensiveness, pertinence, flexibility and rationality of the error handling method, and further beneficial to improving the accuracy, reliability and efficiency of error handling.
[0133] In another optional embodiment, the above-mentioned controlling the target application and / or the target interceptor to perform corresponding null processing operations based on the preset response phase entry sequence scheme and its corresponding response phase may include:
[0134] Based on the preset response phase entry sequence scheme and its corresponding response phases, determine the second configuration and data information corresponding to the target application, and perform corresponding data parsing operations on the second configuration and data information to obtain the private service to be processed.
[0135] According to the preset business custom processing method, control the target application to perform corresponding processing operations on the private service to be processed, and control the target interceptor to perform a null processing operation.
[0136] Optionally, the second configuration and data information may correspond to data and config, which is not limited in the embodiments of the present invention.
[0137] Optionally, the above control for the target interceptor to perform a null processing operation is exemplified as: the main application interceptor does not perform any processing, which is not limited in the embodiments of the present invention.
[0138] It can be seen that this optional embodiment can provide a specific operation method for the conventional response phase, which is beneficial to improving the comprehensiveness and rationality of the operation method for the conventional response phase, and further beneficial to improving the execution accuracy and reliability of the operations for the conventional response phase. Thus, it is beneficial to improve the operation accuracy, pertinence and effectiveness of the interceptor, reduce unnecessary resource waste, and improve the operation effectiveness, stability and security of the application.
[0139] Embodiment 2
[0140] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of another intelligent request distribution method disclosed in the embodiments of the present invention. Among them, Figure 2 the described method can be applied to an electronic device, and a client for accessing a network attached storage device is installed on the electronic device, which is not limited in the embodiments of the present invention. As Figure 2 shown, this intelligent request distribution method includes the following operations:
[0141] 201. Determine the target request corresponding to the target application, where the target request includes basic request parameters.
[0142] 202. According to the basic request parameters and the determined target storage area, perform corresponding user credential setting operations to obtain the user credential setting result.
[0143] 203. According to the user credential setting result, determine the modified application configuration information corresponding to the target application; send the modified application configuration information to the target application, and based on the target application, perform corresponding request processing operations to obtain the target issued request; according to the target issued request, determine the request status information.
[0144] Further optionally, the above-mentioned modified application configuration information is sent to the target application, and the corresponding request processing operation is performed based on the target application to obtain the target sending the request. For example: the modified configuration is given to the application that initiates the request. Specifically, the modified configuration is injected into the header / data. Further, when the application has its own interceptor, it enters the request stage of the application's own interceptor. After the request stage of the primary application and / or secondary application's own interceptor ends, the request is sent (that is, the target sends a request), and the embodiments of the present invention are not limited to this.
[0145] Optionally, the target sends a request, specifically: send / cancel send request, which is not limited in the embodiment of the present invention.
[0146] 204. According to the request status information, determine whether the target application meets the preset valid request condition. When the determination result is yes, execute step 205; when the determination result is no, execute step 206.
[0147] 205. Entering a sequential scheme and its corresponding response phase based on a preset response phase, controlling the target application and / or the target interceptor to perform corresponding null processing operations.
[0148] 206. Based on the preset error processing response phase, control the target application and / or the target interceptor to perform corresponding error processing operations.
[0149] In the embodiment of the present invention, for other descriptions of steps 201 to 206, please refer to the detailed description of steps 101 to 106 in the first embodiment, and the embodiment of the present invention will not be repeated here.
[0150] It can be seen that the embodiments of the present invention can realize unified request planning and management, which is conducive to improving the accuracy and flexibility of request distribution, and further conducive to improving the accuracy and reliability of request management, thereby facilitating improving the security and stability of application operation based on requests. In addition, it can also provide user credential setting and application methods, which is conducive to improving the pertinence, uniqueness, isolation and accuracy of the obtained user credential setting results, and further conducive to improving the data isolation, application security and controllability of the user credential setting results, and to a certain extent reducing the resource occupied space. In addition, for different valid request condition satisfaction results, the corresponding response stage operations are matched respectively, which is conducive to improving the execution pertinence, timeliness and accuracy of the response stage operations; and, it can also provide a specific request status information determination method, which is conducive to improving the comprehensiveness and rationality of the request status information determination method, and further conducive to improving the pertinence, accuracy and reliability of the determined request status information, and is conducive to improving the correlation between the determined request status information and the user credential setting results and the target application.
[0151] In an alternative embodiment, the above-mentioned execution of corresponding request processing operations based on the target application to obtain the target issued request may include:
[0152] According to the determined function configuration information of the target application, determine whether the target application meets the preset callable interceptor condition;
[0153] When it is determined that the target application meets the callable interceptor condition, determine the configured interceptor of the target application itself, and control to enter the corresponding request stage of the configured interceptor to execute the corresponding processing operation to obtain the target issued request.
[0154] Further optionally, the above-mentioned determination of whether the target application meets the preset callable interceptor condition according to the determined function configuration information of the target application may include:
[0155] According to the determined function configuration information of the target application, determine whether the target application has its own interceptor;
[0156] When it is determined that the target application does not have its own interceptor, determine that the target application does not meet the preset callable interceptor condition;
[0157] When it is determined that the target application has its own interceptor, determine whether the interceptor of the target application meets the preset interceptor required function condition;
[0158] When it is determined that the interceptor of the target application meets the interceptor required function condition, determine that the target application meets the preset callable interceptor condition;
[0159] When it is determined that the interceptor of the target application does not meet the interceptor required function condition, determine that the target application does not meet the preset callable interceptor condition.
[0160] It can be seen that this alternative embodiment can provide a specific method for determining the target issued request. When it is determined that the target application meets the callable interceptor condition, control to enter the corresponding request stage of the configured interceptor to execute the corresponding processing operation to obtain the target issued request, which is beneficial to improving the comprehensiveness, integrity and rationality of the target issued request determination method, and further beneficial to improving the accuracy and reliability of the determined target issued request. In addition, it is also beneficial to improving the timeliness, accuracy and rationality of the execution of relevant request processing operations.
[0161] In another alternative embodiment, the above-mentioned determination of whether the target application meets the preset valid request condition according to the request status information may include:
[0162] According to the request status information, determine the request status code;
[0163] Determine whether the request status code matches a preset request status code threshold;
[0164] When it is determined that the request status code matches the request status code threshold, it is determined that the target application meets the preset valid request condition;
[0165] When it is determined that the request status code does not match the request status code threshold, it is determined that the target application does not meet the preset valid request condition.
[0166] Optionally, the request status code and the request status code threshold are exemplified as follows: when the request HTTP status (i.e., the request status code) is 200 (i.e., the request status code threshold), it is determined that the target application meets the preset valid request condition; when the request HTTP status (i.e., the request status code) is not 200 (i.e., the request status code threshold), it is determined that the target application does not meet the preset valid request condition, and the embodiments of the present invention are not limited thereto.
[0167] It can be seen that this optional embodiment can determine the request status code according to the request status information, and then determine the satisfaction result of the valid request condition based on the comparison between the request status code and the corresponding threshold, which is beneficial to improving the comprehensiveness and rationality of the method for determining the satisfaction result of the valid request condition, and further beneficial to improving the accuracy and reliability of the determined satisfaction result of the valid request condition, thereby being beneficial to improving the execution accuracy and timeliness of the operations triggered based on the satisfaction result of the valid request condition.
[0168] Embodiment Three
[0169] Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of an intelligent request distribution device disclosed in an embodiment of the present invention. Among them, Figure 3 the described device may include an electronic device, and a client for accessing a network attached storage device may be installed on the electronic device, and the embodiments of the present invention are not limited thereto. As Figure 3 shown, the intelligent request distribution device may include:
[0170] A request determination module 301, configured to determine a target request corresponding to the target application, where the target request includes basic request parameters.
[0171] A credential setting module 302, configured to perform corresponding user credential setting operations according to the basic request parameters and the determined target storage area to obtain a user credential setting result.
[0172] A status determination module 303, configured to determine request status information according to the user credential setting result and the target application.
[0173] A judgment module 304, configured to judge whether the target application meets the preset valid request condition according to the request status information.
[0174] The first execution module 305 is configured to, when the determination module 304 determines that the target application meets the valid request condition, enter the corresponding response phase based on the preset response phase entry sequence scheme, and control the target application and / or the target interceptor to perform corresponding null processing operations.
[0175] The second execution module 306 is configured to, when the determination module 304 determines that the target application does not meet the valid request condition, control the target application and / or the target interceptor to perform corresponding error handling operations based on the preset error handling response phase.
[0176] It can be seen that implementing Figure 3 The described intelligent request distribution device can achieve unified request planning and management, which is beneficial to improving the accuracy and flexibility of request distribution, and further beneficial to improving the accuracy and reliability of request management, thus beneficial to improving the security and stability of application operation based on requests. In addition, it can also provide user credential setting and usage methods, which is beneficial to improving the pertinence, uniqueness, isolation and accuracy of the obtained user credential setting results, and further beneficial to improving the data isolation, usage security and controllability of user credential setting results, reducing the resource occupation space to a certain extent. In addition, matching corresponding response phase operations for different valid request condition satisfaction results respectively is beneficial to improving the execution pertinence, timeliness and accuracy of response phase operations.
[0177] In an optional embodiment, the manner in which the second execution module 306 controls the target application and / or the target interceptor to perform corresponding error handling operations based on the preset error handling response phase specifically includes:
[0178] Determine the first configuration and data information corresponding to the target application;
[0179] Perform corresponding data parsing operations on the first configuration and data information to obtain one or more target errors and their corresponding error information. The error information includes error types and / or specific error contents, and the error types include general error types or non-general error types;
[0180] According to each target error and its corresponding error information, control the target application and / or the target interceptor to perform error handling operations.
[0181] It can be seen that implementing Figure 3The described apparatus is also capable of providing specific operation modes for the error response handling phase, which is conducive to improving the comprehensiveness and rationality of the operation modes for the error response handling phase, and further conducive to improving the execution accuracy and reliability of the operations for the error response handling phase, thereby facilitating the improvement of the error handling accuracy, efficiency, and timeliness, and to a certain extent, facilitating the improvement of the operation effectiveness, stability, and security of the application.
[0182] In another alternative embodiment, the manner in which the second execution module 306 controls the target application and / or the target interceptor to perform error handling operations according to each target error and its corresponding error information specifically includes:
[0183] According to each target error and its corresponding error information, all target errors are divided into first target errors that meet the general error type and / or second target errors that meet the non-general error type;
[0184] For the first target errors, according to the preset general business custom error handling method, control the main application interceptor included in the target interceptor to perform corresponding general error handling operations on the first target errors;
[0185] For the second target errors, determine the target error handling object according to the error information, the target application, and / or the target interceptor corresponding to the second target errors; according to the preset non-general custom error handling method, control the target error handling object to perform corresponding non-general error handling operations on the second target errors.
[0186] It can be seen that implementing Figure 3 The described apparatus can also respectively match corresponding error handling methods for the first target errors of the general error type and the second target errors of the non-general error type, which is conducive to improving the comprehensiveness, pertinence, flexibility, and rationality of the error handling methods, and further conducive to improving the error handling accuracy, reliability, and efficiency.
[0187] In yet another alternative embodiment, the manner in which the first execution module 305 controls the target application and / or the target interceptor to perform corresponding null processing operations based on the preset response phase entry sequence scheme and its corresponding response phase specifically includes:
[0188] Based on the preset response phase entry sequence scheme and its corresponding response phase, determine the second configuration and data information corresponding to the target application, and perform corresponding data parsing operations on the second configuration and data information to obtain the private service to be processed;
[0189] According to the preset business custom processing method, control the target application to perform corresponding processing operations on the private service to be processed, and control the target interceptor to perform null processing operations.
[0190] It can be seen that implementing Figure 3 the described device can also provide specific operation modes for the conventional response stage, which is beneficial to improving the comprehensiveness and rationality of the operation modes for the conventional response stage, and further beneficial to improving the execution accuracy and reliability of the operations for the conventional response stage. Thus, it is beneficial to improve the operation accuracy, pertinence and effectiveness of the interceptor, reduce unnecessary resource waste, and improve the operation effectiveness, stability and security of the application.
[0191] In another optional embodiment, the manner in which the status determination module 303 determines the request status information according to the user credential setting result and the target application specifically includes:
[0192] Determine the modified application configuration information corresponding to the target application according to the user credential setting result;
[0193] Send the modified application configuration information to the target application, and based on the target application, perform corresponding request processing operations to obtain the request issued by the target;
[0194] Determine the request status information according to the request issued by the target.
[0195] It can be seen that implementing Figure 3 the described device can also provide a specific manner for determining the request status information, which is beneficial to improving the comprehensiveness and rationality of the manner for determining the request status information, and further beneficial to improving the pertinence, accuracy and reliability of the determined request status information, and beneficial to improving the relevance between the determined request status information and the user credential setting result and the target application.
[0196] In another optional embodiment, the manner in which the status determination module 303 performs corresponding request processing operations based on the target application to obtain the request issued by the target specifically includes:
[0197] According to the determined function configuration information of the target application, determine whether the target application meets the preset condition for calling the interceptor;
[0198] When it is determined that the target application meets the condition for calling the interceptor, determine the configured interceptor of the target application itself, and control to enter the corresponding request stage of the configured interceptor to perform corresponding processing operations to obtain the request issued by the target.
[0199] It can be seen that implementing Figure 3The described device is also capable of providing a specific method for determining a target outgoing request. When it is determined that the target application meets the conditions for invoking the interceptor, it controls the entry into the request stage corresponding to the configured interceptor to perform corresponding processing operations to obtain the target outgoing request, which is beneficial to improving the comprehensiveness, integrity, and rationality of the method for determining the target outgoing request, and thus beneficial to improving the accuracy and reliability of the determined target outgoing request. In addition, it is also beneficial to improving the timeliness, accuracy, and rationality of the execution of relevant request processing operations.
[0200] In yet another alternative embodiment, the manner in which the determination module 304 determines whether the target application meets the preset valid request conditions according to the request status information specifically includes:
[0201] Determine the request status code according to the request status information;
[0202] Determine whether the request status code matches the preset request status code threshold;
[0203] When it is determined that the request status code matches the request status code threshold, determine that the target application meets the preset valid request conditions;
[0204] When it is determined that the request status code does not match the request status code threshold, determine that the target application does not meet the preset valid request conditions.
[0205] It can be seen that implementing Figure 3 The described device can also determine the request status code according to the request status information, and then determine the result of meeting the valid request conditions based on the comparison between the request status code and the corresponding threshold, which is beneficial to improving the comprehensiveness and rationality of the method for determining the result of meeting the valid request conditions, and thus beneficial to improving the accuracy and reliability of the determined result of meeting the valid request conditions, and thereby beneficial to improving the execution accuracy and timeliness of the operations triggered based on the result of meeting the valid request conditions.
[0206] Embodiment 4
[0207] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of an electronic device disclosed in an embodiment of the present invention. Among them, Figure 4 The described electronic device may include a server, where the server includes a local server or a cloud server, which is not limited in the embodiments of the present invention. As Figure 4 shown, the electronic device may include:
[0208] A memory 401 storing executable program code;
[0209] A processor 402 coupled to the memory 401;
[0210] Further, it may further include an input interface 403 and an output interface 404 coupled to the processor 402;
[0211] Among them, the processor 402 calls the executable program code stored in the memory 401 to execute the steps in an intelligent request distribution method described in Embodiment 1 or Embodiment 2.
[0212] Embodiment 5
[0213] A network attached storage device, which is configured with a display screen and is used for interactive communication with an electronic device. Among them, the network attached storage device is used to perform data analysis and request distribution operations with a client that can access the network attached storage device installed on the electronic device through an intelligent request distribution method described in Embodiment 1 or Embodiment 2.
[0214] Optionally, the network attached storage device (such as NAS) proposed in this solution can store files or install a client by itself. Further, the foregoing functions can be operated through a touchable display screen, and the embodiments of the present invention do not make limitations.
[0215] Embodiment 6
[0216] An embodiment of the present invention discloses a computer storage medium that stores a computer program for electronic data exchange. Among them, the computer program enables a computer to execute the steps in an intelligent request distribution method described in Embodiment 1 or Embodiment 2.
[0217] Embodiment 7
[0218] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in an intelligent request distribution method described in Embodiment 1 or Embodiment 2.
[0219] Embodiment 8
[0220] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of an intelligent request distribution system disclosed in an embodiment of the present invention. Among them, the system includes an intelligent request distribution device described in Embodiment 3, and a network attached storage device communicatively connected to the device; or,
[0221] the system includes an electronic device described in Embodiment 4, and a network attached storage device communicatively connected to the electronic device.
[0222] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0223] Through the specific descriptions of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, and the storage medium includes read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc memories, magnetic disk memories, tape memories, or any other computer-readable medium that can be used to carry or store data.
[0224] Finally, it should be noted that: what is disclosed in an intelligent request distribution method, device and network attached storage device disclosed in the embodiments of the present invention is only the preferred embodiments of the present invention, only for explaining the technical solutions of the present invention, rather than limiting it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An intelligent request distribution method, which is applied to an electronic device, and a client capable of accessing a network attached storage device is installed on the electronic device, characterized in that The method includes: Determine a target request corresponding to a target application, where the target request includes basic request parameters; According to the basic request parameters and the determined target storage area, perform a corresponding user credential setting operation to obtain a user credential setting result; According to the user credential setting result and the target application, determine request status information; According to the request status information, determine whether the target application meets a preset valid request condition; When it is determined that the target application meets the valid request condition, based on a preset response phase entry sequence scheme and its corresponding response phase, control the target application and / or the target interceptor to perform corresponding null processing operations; When it is determined that the target application does not meet the valid request condition, based on a preset processing error response phase, control the target application and / or the target interceptor to perform corresponding error handling operations.
2. The intelligent request distribution method according to claim 1, wherein The controlling the target application and / or the target interceptor to perform corresponding null processing operations based on a preset response phase entry sequence scheme and its corresponding response phase includes: Based on a preset response phase entry sequence scheme and its corresponding response phase, determine second configuration and data information corresponding to the target application, and perform corresponding data parsing operations on the second configuration and data information to obtain a to-be-processed private service; According to a preset service custom processing method, control the target application to perform corresponding processing operations on the to-be-processed private service, and control the target interceptor to perform the null processing operation.
3. An intelligent request distribution method according to claim 1, characterized in that, The controlling the target application and / or the target interceptor to perform corresponding error handling operations based on a preset processing error response phase includes: Determine first configuration and data information corresponding to the target application; Perform corresponding data parsing operations on the first configuration and data information to obtain one or more target errors and their corresponding error information, where the error information includes an error type and / or specific error content, and the error type includes a general error type or a non-general error type; According to each target error and its corresponding error information, control the target application and / or the target interceptor to perform the error handling operation.
4. An intelligent request distribution method according to claim 3, characterized in that, The controlling the target application and / or the target interceptor to perform the error handling operation according to each target error and its corresponding error information includes: According to each target error and its corresponding error information, divide all the target errors into first target errors that meet the general error type and / or second target errors that meet the non-general error type; For the first target errors, according to a preset service general custom error handling method, control the main application interceptor included in the target interceptor to perform corresponding general error handling operations on the first target errors; For the second target error, determine a target error handling object according to the error information corresponding to the second target error, the target application, and / or the target interceptor; according to a preset non-general custom error handling method, control the target error handling object to perform corresponding non-general error handling operations on the second target error.
5. An intelligent request distribution method according to any one of claims 1-4, characterized in that, The determining the request status information according to the user credential setting result and the target application includes: Determine the modified application configuration information corresponding to the target application according to the user credential setting result; Send the modified application configuration information to the target application, and perform corresponding request processing operations based on the target application to obtain a target issued request; Determine the request status information according to the target issued request.
6. The intelligent request distribution method according to claim 5, characterized in that, The obtaining a target issued request by performing corresponding request processing operations based on the target application includes: Judge whether the target application meets a preset callable interceptor condition according to the determined function configuration information of the target application; When it is judged that the target application meets the callable interceptor condition, determine the configured interceptor of the target application itself, and control to enter the corresponding request stage of the configured interceptor to perform corresponding processing operations to obtain a target issued request.
7. An intelligent request distribution method according to claim 6, characterized in that, The judging whether the target application meets a preset valid request condition according to the request status information includes: Determine a request status code according to the request status information; Judge whether the request status code matches a preset request status code threshold; When it is judged that the request status code matches the request status code threshold, determine that the target application meets the preset valid request condition; When it is judged that the request status code does not match the request status code threshold, determine that the target application does not meet the preset valid request condition.
8. An intelligent request distribution device, characterized in that The device includes an electronic device, and a client for accessing a network attached storage device is installed on the electronic device. The device includes: A request determination module, configured to determine a target request corresponding to a target application, where the target request includes basic request parameters; A credential setting module, configured to perform corresponding user credential setting operations according to the basic request parameters and the determined target storage area to obtain a user credential setting result; A status determination module, configured to determine request status information according to the user credential setting result and the target application; A judgment module, configured to judge whether the target application meets a preset valid request condition according to the request status information; A first execution module, configured to, when the judgment module judges that the target application meets the valid request condition, control the target application and / or the target interceptor to perform corresponding null processing operations based on a preset response stage entry sequence scheme and its corresponding response stage; A second execution module, configured to, when the judgment module judges that the target application does not meet the valid request condition, control the target application and / or the target interceptor to perform corresponding error handling operations based on a preset error handling response stage.
9. A network attached storage device, characterized in that, The network attached storage device is configured with a display screen, and the network attached storage device is used for interactive communication with an electronic device. Among them, the network attached storage device is used to perform data analysis and request distribution operations with a client that can access the network attached storage device installed on the electronic device through an intelligent request distribution method as described in any one of claims 1-7.
10. An electronic device, characterized in that, The electronic device includes: A memory storing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory and executes an intelligent request distribution method as described in any one of claims 1-7.
11. A computer storage medium, characterized in that, The computer storage medium stores computer instructions that, when called, are used to execute an intelligent request distribution method as described in any one of claims 1-7.
12. An intelligent request distribution system, characterized in that, The system includes an intelligent request distribution device as described in claim 8 and a network attached storage device communicatively connected to the device; or, The system includes an electronic device as described in claim 10 and a network attached storage device communicatively connected to the electronic device.