Cache configuration method, device, electronic device, storage medium and program product

By analyzing service request messages, cache configuration parameters are automatically determined, which solves the problem of uncontrollable completion time of data tasks on the server side, and realizes automatic configuration of cache and controllable completion of data tasks.

CN113900970BActive Publication Date: 2024-10-18KOUBEI SHANGHAI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111181886.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-11
Publication Date
2024-10-18
Estimated Expiration
2041-10-11

AI Technical Summary

Technical Problem

When providing data services on the server side, the increase in IO operations and CPU calculations due to the complexity of the service makes the interface time-consuming and affects the user experience. Especially in tests or other data tasks with short time periods, it is difficult to have enough time to increase and Developing cache makes the completion time of data tasks uncontrollable and affects the degree of completion.

Method used

Automatically determine optional cache configuration parameters by analyzing service request messages, generate candidate cache configuration parameters, and sort and display them based on differences and evaluation values, realizing automatic addition and configuration of caches, reducing cache configuration time, and ensuring data task completion time controllability.

Benefits of technology

Effectively reduce cache configuration time, ensure the completion of data tasks, and achieve controllability of data task completion time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113900970B_ABST
    Figure CN113900970B_ABST
Patent Text Reader

Abstract

The disclosed embodiment discloses a cache configuration method, device, electronic device, storage medium and program product, wherein the cache configuration method comprises: receiving a request message for a target service interface sent by a service requester; generating and displaying candidate cache configuration parameters based on the request message; in response to receiving a cache configuration parameter selection command, obtaining a response result corresponding to the request message according to the cache configuration parameters corresponding to the cache configuration parameter selection command, and sending the response result to the service requester. This technical solution can effectively reduce the cache configuration time, thereby realizing the controllability of the data task completion time and ensuring the completion of the data task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of storage configuration, and in particular to a cache configuration method, device, electronic device, storage medium and program product. Background Art

[0002] Cache refers to a high-speed memory with faster access speed than general random access memory (RAM). It usually does not use DRAM technology like the system main memory, but uses expensive but faster SRAM technology. Therefore, it can be said that the cache setting is one of the important factors for the high-performance operation of the computer system. When the server provides data services through the service interface, due to the complexity of the service, a large number of IO operations and CPU calculations will be performed inside an interface, resulting in a relatively long interface time consumption, affecting the user experience. The common practice is to reduce the number of IO operations of the disk and network by increasing the cache, so as to perform CPU calculations in advance and directly cache the result data, thereby achieving the purpose of reducing the amount of CPU calculations when accessing the interface. However, in actual applications, for tests or other data tasks with a short time period, it is difficult to have sufficient time to increase and develop cache, which will lead to uncontrollable completion time of data tasks and seriously affect the completion of data tasks. Summary of the invention

[0003] Embodiments of the present disclosure provide a cache configuration method, device, electronic device, storage medium, and program product.

[0004] In a first aspect, a cache configuration method is provided in an embodiment of the present disclosure.

[0005] Specifically, the cache configuration method includes:

[0006] Receive a request message for a target service interface sent by a service requester;

[0007] Generate and display candidate cache configuration parameters based on the request message;

[0008] In response to receiving the cache configuration parameter selection command, a response result corresponding to the request message is acquired according to the cache configuration parameter corresponding to the cache configuration parameter selection command, and the response result is sent to the service requester.

[0009] In combination with the first aspect, in a first implementation of the first aspect of the present disclosure, generating and displaying candidate cache configuration parameters based on the request message includes:

[0010] Determine cache configuration parameters to generate a model;

[0011] Inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message;

[0012] The candidate cache configuration parameters are sorted and displayed.

[0013] In combination with the first aspect and the first implementation manner of the first aspect, in the second implementation manner of the first aspect of the embodiment of the present disclosure, the step of inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message includes:

[0014] Determining request parameters of the request message;

[0015] The request parameters of the request message are input into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message, wherein the cache configuration parameter generation model stores the correspondence between the request parameters and the candidate cache configuration parameters.

[0016] In combination with the first aspect, the first implementation of the first aspect, and the second implementation of the first aspect, the embodiment of the present disclosure, in a third implementation of the first aspect, further includes:

[0017] Generate cache configuration parameters to generate models.

[0018] In combination with the first aspect, the first implementation manner of the first aspect, the second implementation manner of the first aspect, and the third implementation manner of the first aspect, in a fourth implementation manner of the first aspect of the embodiment of the present disclosure, generating a cache configuration parameter generation model includes:

[0019] Obtaining historical request messages and corresponding historical response messages of the target service interface within a preset historical time period;

[0020] Writing a message pair consisting of the historical request message and the corresponding historical response message into a snapshot center;

[0021] Performing parameter field analysis on the snapshot of the message to obtain a parameter field analysis result, wherein the parameter field analysis result includes a parameter field attribute and an association relationship between a request message parameter field and a response message parameter field;

[0022] Modifying the parameters of the request message in the message snapshot based on the parameter field analysis result, and using the modified request message to simulate the request to obtain a simulated response message;

[0023] The difference between the simulated response message and the corresponding response message in the message pair snapshot is compared, and when the difference is lower than a preset threshold, the parameter combination in the modified request message is used as the candidate cache configuration parameter corresponding to the request message.

[0024] In combination with the first aspect, the first implementation manner of the first aspect, the second implementation manner of the first aspect, the third implementation manner of the first aspect, and the fourth implementation manner of the first aspect, in a fifth implementation manner of the first aspect of the embodiment of the present disclosure, the sorting and displaying of the candidate cache configuration parameters includes:

[0025] Calculating an evaluation value of the candidate cache configuration parameter based on the difference;

[0026] The candidate cache configuration parameters are sorted and displayed in descending order of evaluation values.

[0027] In combination with the first aspect, the first implementation manner of the first aspect, the second implementation manner of the first aspect, the third implementation manner of the first aspect, the fourth implementation manner of the first aspect, and the fifth implementation manner of the first aspect, in a sixth implementation manner of the first aspect of the embodiment of the present disclosure, after generating and displaying the candidate cache configuration parameters based on the request message, further includes:

[0028] Execute cache data acquisition using the candidate cache configuration parameters;

[0029] The display order of the candidate cache configuration parameters is modified based on the cache data acquisition result.

[0030] In combination with the first aspect, the first implementation of the first aspect, the second implementation of the first aspect, the third implementation of the first aspect, the fourth implementation of the first aspect, the fifth implementation of the first aspect, and the sixth implementation of the first aspect, the embodiment of the present disclosure, in a seventh implementation of the first aspect, further includes:

[0031] When the candidate cache configuration parameters meet preset conditions or a manual cache configuration command is received, a cache configuration parameter manual configuration interactive command is displayed, and cache data acquisition is performed according to the manually configured cache parameters.

[0032] In a second aspect, a cache configuration method is provided in an embodiment of the present disclosure.

[0033] Specifically, the cache configuration method includes:

[0034] A receiving module, configured to receive a request message for a target service interface sent by a service requester;

[0035] A first generating module is configured to generate and display candidate cache configuration parameters based on the request message;

[0036] The acquisition module is configured to, in response to receiving a cache configuration parameter selection command, acquire a response result corresponding to the request message according to the cache configuration parameters corresponding to the cache configuration parameter selection command, and send the response result to the service requester.

[0037] In combination with the second aspect, in a first implementation of the second aspect of the present disclosure, the first generating module is configured as follows:

[0038] Determine cache configuration parameters to generate a model;

[0039] Inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message;

[0040] The candidate cache configuration parameters are sorted and displayed.

[0041] In combination with the second aspect and the first implementation manner of the second aspect, in the second implementation manner of the second aspect of the embodiment of the present disclosure, the part of inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message is configured as follows:

[0042] Determining request parameters of the request message;

[0043] The request parameters of the request message are input into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message, wherein the cache configuration parameter generation model stores the correspondence between the request parameters and the candidate cache configuration parameters.

[0044] In combination with the second aspect, the first implementation of the second aspect, and the second implementation of the second aspect, the embodiment of the present disclosure, in a third implementation of the second aspect, further includes:

[0045] The second generation module is configured to generate a cache configuration parameter generation model.

[0046] In combination with the second aspect, the first implementation of the second aspect, the second implementation of the second aspect, and the third implementation of the second aspect, in a fourth implementation of the second aspect of the embodiment of the present disclosure, the second generating module is configured as follows:

[0047] Obtaining historical request messages and corresponding historical response messages of the target service interface within a preset historical time period;

[0048] Writing a message pair consisting of the historical request message and the corresponding historical response message into a snapshot center;

[0049] Performing parameter field analysis on the snapshot of the message to obtain a parameter field analysis result, wherein the parameter field analysis result includes a parameter field attribute and an association relationship between a request message parameter field and a response message parameter field;

[0050] Modifying the parameters of the request message in the message snapshot based on the parameter field analysis result, and using the modified request message to simulate the request to obtain a simulated response message;

[0051] The difference between the simulated response message and the corresponding response message in the message pair snapshot is compared, and when the difference is lower than a preset threshold, the parameter combination in the modified request message is used as the candidate cache configuration parameter corresponding to the request message.

[0052] In combination with the second aspect, the first implementation manner of the second aspect, the second implementation manner of the second aspect, the third implementation manner of the second aspect, and the fourth implementation manner of the second aspect, in a fifth implementation manner of the second aspect of the embodiment of the present disclosure, the part for sorting and displaying the candidate cache configuration parameters is configured as follows:

[0053] Calculating an evaluation value of the candidate cache configuration parameter based on the difference;

[0054] The candidate cache configuration parameters are sorted and displayed in descending order of evaluation values.

[0055] In combination with the first aspect, the first implementation manner of the first aspect, the second implementation manner of the first aspect, the third implementation manner of the first aspect, the fourth implementation manner of the first aspect, and the fifth implementation manner of the first aspect, in a sixth implementation manner of the first aspect of the embodiment of the present disclosure, after generating and displaying the candidate cache configuration parameters based on the request message, further includes:

[0056] The correction module is configured to perform cache data acquisition using the candidate cache configuration parameters, and to correct the display order of the candidate cache configuration parameters based on the cache data acquisition result.

[0057] In combination with the first aspect, the first implementation of the first aspect, the second implementation of the first aspect, the third implementation of the first aspect, the fourth implementation of the first aspect, the fifth implementation of the first aspect, and the sixth implementation of the first aspect, the embodiment of the present disclosure, in a seventh implementation of the first aspect, further includes:

[0058] The configuration module is configured to display a cache configuration parameter manual configuration interactive command when the candidate cache configuration parameter meets a preset condition or receives a manual cache configuration command, and execute cache data acquisition according to the manually configured cache parameter.

[0059] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and at least one processor, wherein the memory is used to store one or more computer instructions, and wherein the one or more computer instructions are executed by the at least one processor to implement the method steps of the above-mentioned cache configuration method.

[0060] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium for storing computer instructions used by a cache configuration device, which includes computer instructions involved in the cache configuration device for executing the above-mentioned cache configuration method.

[0061] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the method steps of the above-mentioned cache configuration method.

[0062] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0063] The above technical solution automatically determines the optional cache configuration parameters by analyzing the service request message, thereby realizing the automatic increase and configuration of the cache. This technical solution can effectively reduce the cache configuration time, thereby realizing the controllability of the data task completion time and ensuring the completion of the data task.

[0064] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0066] Figure 1 A flow chart showing a cache configuration method according to an embodiment of the present disclosure;

[0067] Figure 2 A structural block diagram of a cache configuration device according to an embodiment of the present disclosure is shown;

[0068] Figure 3 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0069] Figure 4 It is a structural diagram of a computer system suitable for implementing a cache configuration method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0070] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0071] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.

[0072] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0073] The technical solution provided by the embodiment of the present disclosure automatically determines the optional cache configuration parameters by analyzing the service request message, thereby realizing the automatic increase and configuration of the cache. The technical solution can effectively reduce the cache configuration time, thereby realizing the controllability of the data task completion time and ensuring the completion of the data task.

[0074] Figure 1 A flow chart of a cache configuration method according to an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the cache configuration method includes the following steps S101-S103:

[0075] In step S101, a request message for a target service interface sent by a service requester is received;

[0076] In step S102, candidate cache configuration parameters are generated based on the request message and displayed;

[0077] In step S103, in response to receiving the cache configuration parameter selection command, a response result corresponding to the request message is obtained according to the cache configuration parameters corresponding to the cache configuration parameter selection command, and the response result is sent to the service requester.

[0078] As mentioned above, cache refers to a high-speed memory with faster access speed than general random access memory (RAM). It usually does not use DRAM technology like the system main memory, but uses expensive but faster SRAM technology. Therefore, it can be said that the cache setting is one of the important factors for the high-performance operation of the computer system. When the server provides data services through the service interface, due to the complexity of the service, a large number of IO operations and CPU calculations will be performed inside an interface, resulting in a relatively long interface time consumption, affecting the user experience. The common practice is to reduce the number of IO operations of the disk and network by increasing the cache, so as to perform CPU calculations in advance and directly cache the result data, thereby achieving the purpose of reducing the amount of CPU calculations when accessing the interface. However, in actual applications, for tests or other data tasks with a short time period, it is difficult to have sufficient time to increase and develop cache, which will lead to uncontrollable completion time of data tasks and seriously affect the completion of data tasks.

[0079] In view of the above defects, in this embodiment, a cache configuration method is proposed, which automatically determines the optional cache configuration parameters by analyzing the service request message, thereby realizing the automatic increase and configuration of the cache. This technical solution can effectively reduce the cache configuration time, thereby realizing the controllability of the data task completion time and ensuring the completion of the data task.

[0080] In one embodiment of the present disclosure, the cache configuration method may be applicable to computers, electronic devices, servers, server clusters, etc. that perform cache configuration.

[0081] In one embodiment of the present disclosure, the service requester refers to a party that sends a request to a service interface to request to obtain corresponding request data. The service requester may be, for example, a user, a client, or the like.

[0082] In one embodiment of the present disclosure, the target service interface refers to the service interface through which the service requester sends the request.

[0083] In one embodiment of the present disclosure, the request message refers to the request data sent by the service requester to obtain the corresponding request data, wherein the request message may include one or more of the following parameters: target service interface identification information, user identification information such as user ID, user device identification information such as user device ID, user device operating system identification information, user device software version information, request-related store identification information such as store ID, request-related information such as data screening information. Among the above request message parameters, some parameters are mandatory and some parameters are optional. The distinction between mandatory parameters and optional parameters is related to the different requirements of different service interfaces.

[0084] In one embodiment of the present disclosure, the candidate cache configuration parameter refers to one or more cache configuration parameters determined according to the request message and selectable by the service requester. The cache configuration parameter may include one or more of the following parameters: cache engine identifier, cache expiration time, whether to perform cache control, whether to enable multi-level cache, whether to perform asynchronous loading, whether to perform asynchronous comparison, etc.

[0085] In the above implementation, after receiving a request message for a target service interface sent by a service requester, candidate cache configuration parameters are generated and displayed according to the request message. After receiving a user's selection command for a cache configuration parameter, a response result corresponding to the request message can be obtained according to the cache configuration parameters corresponding to the cache configuration parameter selection command, and the response result is sent to the service requester.

[0086] In an embodiment of the present disclosure, the step S102, i.e., the step of generating and displaying candidate cache configuration parameters based on the request message, may include the following steps:

[0087] Determine cache configuration parameters to generate a model;

[0088] Inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message;

[0089] The candidate cache configuration parameters are sorted and displayed.

[0090] In this embodiment, the obtained request message is input into a determined cache configuration parameter generation model, and the cache configuration parameter generation model is used to obtain one or more candidate cache configuration parameters corresponding to the request message, and the candidate cache configuration parameters are sorted and displayed, wherein the input of the cache configuration parameter generation model is the request message parameter, and the output is one or more candidate cache configuration parameters corresponding to the request message.

[0091] In an embodiment of the present disclosure, the step of inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message may include the following steps:

[0092] Determining request parameters of the request message;

[0093] The request parameters of the request message are input into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message, wherein the cache configuration parameter generation model stores the correspondence between the request parameters and the candidate cache configuration parameters.

[0094] As mentioned above, the input of the cache configuration parameter generation model is the request message parameter, and the output is one or more candidate cache configuration parameters corresponding to the request message. Therefore, in this embodiment, when using the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message, the request parameters carried by the request message are first determined, and then the request parameters of the request message are input into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message. It can be understood that the cache configuration parameter generation model stores the correspondence between the request parameters and the candidate cache configuration parameters.

[0095] In one embodiment of the present disclosure, the method may further include the following steps:

[0096] Generate cache configuration parameters to generate models.

[0097] In this implementation, in order to obtain one or more candidate cache configuration parameters corresponding to the request message using the cache configuration parameter generation model, the cache configuration parameter generation model needs to be generated in advance.

[0098] In an embodiment of the present disclosure, the step of generating a cache configuration parameter generation model may include the following steps:

[0099] Obtaining historical request messages and corresponding historical response messages of the target service interface within a preset historical time period;

[0100] Writing a message pair consisting of the historical request message and the corresponding historical response message into a snapshot center;

[0101] Performing parameter field analysis on the snapshot of the message to obtain a parameter field analysis result, wherein the parameter field analysis result includes a parameter field attribute and an association relationship between a request message parameter field and a response message parameter field;

[0102] Modifying the parameters of the request message in the message snapshot based on the parameter field analysis result, and using the modified request message to simulate the request to obtain a simulated response message;

[0103] The difference between the simulated response message and the corresponding response message in the message pair snapshot is compared, and when the difference is lower than a preset threshold, the parameter combination in the modified request message is used as the candidate cache configuration parameter corresponding to the request message.

[0104] In this embodiment, when generating the cache configuration parameter generation model, firstly, the historical request message of the target service interface within a preset historical time period and the historical response message corresponding to the historical request message are obtained. Then, the historical request message and the corresponding historical response message are composed of a message pair and written into the snapshot center, so that the message pair can be used to simulate the cache request later. Then, a parameter field analysis is performed on the message pair snapshot to obtain a parameter field analysis result, wherein the parameter field analysis result includes parameter field attributes, and the association relationship between the request message parameter field and the response message parameter field, that is, the parameter field analysis performed on the message pair snapshot may include parameter field attribute analysis, association relationship analysis between the request message parameter field and the response message parameter field, and the like, wherein the parameter field attribute analysis may include an analysis of the variability and necessity of the parameter field, the analysis of the variability of the parameter field refers to determining whether the parameter field is a constant, an enumeration or a variable, and the analysis of the necessity of the parameter field refers to determining whether the parameter field is a required parameter or an optional parameter; the analysis of the association relationship between the request message parameter field and the response message parameter field may include determining whether the association relationship between the parameter field in the request message and the parameter field in the response message is equality, association or irrelevance. Analysis, equality means that the parameter field in the request message and the parameter field in the response message are both within the range of the request message parameter field value list or the preset parameter field value list, association means that the parameter field value in the request message has a constraint and association relationship with the parameter field value in the response message, and irrelevance means that there is no association relationship between the parameter field value in the request message and the parameter field value in the response message; then based on the parameter field analysis result, the parameters of the request message in the message pair snapshot are modified, and the modified request message is used to simulate the request to obtain a simulated response message, wherein the modification of the parameters of the request message in the message pair snapshot based on the parameter field analysis result can be, for example: if it is determined that a certain parameter field is an optional parameter or the association relationship between the parameter field in the request message and the parameter field in the response message is irrelevant, the parameter field can be removed. Then, the difference between the simulated response message obtained by the simulated request and the corresponding response message in the message pair snapshot is compared. When the difference is lower than a preset threshold, the modified request message is considered to be credible. Therefore, the parameter combination in the modified request message can be displayed as a candidate cache configuration parameter corresponding to the request message for selection by the service requester. Conversely, if the difference between the simulated response message and the corresponding response message in the message pair snapshot is not lower than the preset threshold, the modified request message is considered to be uncredible, and the parameter combination in the modified request message cannot be displayed as a candidate cache configuration parameter corresponding to the request message.

[0105] In an embodiment of the present disclosure, the step of sorting and displaying the candidate cache configuration parameters may include the following steps:

[0106] Calculating an evaluation value of the candidate cache configuration parameter based on the difference;

[0107] The candidate cache configuration parameters are sorted and displayed in descending order of evaluation values.

[0108] In order to provide the service requester with the priority levels of candidate cache configuration parameters for selection, in this embodiment, the candidate cache configuration parameters are prioritized and displayed. Specifically, the evaluation values ​​of the candidate cache configuration parameters are first calculated based on the differences. For example, the evaluation values ​​of the candidate cache configuration parameters with small differences are higher, and the evaluation values ​​of the candidate cache configuration parameters with large differences are lower; then, the candidate cache configuration parameters are sorted and displayed in descending order of the evaluation values.

[0109] In an embodiment of the present disclosure, after the step of generating and displaying candidate cache configuration parameters based on the request message, the following steps may also be included:

[0110] Execute cache data acquisition using the candidate cache configuration parameters;

[0111] The display order of the candidate cache configuration parameters is modified based on the cache data acquisition result.

[0112] In this embodiment, in order to further correct the candidate cache configuration parameters, the display order of the candidate cache configuration parameters is also adjusted based on the cache data acquisition results obtained by performing cache data acquisition using the candidate cache configuration parameters. When adjusting the display order of the candidate cache configuration parameters, the metadata module is used to evaluate the hit rate and consistency of the cache data acquisition results. The hit rate refers to an index used to determine whether the cache configuration parameters are valid, such as determining whether the required cache configuration parameters can exist, etc.; the consistency refers to an index used to determine whether the cache data acquisition results are consistent with the results obtained by requesting data according to the original request message. If the hit rate and consistency are both higher than the preset threshold, it means that the candidate cache configuration parameters are valid and their current evaluation values ​​can be retained. Otherwise, it means that the candidate cache configuration parameters have validity defects and their current evaluation values ​​can be lowered.

[0113] In one embodiment of the present disclosure, the method may further include the following steps:

[0114] When the candidate cache configuration parameters meet preset conditions or a manual cache configuration command is received, a cache configuration parameter manual configuration interactive command is displayed, and cache data acquisition is performed according to the manually configured cache parameters.

[0115] In this implementation, if the candidate cache configuration parameters meet the preset conditions or a manual cache configuration command is received, a cache configuration parameter manual configuration interactive command can be displayed for the service requester to select, and then cache data acquisition is performed according to the received manually configured cache parameters, and the final response result is returned. The preset conditions may be, for example, that the hit rate and consistency are lower than a preset threshold, etc.

[0116] The following are embodiments of the apparatus of the present disclosure, which can be used to execute embodiments of the method of the present disclosure.

[0117] Figure 2 FIG. 1 shows a structural block diagram of a cache configuration device according to an embodiment of the present disclosure. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 2 As shown, the cache configuration device includes:

[0118] The receiving module 201 is configured to receive a request message for a target service interface sent by a service requester;

[0119] A first generating module 202, configured to generate and display candidate cache configuration parameters based on the request message;

[0120] The acquisition module 203 is configured to, in response to receiving a cache configuration parameter selection command, acquire a response result corresponding to the request message according to the cache configuration parameters corresponding to the cache configuration parameter selection command, and send the response result to the service requester.

[0121] As mentioned above, cache refers to a high-speed memory with faster access speed than general random access memory (RAM). It usually does not use DRAM technology like the system main memory, but uses expensive but faster SRAM technology. Therefore, it can be said that the cache setting is one of the important factors for the high-performance operation of the computer system. When the server provides data services through the service interface, due to the complexity of the service, a large number of IO operations and CPU calculations will be performed inside an interface, resulting in a relatively long interface time consumption, affecting the user experience. The common practice is to reduce the number of IO operations of the disk and network by increasing the cache, so as to perform CPU calculations in advance and directly cache the result data, thereby achieving the purpose of reducing the amount of CPU calculations when accessing the interface. However, in actual applications, for tests or other data tasks with a short time period, it is difficult to have sufficient time to increase and develop cache, which will lead to uncontrollable completion time of data tasks and seriously affect the completion of data tasks.

[0122] In view of the above defects, in this embodiment, a cache configuration device is proposed, which automatically determines the optional cache configuration parameters by analyzing the service request message, thereby realizing automatic increase and configuration of the cache. This technical solution can effectively reduce the cache configuration time, thereby realizing the controllability of the data task completion time and ensuring the completion of the data task.

[0123] In one embodiment of the present disclosure, the cache configuration device may be implemented as a computer, electronic device, server, server cluster, etc. that performs cache configuration.

[0124] In one embodiment of the present disclosure, the service requester refers to a party that sends a request to a service interface to request to obtain corresponding request data. The service requester may be, for example, a user, a client, or the like.

[0125] In one embodiment of the present disclosure, the target service interface refers to the service interface through which the service requester sends the request.

[0126] In one embodiment of the present disclosure, the request message refers to the request data sent by the service requester to obtain the corresponding request data, wherein the request message may include one or more of the following parameters: target service interface identification information, user identification information such as user ID, user device identification information such as user device ID, user device operating system identification information, user device software version information, request-related store identification information such as store ID, request-related information such as data screening information. Among the above request message parameters, some parameters are mandatory and some parameters are optional. The distinction between mandatory parameters and optional parameters is related to the different requirements of different service interfaces.

[0127] In one embodiment of the present disclosure, the candidate cache configuration parameter refers to one or more cache configuration parameters determined according to the request message and selectable by the service requester. The cache configuration parameter may include one or more of the following parameters: cache engine identifier, cache expiration time, whether to perform cache control, whether to enable multi-level cache, whether to perform asynchronous loading, whether to perform asynchronous comparison, etc.

[0128] In the above implementation, after receiving a request message for a target service interface sent by a service requester, candidate cache configuration parameters are generated and displayed according to the request message. After receiving a user's selection command for a cache configuration parameter, a response result corresponding to the request message can be obtained according to the cache configuration parameters corresponding to the cache configuration parameter selection command, and the response result is sent to the service requester.

[0129] In one embodiment of the present disclosure, the first generating module 202 is configured as follows:

[0130] Determine cache configuration parameters to generate a model;

[0131] Inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message;

[0132] The candidate cache configuration parameters are sorted and displayed.

[0133] In this embodiment, the obtained request message is input into a determined cache configuration parameter generation model, and the cache configuration parameter generation model is used to obtain one or more candidate cache configuration parameters corresponding to the request message, and the candidate cache configuration parameters are sorted and displayed, wherein the input of the cache configuration parameter generation model is the request message parameter, and the output is one or more candidate cache configuration parameters corresponding to the request message.

[0134] In an embodiment of the present disclosure, the part of inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message may be configured as follows:

[0135] Determining request parameters of the request message;

[0136] The request parameters of the request message are input into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message, wherein the cache configuration parameter generation model stores the correspondence between the request parameters and the candidate cache configuration parameters.

[0137] As mentioned above, the input of the cache configuration parameter generation model is the request message parameter, and the output is one or more candidate cache configuration parameters corresponding to the request message. Therefore, in this embodiment, when using the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message, the request parameters carried by the request message are first determined, and then the request parameters of the request message are input into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message. It can be understood that the cache configuration parameter generation model stores the correspondence between the request parameters and the candidate cache configuration parameters.

[0138] In one embodiment of the present disclosure, the device may further include:

[0139] The second generation module is configured to generate a cache configuration parameter generation model.

[0140] In this implementation, in order to obtain one or more candidate cache configuration parameters corresponding to the request message using the cache configuration parameter generation model, the cache configuration parameter generation model needs to be generated in advance.

[0141] In one embodiment of the present disclosure, the second generation module may be configured as follows:

[0142] Obtaining historical request messages and corresponding historical response messages of the target service interface within a preset historical time period;

[0143] Writing a message pair consisting of the historical request message and the corresponding historical response message into a snapshot center;

[0144] Performing parameter field analysis on the snapshot of the message to obtain a parameter field analysis result, wherein the parameter field analysis result includes a parameter field attribute and an association relationship between a request message parameter field and a response message parameter field;

[0145] Modifying the parameters of the request message in the message snapshot based on the parameter field analysis result, and using the modified request message to simulate the request to obtain a simulated response message;

[0146] The difference between the simulated response message and the corresponding response message in the message pair snapshot is compared, and when the difference is lower than a preset threshold, the parameter combination in the modified request message is used as the candidate cache configuration parameter corresponding to the request message.

[0147] In this embodiment, when generating the cache configuration parameter generation model, firstly, the historical request message of the target service interface within a preset historical time period and the historical response message corresponding to the historical request message are obtained. Then, the historical request message and the corresponding historical response message are composed of a message pair and written into the snapshot center, so that the message pair can be used to simulate the cache request later. Then, a parameter field analysis is performed on the message pair snapshot to obtain a parameter field analysis result, wherein the parameter field analysis result includes parameter field attributes, and the association relationship between the request message parameter field and the response message parameter field, that is, the parameter field analysis performed on the message pair snapshot may include parameter field attribute analysis, association relationship analysis between the request message parameter field and the response message parameter field, and the like, wherein the parameter field attribute analysis may include an analysis of the variability and necessity of the parameter field, the analysis of the variability of the parameter field refers to determining whether the parameter field is a constant, an enumeration or a variable, and the analysis of the necessity of the parameter field refers to determining whether the parameter field is a required parameter or an optional parameter; the analysis of the association relationship between the request message parameter field and the response message parameter field may include determining whether the association relationship between the parameter field in the request message and the parameter field in the response message is equality, association or irrelevance. Analysis, equality means that the parameter field in the request message and the parameter field in the response message are both within the range of the request message parameter field value list or the preset parameter field value list, association means that the parameter field value in the request message has a constraint and association relationship with the parameter field value in the response message, and irrelevance means that there is no association relationship between the parameter field value in the request message and the parameter field value in the response message; then based on the parameter field analysis result, the parameters of the request message in the message pair snapshot are modified, and the modified request message is used to simulate the request to obtain a simulated response message, wherein the modification of the parameters of the request message in the message pair snapshot based on the parameter field analysis result can be, for example: if it is determined that a certain parameter field is an optional parameter or the association relationship between the parameter field in the request message and the parameter field in the response message is irrelevant, the parameter field can be removed. Then, the difference between the simulated response message obtained by the simulated request and the corresponding response message in the message pair snapshot is compared. When the difference is lower than a preset threshold, the modified request message is considered to be credible. Therefore, the parameter combination in the modified request message can be displayed as a candidate cache configuration parameter corresponding to the request message for selection by the service requester. Conversely, if the difference between the simulated response message and the corresponding response message in the message pair snapshot is not lower than the preset threshold, the modified request message is considered to be uncredible, and the parameter combination in the modified request message cannot be displayed as a candidate cache configuration parameter corresponding to the request message.

[0148] In an embodiment of the present disclosure, the part for sorting and displaying the candidate cache configuration parameters may be configured as follows:

[0149] Calculating an evaluation value of the candidate cache configuration parameter based on the difference;

[0150] The candidate cache configuration parameters are sorted and displayed in descending order of evaluation values.

[0151] In order to provide the service requester with the priority levels of candidate cache configuration parameters for selection, in this embodiment, the candidate cache configuration parameters are prioritized and displayed. Specifically, the evaluation values ​​of the candidate cache configuration parameters are first calculated based on the differences. For example, the evaluation values ​​of the candidate cache configuration parameters with small differences are higher, and the evaluation values ​​of the candidate cache configuration parameters with large differences are lower; then, the candidate cache configuration parameters are sorted and displayed in descending order of the evaluation values.

[0152] In an embodiment of the present disclosure, after generating and displaying the candidate cache configuration parameters based on the request message, the method further includes:

[0153] The correction module is configured to perform cache data acquisition using the candidate cache configuration parameters, and to correct the display order of the candidate cache configuration parameters based on the cache data acquisition result.

[0154] In this embodiment, in order to further correct the candidate cache configuration parameters, the display order of the candidate cache configuration parameters is also adjusted based on the cache data acquisition results obtained by performing cache data acquisition using the candidate cache configuration parameters. When adjusting the display order of the candidate cache configuration parameters, the metadata module is used to evaluate the hit rate and consistency of the cache data acquisition results. The hit rate refers to an index used to determine whether the cache configuration parameters are valid, such as determining whether the required cache configuration parameters can exist, etc.; the consistency refers to an index used to determine whether the cache data acquisition results are consistent with the results obtained by requesting data according to the original request message. If the hit rate and consistency are both higher than the preset threshold, it means that the candidate cache configuration parameters are valid and their current evaluation values ​​can be retained. Otherwise, it means that the candidate cache configuration parameters have validity defects and their current evaluation values ​​can be lowered.

[0155] In one embodiment of the present disclosure, the device may further include:

[0156] The configuration module is configured to display a cache configuration parameter manual configuration interactive command when the candidate cache configuration parameter meets a preset condition or receives a manual cache configuration command, and execute cache data acquisition according to the manually configured cache parameter.

[0157] In this implementation, if the candidate cache configuration parameters meet the preset conditions or a manual cache configuration command is received, a cache configuration parameter manual configuration interactive command can be displayed for the service requester to select, and then cache data acquisition is performed according to the received manually configured cache parameters, and the final response result is returned. The preset conditions may be, for example, that the hit rate and consistency are lower than a preset threshold, etc.

[0158] The present disclosure also discloses an electronic device, Figure 3 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Figure 3 As shown, the electronic device 300 includes a memory 301 and a processor 302; wherein,

[0159] The memory 301 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 302 to implement the above method steps.

[0160] Figure 4 It is a structural diagram of a computer system suitable for implementing a cache configuration method according to an embodiment of the present disclosure.

[0161] like Figure 4 As shown, the computer system 400 includes a processing unit 401, which can perform various processes in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage part 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the system 400 are also stored. The processing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0162] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. The drive 410 is also connected to the I / O interface 405 as needed. Removable media 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive 410 as needed, so that the computer program read therefrom is installed into the storage section 408 as needed. Among them, the processing unit 401 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.

[0163] In particular, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, and the computer program includes a program code for executing the data inspection method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from a removable medium 411.

[0164] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the road map or block diagram can represent a part of a module, program segment or code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0165] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0166] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the device described in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.

[0167] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A cache configuration method, comprising: Receive a request message for a target service interface sent by a service requester; Generate and display candidate cache configuration parameters based on the request message; including: determining a cache configuration parameter generation model; inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message; wherein, inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message includes: determining request parameters of the request message; inputting the request parameters of the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message, wherein the cache configuration parameter generation model stores the correspondence between the request parameters and the candidate cache configuration parameters; In response to receiving a cache configuration parameter selection command, acquiring a response result corresponding to the request message according to the cache configuration parameter corresponding to the cache configuration parameter selection command, and sending the response result to the service requester; Wherein, the method also includes: generating a cache configuration parameter generation model; the generating the cache configuration parameter generation model includes: obtaining the historical request message and the corresponding historical response message of the target service interface within a preset historical time period; writing the message pair composed of the historical request message and the corresponding historical response message into a snapshot center; performing parameter field analysis on the message pair snapshot to obtain the parameter field analysis result, wherein the parameter field analysis result includes the parameter field attributes, the association relationship between the request message parameter field and the response message parameter field; modifying the parameters of the request message in the message pair snapshot based on the parameter field analysis result, and using the modified request message to simulate the request to obtain a simulated response message; comparing the difference between the simulated response message and the corresponding response message in the message pair snapshot, and when the difference is lower than a preset threshold, using the parameter combination in the modified request message as the candidate cache configuration parameter corresponding to the request message.

2. According to the method of claim 1, generating and displaying candidate cache configuration parameters based on the request message comprises: The candidate cache configuration parameters are sorted and displayed.

3. The method according to claim 1, wherein the candidate cache configuration parameters are sorted and displayed, comprising: Calculating an evaluation value of the candidate cache configuration parameter based on the difference; The candidate cache configuration parameters are sorted and displayed in descending order of evaluation values.

4. The method according to any one of claims 1 to 3, after generating and displaying candidate cache configuration parameters based on the request message, further comprising: Execute cache data acquisition using the candidate cache configuration parameters; The display order of the candidate cache configuration parameters is modified based on the cache data acquisition result.

5. The method according to any one of claims 1 to 3, further comprising: When the candidate cache configuration parameters meet preset conditions or a manual cache configuration command is received, a cache configuration parameter manual configuration interactive command is displayed, and cache data acquisition is performed according to the manually configured cache parameters.

6. A cache configuration device, comprising: A receiving module, configured to receive a request message for a target service interface sent by a service requester; comprising: determining a cache configuration parameter generation model; inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message; wherein, inputting the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message comprises: determining request parameters of the request message; inputting the request parameters of the request message into the cache configuration parameter generation model to obtain one or more candidate cache configuration parameters corresponding to the request message, wherein the cache configuration parameter generation model stores a correspondence between request parameters and candidate cache configuration parameters; A first generating module is configured to generate and display candidate cache configuration parameters based on the request message; an acquisition module, configured to, in response to receiving a cache configuration parameter selection command, acquire a response result corresponding to the request message according to the cache configuration parameter corresponding to the cache configuration parameter selection command, and send the response result to the service requester; The device also includes: a second generation module, configured to generate a cache configuration parameter generation model; including: obtaining historical request messages and corresponding historical response messages of the target service interface within a preset historical time period; writing the historical request messages and corresponding historical response messages into a message pair and into a snapshot center; performing parameter field analysis on the message pair snapshot to obtain a parameter field analysis result, wherein the parameter field analysis result includes a parameter field attribute, an association relationship between the request message parameter field and the response message parameter field; modifying the parameters of the request message in the message pair snapshot based on the parameter field analysis result, and using the modified request message to simulate a request to obtain a simulated response message; comparing the difference between the simulated response message and the corresponding response message in the message pair snapshot, and when the difference is lower than a preset threshold, using the parameter combination in the modified request message as a candidate cache configuration parameter corresponding to the request message.

7. The apparatus according to claim 6, wherein the first generating module is configured to: The candidate cache configuration parameters are sorted and displayed.

8. The apparatus according to claim 6, wherein the portion for sorting and displaying the candidate cache configuration parameters is configured as follows: Calculating an evaluation value of the candidate cache configuration parameter based on the difference; The candidate cache configuration parameters are sorted and displayed in descending order of evaluation values.

9. The apparatus according to any one of claims 6 to 8, after generating and displaying candidate cache configuration parameters based on the request message, further comprising: The correction module is configured to perform cache data acquisition using the candidate cache configuration parameters, and to correct the display order of the candidate cache configuration parameters based on the cache data acquisition result.

10. The device according to any one of claims 6 to 8, further comprising: The configuration module is configured to display a cache configuration parameter manual configuration interactive command when the candidate cache configuration parameter meets a preset condition or receives a manual cache configuration command, and execute cache data acquisition according to the manually configured cache parameter.

11. An electronic device comprising a memory and at least one processor; wherein: The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the at least one processor to implement the method steps described in any one of claims 1-5.

12. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the method steps described in any one of claims 1 to 5.

13. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Cache method and cache device

    CN103067467A

  • Electric power internal and external network information interaction method based on cache database

    CN113285961A