Caching methods and apparatuses, electronic devices and storage media for microservice systems
By storing target instructions and access parameters in the instruction cache of the microservice module, data can be retrieved directly from the storage system, solving the service time problem caused by cross-system calls in the microservice framework and improving system efficiency and data accuracy.
Patent Information
- Application Number
- CN202111517976.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2041-12-13
AI Technical Summary
In a microservices framework, cross-system calls can lead to longer service times, impacting system efficiency.
By storing target instructions and access parameters in the instruction cache of the microservice module, target data can be retrieved directly from the storage system, reducing multi-level calls.
It effectively reduces the service time of microservice systems and improves the service efficiency of the system and the timeliness and accuracy of data.
Smart Images

Figure CN114201315B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to computer technology, and in particular to a caching method and apparatus, electronic device and storage medium for a microservice system. Background Technology
[0002] As information systems become increasingly feature-rich, a single system can no longer support all functionalities. A common solution is to group independent functional modules into subsystems, which then communicate with each other via RPC (Remote Procedure Call) to achieve decoupling. In particular, the microservice architecture framework, popular in recent years, has pushed this approach to its extreme, where each functional point can potentially become a small API (Application Programming Interface) service module. In this context, each API call may involve several layers or even dozens of service modules working together to complete the service, making cross-system calls a major cause of service latency.
[0003] Therefore, how to reduce the service latency caused by cross-system calls under a microservice framework in order to improve the service efficiency under the microservice framework is an urgent problem to be solved. Summary of the Invention
[0004] This disclosure provides a caching method, apparatus, electronic device, and storage medium for a microservice system to implement instruction caching, which can effectively reduce the service time of the microservice system and help improve the service efficiency of the microservice system.
[0005] In one aspect of this disclosure, a caching method for a microservice system is provided, the microservice system including a first microservice module and a second microservice module, the method being applied to the first microservice module, the method comprising:
[0006] In response to the need to obtain target data, determine whether there is a target instruction matching the target data in the instruction cache of the first microservice module;
[0007] If the target instruction exists in the instruction cache, the access parameters corresponding to the target instruction are obtained from the instruction cache; wherein, the access parameters include the access address;
[0008] Access the storage system based on the access parameters, and retrieve the target data from the storage system using the target instruction.
[0009] In one aspect of this disclosure, a caching device for a microservice system is provided. The microservice system includes a first microservice module and a second microservice module. The device is disposed in the first microservice module, and the device includes:
[0010] The first determining module is used to determine whether there is a target instruction matching the target data in the instruction cache area of the first microservice module in response to the need to obtain target data.
[0011] The first acquisition module is configured to, based on the determination result of the first determining module, if the target instruction exists in the instruction cache, acquire access parameters corresponding to the target instruction from the instruction cache; wherein, the access parameters include an access address;
[0012] The second acquisition module is used to access the storage system based on the access parameters and to acquire the target data from the storage system using the target instruction.
[0013] In another aspect of this disclosure, an electronic device is provided, comprising:
[0014] Memory, used to store computer programs;
[0015] A processor is configured to execute a computer program stored in the memory, wherein when the computer program is executed, it implements the caching method of the microservice system described in any of the above embodiments of the present disclosure.
[0016] In another aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the caching method of the microservice system described in any of the above embodiments of the present disclosure.
[0017] In another aspect of the present disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the caching method of the microservice system described in any of the above embodiments of the present disclosure.
[0018] Based on the caching method, apparatus, electronic device, and storage medium of the microservice system provided in the above embodiments of this disclosure, for a first microservice module and a second microservice module located in the microservice system, when the first microservice module needs to obtain target data from the storage system, it is first determined whether there is a target instruction matching the target data in the instruction cache of the first microservice module. If the target instruction exists in the instruction cache, the access parameters corresponding to the target instruction are obtained from the instruction cache. The access parameters include the access address. Then, the storage system is accessed using the access parameters, and the target data is obtained from the storage system using the target instruction. Thus, instruction caching of the microservice system is realized. The first microservice module can directly obtain the target data from the storage system using the target instruction and access parameters in the instruction cache. Compared to obtaining the target data through multi-level calls, this effectively reduces the service time of the microservice system and helps improve the service efficiency of the microservice system. Furthermore, when the first microservice module needs target data, it can obtain the current target data from the storage system using the target instruction and access parameters. Compared to caching the target data, obtaining the cached target data from the data cache helps improve the timeliness and accuracy of the data.
[0019] The technical solutions of this disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0020] The accompanying drawings, which form part of this specification, illustrate embodiments of this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0021] This disclosure will become clearer with reference to the accompanying drawings and the following detailed description, wherein:
[0022] Figure 1 This is a flowchart of one embodiment of the caching method for the microservice system disclosed herein.
[0023] Figure 2 This is a flowchart of another embodiment of the caching method for the microservice system disclosed herein.
[0024] Figure 3 This is a schematic diagram of the proxy layer in the caching method of the microservice system disclosed herein.
[0025] Figure 4 This is a schematic diagram of the pre-defined class library in the caching method of the microservice system disclosed herein.
[0026] Figure 5 This is a schematic diagram illustrating the interaction between the first microservice module and the second microservice module disclosed herein.
[0027] Figure 6 This is a schematic diagram of the structure of a caching device for a microservice system disclosed herein.
[0028] Figure 7 This is a schematic diagram of another embodiment of the caching device for the microservice system disclosed herein.
[0029] Figure 8 This is a schematic diagram of the structure of an application embodiment of the electronic device disclosed herein. Detailed Implementation
[0030] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.
[0031] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of this disclosure are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.
[0032] It should also be understood that in the embodiments disclosed herein, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.
[0033] It should also be understood that any component, data or structure mentioned in the embodiments of this disclosure can generally be understood as one or more unless expressly defined or given to the contrary in the context.
[0034] Furthermore, the term "and / or" in this disclosure is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this disclosure generally indicates that the preceding and following related objects have an "or" relationship.
[0035] It should also be understood that the description of the various embodiments in this disclosure emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.
[0036] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0037] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.
[0038] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0039] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0040] The embodiments disclosed herein can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems, etc.
[0041] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.
[0042] Figure 1 This is a flowchart illustrating one embodiment of the caching method for the microservice system disclosed herein. Figure 1 As shown, the method of this embodiment can be applied to the first microservice module in a microservice system, including:
[0043] Step 102: In response to the first microservice module needing to obtain target data from the storage system, determine whether there is a target instruction matching the target data in the instruction cache of the first microservice module.
[0044] In this embodiment of the disclosure, the microservice system may include a first microservice module and a second microservice module, and may also include other microservice modules. The storage system of the microservice system may be a caching system, a centralized storage system, or a distributed storage system. This embodiment of the disclosure does not specifically limit the number of microservice modules included in the microservice system or the type of storage system. The microservice module in this embodiment of the disclosure may also be referred to as a microservice subsystem.
[0045] In this embodiment of the disclosure, the microservice modules in the microservice system can transmit various types of information such as data, instructions, files, and images to each other. During any information transmission process, the microservice module that initiates the information transmission request can be called the upstream microservice module (also called the client, or client microservice module), and the microservice module that responds to the information transmission request can be called the downstream microservice module (also called the server, or server microservice module). The first microservice module in step 102 can be any upstream microservice module in the microservice system, and the second microservice module can be any downstream microservice module in the microservice system.
[0046] In this embodiment of the disclosure, each microservice module in the microservice system may support only data caching, only instruction caching, or both. Specifically, the data cache can store various types of data such as database data, text data, and image data in the data cache area. The instruction cache can store instructions (also called operation instructions) and corresponding access parameters in the instruction cache area. Here, instructions can be various types of instructions such as database operation instructions, text operation instructions, and image operation instructions, and the corresponding access parameters can be various types of access parameters such as database access parameters, text access parameters, and image access parameters.
[0047] In this embodiment of the disclosure, when the first microservice module needs to obtain target data from the storage system, it can first determine whether there is a target instruction matching the target data in the instruction cache of the first microservice module. The target data here can be any of the various types of data in the storage system, such as database data, text data, and image data. The target instruction matching the target data is the instruction used to obtain the target data from the storage system.
[0048] Step 104: If the target instruction exists in the instruction cache, retrieve the access parameters corresponding to the target instruction from the instruction cache.
[0049] In this embodiment, the target instruction and the corresponding access parameters in the instruction cache of the first microservice module can be received from the second microservice module and cached in the instruction cache before the target data is acquired. It should be noted that the access parameters corresponding to the target instruction may include an access address and / or an access key. The access address may include the device IP address (Internet Protocol Address) of the storage system. If the target data is database data, the access address may also include the database port number. The access key may include the username and password for accessing the storage system.
[0050] In step 104, if the determination result of step 102 indicates that the target instruction exists in the instruction cache of the first microservice module, the access parameters corresponding to the target instruction can be obtained from the instruction cache, and then the data can be obtained from the storage system using the target instruction and the access parameters.
[0051] Step 106: Access the storage system based on the access parameters, and retrieve the target data from the storage system using the target instructions.
[0052] In this embodiment, the storage system can be a distributed key-value (KV) system. The data storage medium can be a finite set such as a database (db), Redis (Remote Dictionary Service), or a distributed caching system (MemCache). Regardless of which microservice module in the microservice system executes the target instruction to retrieve the target data from the storage system, the retrieved target data will be the same. Therefore, the target instruction can be passed to the first microservice module, which will then execute the instruction to retrieve the same value, thus reducing the number of call layers.
[0053] Based on the target instruction and access parameters obtained in step 104 above, in step 106, the first microservice module can access the storage system based on the access parameters and use the target instruction to obtain the target data from the storage system.
[0054] As an example, the target data can be student name data C, which can be stored in student grade table B in database A of a storage system. The storage system is located on device D. The target instruction, i.e., the instruction used to retrieve the target data from the storage system, is "SELECT C FROM B". The access address in the access parameters can include the IP address of device D where the storage system is located and the port number of data A. The first microservice module can access database A in device D based on the access address and use the target instruction "SELECT C FROM B" to retrieve student name data C from student information table B in database A.
[0055] Based on the microservice system caching method provided in the above embodiments of this disclosure, for a first microservice module and a second microservice module located in the microservice system, when the first microservice module needs to obtain target data from the storage system, it first determines whether there is a target instruction matching the target data in the instruction cache of the first microservice module. If the target instruction exists in the instruction cache, the access parameters corresponding to the target instruction are obtained from the instruction cache. These access parameters include an access address. Then, the access parameters are used to access the storage system, and the target data is obtained from the storage system using the target instruction. Thus, instruction caching of the microservice system is realized. The first microservice module can directly obtain the target data from the storage system using the target instruction and access parameters in the instruction cache. Compared to obtaining the target data by calling the second microservice module, this effectively reduces the service time of the microservice system and helps improve the service efficiency of the microservice system. Furthermore, when the first microservice module needs target data, it can obtain the current target data from the storage system using the target instruction and access parameters. Compared to caching the target data, obtaining the cached target data from the data cache helps improve the timeliness and accuracy of the data.
[0056] Optionally, in some possible implementations of this disclosure, the first microservice module can receive a third acquisition request sent by the third microservice module for obtaining target data. In response to the third microservice module belonging to a microservice system, the first microservice module can determine whether the third microservice module supports instruction caching based on the third switch parameters included in the third acquisition request. In response to the third microservice module not supporting instruction caching, the first microservice module can send the target data to the third microservice module. In response to the third microservice module supporting instruction caching, the first microservice module can send the target instruction and access parameters to the third microservice module, so that the third microservice module can obtain the target data based on the target instruction and access parameters.
[0057] In this embodiment of the disclosure, the first microservice module can transmit the target instructions and access parameters returned by the second microservice module to the upstream microservice module, so that the upstream microservice module can also obtain the target data from the storage system based on the target instructions and access parameters, which helps to reduce the load of the overall system.
[0058] In this embodiment of the disclosure, the first microservice module can receive a third acquisition request sent by the third microservice module for acquiring target data. Here, the third microservice module can be any microservice module in the microservice system other than the first microservice module and the second microservice module, or any microservice module in a microservice system other than the microservice system.
[0059] In this embodiment, the third acquisition request sent by the third microservice module includes a third switch parameter for identifying whether the third microservice module supports instruction caching. When the third microservice module belongs to a microservice system, the first microservice module can determine whether the third microservice module supports instruction caching based on the third switch parameter. If the third microservice module does not support instruction caching, the first microservice module can send the target data to the third microservice module; if the third microservice module supports instruction caching, the first microservice module can send the target instruction and access parameters to the third microservice module, so that the third microservice module can acquire the target data based on the target instruction and access parameters.
[0060] It should be noted that when the first microservice module sends target data to the third microservice module, it can send the target data obtained from its own data cache to the third microservice module, or it can send the latest target data obtained from the storage system using the target instruction and the access parameters corresponding to the target instruction to the third microservice module.
[0061] Based on this possible implementation, when a third microservice module belonging to a microservice system requests target data from a first microservice module, the first microservice module can determine whether to send target data or target commands to the third microservice module based on whether the third microservice module supports command caching. Furthermore, when sending target data, the first microservice module can send target data from its own data cache or the latest target data obtained. This approach has good compatibility and applicability, and can effectively avoid resource waste caused by sending target commands to the third microservice module when it does not support command caching.
[0062] Optionally, in some possible implementations of this disclosure, if the third microservice module does not belong to the microservice system, the first microservice module can determine whether it is allowed to send instructions to other microservice systems outside the microservice system based on pre-configuration information, and determine whether the third microservice module supports instruction caching based on the third switch parameter. If the first microservice module is allowed to send instructions to other microservice systems outside the microservice system, and the third microservice module supports instruction caching, the first microservice module can send the target instruction and access parameters to the third microservice module so that the third microservice module can obtain the target data based on the target instruction and access parameters. If the first microservice module is not allowed to send instructions to other microservice systems outside the microservice system, the first microservice module can send the target data to the third microservice module.
[0063] In this possible implementation, when the third microservice module is not part of the microservice system, for data security reasons, the first microservice module can determine whether it is allowed to send instructions to other microservice systems outside the microservice system, and whether the third microservice module supports instruction caching, based on pre-configured information. If it is determined that sending is allowed and the third microservice module supports instruction caching, it can send the target instruction and the corresponding access parameters to the third microservice module, so that the third microservice module can obtain the target data based on the target instruction and access parameters. If it is determined that sending is not allowed, it can send the target data to the third microservice module. It should be noted that the implementation method of the third microservice obtaining the target data based on the target instruction and access parameters is the same as the implementation method of the first microservice module obtaining the target data based on the target instruction and access parameters. For details, please refer to the description of the first microservice module obtaining the target data based on the target instruction and access parameters in the above embodiment.
[0064] Based on this possible implementation, for a third microservice module that does not belong to the microservice system, the first microservice module can only send the target instruction and the access parameters corresponding to the target instruction to the third microservice module if the pre-configured information allows it to send instructions to other microservice systems outside the microservice system and the third microservice module supports instruction caching. This can effectively ensure the data security of the microservice system.
[0065] Optionally, in some possible implementations of this disclosure, the access parameters may also include an expiration policy. The first microservice module may determine whether the target instruction in the instruction cache is in a valid state based on the expiration policy. If the target instruction is not in a valid state, the storage space occupied by the target instruction and access parameters in the instruction cache may be released, which can avoid the waste of storage space by the target instruction and access parameters in an invalid state and help save storage space.
[0066] Optionally, in some possible implementations of this disclosure, the expiration policy mentioned above includes any one of the following: valid access duration and valid usage count. The second microservice module can configure the expiration policy for the target instruction based on the QPS (Query Per Second) of the microservice system.
[0067] When the QPS of a microservice system is low, the second microservice module can determine the expiration policy of the target instruction as a valid access duration. That is, the target instruction is valid within the valid access duration; after the valid access duration, the target instruction becomes invalid. The start time for calculating the valid access duration can be the time when the second microservice module completes the expiration policy configuration, the time when the first microservice module receives the target instruction, or the time when the first microservice module completes the target instruction caching.
[0068] When the QPS of the microservice system is high, the second microservice module can determine the expiration policy of the target instruction as the valid usage count, meaning that the number of times the first microservice module uses the target instruction cannot exceed the valid usage count. The number of times the first microservice module uses the target instruction can include the number of times the first microservice module itself uses the target instruction, as well as the number of times other microservice modules that obtain the target instruction from the first microservice module use the target instruction. The size of the valid usage count can be set according to actual needs or based on QPS; this embodiment does not specifically limit the size of the valid usage count.
[0069] Alternatively, in some other possible implementations of this disclosure, the second microservice module may also determine that the expiration policy of the target instruction includes two items: valid access duration and valid usage count. If the valid access duration is within the valid access duration and the valid usage count is not exceeded, the target instruction is in a valid state; if the valid access duration or the valid usage count is exceeded, the target instruction is in an invalid state.
[0070] Based on the above possible implementation methods, the second microservice module can configure a reasonable expiration policy for the target instruction according to the QPS of the microservice system. This can effectively ensure the accuracy and reliability of the target instruction and promptly detect target instructions in an invalid state. As a result, the storage space occupied by the target instruction and access parameters in the instruction cache can be released, which can avoid the waste of storage space by target instructions and access parameters in an invalid state and help save storage space.
[0071] Optionally, in some possible implementations of this disclosure, if the target instruction is not in a valid state, the first microservice module may send a third retrieval request to the second microservice module to update the target instruction, and use the new target instruction and new access parameters returned by the second microservice module in response to the third retrieval request to update the target instruction and access parameters in the instruction cache.
[0072] In this possible implementation, if the target instruction is not in a valid state, the first microservice module can send a third retrieval request to the second microservice module to update the target instruction, and include target data matching the target instruction that needs to be updated in the third retrieval request, so that the second microservice module can determine a new target instruction matching the target data and new access parameters based on the target data included in the third retrieval request.
[0073] Continuing the previous example, the target data can be student name data C, which is stored in student grade table B in database A of the storage system. The storage system is located on device D. The target instruction is "SELECT C FROM B", and the access parameters include the IP address of device D and the port number of data A.
[0074] During a system upgrade, database A was migrated from device D to device E, and student name data C was migrated from student grade table B to student information table F. Therefore, the new target instruction is "SELECT C FROM F," and the access parameters include the IP address of device E and the port number of data A. Upon receiving the third retrieval request from the first microservice module, the second microservice module, in response to the new target instruction ("SELECT C FROM F") and new access parameters (the IP address of device E and the port number of data A) returned by the third retrieval request, updates the target instruction and access parameters in the instruction cache using the new target instruction and new access parameters.
[0075] Based on this possible implementation, when the target instruction in the instruction cache is not in a valid state, the first microservice module can send a third retrieval request to the second microservice module to obtain the new target instruction and new access parameters, thereby updating the target instruction and access parameters in the instruction cache. This enables timely updates of the target instruction and access parameters, helping to improve the timeliness and accuracy of the target instruction and access data.
[0076] Optionally, in some possible implementations of this disclosure, in step 106 above, when the first microservice module accesses the storage system based on access parameters and retrieves target data from the storage system using target instructions, it can access the proxy layer of the storage system based on access parameters, and then receive the target data retrieved from the storage system using target instructions returned by the proxy layer.
[0077] In this embodiment of the disclosure, the second microservice module can output the target instruction to the first microservice module that requests the target data from the second microservice module. The first microservice module can then output the target instruction to other microservice modules that request the target data from the first microservice module. In other words, multiple microservice modules in the microservice system can use the target instruction to obtain the target data from the storage system. The data storage system needs to authorize access to multiple microservice modules.
[0078] Therefore, to ensure data security in the storage system and enable microservice modules to access target data, a proxy layer can be constructed. Each microservice module can access this proxy layer, which retrieves the target data from the storage system using the target instructions and then returns it to the respective microservice module. This proxy layer establishes a security barrier for the storage system, preventing data security issues caused by microservice modules directly accessing the storage system to obtain target data, thus effectively ensuring data security.
[0079] Figure 3 This is a schematic diagram of the proxy layer in the caching method of the microservice system disclosed in this publication. Figure 3 In this embodiment, the upstream microservice module can correspond to the first microservice module, the downstream microservice module can correspond to the second microservice module, the caching system can correspond to the storage system, and the caching proxy layer can be the proxy layer of the storage system.
[0080] like Figure 3 As shown, downstream microservice modules can access the caching proxy layer via a key. When a downstream microservice module returns target instructions and access parameters to an upstream microservice module, the access parameters can include the access address of the caching proxy layer and the key used to access it. The access address of the caching proxy layer can be the IP address of the device where the caching proxy layer resides, and the key can be a temporary key obtained by cloning the key used by the downstream microservice module to access the caching proxy layer. The upstream microservice module can then access the caching proxy layer based on the access parameters and receive the target data returned by the caching proxy layer, which is retrieved from the caching system using the target instructions.
[0081] Figure 2 This is a flowchart illustrating another embodiment of the caching method for the microservice system disclosed herein. Figure 2 As shown, in Figure 1 Based on the illustrated embodiment, in response to the absence of a target instruction in the instruction cache of the first microservice module, the above method may further include:
[0082] Step 108: The first microservice module sends a first retrieval request to the second microservice module to obtain the target data.
[0083] In step 108, if the first microservice module does not have the target instruction in its own instruction cache, it can send a first retrieval request to the second microservice module to obtain the target data, and the first retrieval request includes a first switch parameter for identifying that the first microservice module supports instruction caching.
[0084] After receiving the first retrieval request from the first microservice module, the second microservice module can determine whether to return the target instruction and the corresponding access parameters to the first microservice module based on the first switch parameter contained in the first retrieval request. Here, the first switch parameter indicates that the first microservice module supports instruction caching, and the second microservice module can return the target data, the target instruction, and the access parameters to the first microservice module. The access parameters may include an access address, an access key, and an expiration policy.
[0085] Optionally, in some possible implementations of this disclosure, if the target data is a value that can be directly obtained from the storage system, and the first microservice module supports instruction caching, the second microservice can return the target data, the target instruction, and the access parameters to the first microservice module; if the target data is a value that the second microservice module reprocesses after obtaining the value directly from the storage system, and the first microservice module supports instruction caching, the second microservice module will only return the target data to the first microservice module and will not return the target instruction and access parameters, so as to ensure the accuracy of the data obtained by the first microservice module.
[0086] Step 110: Receive the first information returned by the second microservice module in response to the first acquisition request.
[0087] In step 110, the first information includes the data that the second microservice module needs to return to the first microservice module, as determined in step 108. Since the first switch parameter in the first acquisition request indicates that the first microservice module supports instruction caching, the first information may include target data, target instructions, and access parameters.
[0088] Step 112: Parse the first information to obtain the target data, target instruction, and access parameters, and store the target instruction and access parameters in the instruction cache area.
[0089] In step 112, after receiving the first information sent by the second microservice module, the first microservice module parses the first information to obtain the data returned by the second microservice module. If the first microservice module supports instruction caching, it can obtain the target data, target instruction, and access parameters by parsing the first information, and can store the target instruction and access parameters in the instruction cache for use in subsequent requests for target data.
[0090] Based on the microservice system caching method provided in another embodiment of this disclosure, when the first microservice module supports instruction caching, the first microservice module can send a first retrieval request containing a first switch parameter to the second microservice module to obtain target data. It can also obtain the target data, target instruction, and access parameters by parsing the first information returned by the second microservice module in response to the first retrieval request, and store the target instruction and access parameters in the instruction cache area. Subsequently, when the target data needs to be obtained, the first microservice module can use the target instruction and access parameters to obtain the target data from the storage system without having to call the second microservice module to obtain the target data. This can effectively reduce the service time of the microservice system and help improve the service efficiency of the microservice system.
[0091] Alternatively, in some other possible implementations of this disclosure, in response to the absence of a target instruction in the instruction cache of the first microservice module, the first microservice module may send a second retrieval request to the second microservice module to obtain the target data. The second retrieval request includes a second switch parameter, which indicates that the first microservice module does not support instruction caching. The first microservice module can then receive second information returned by the second service module in response to the second retrieval request, parse the second information, and obtain the target data.
[0092] Therefore, if the first microservice module does not support instruction caching, it can send a second retrieval request containing a second switch parameter to the second microservice module to obtain the target data. Upon receiving the second retrieval request, the second microservice module can determine that the first microservice module does not support instruction caching based on the second switch parameter included in the request, and thus can return second information including the target data. It is evident that when the first microservice module does not support instruction caching, the second microservice module only returns the target data to the first microservice module, without returning the target instruction and access parameters, which helps avoid the resource waste caused by returning the target instruction and access parameters to the first microservice module when it does not support instruction caching.
[0093] Optionally, in some possible implementations of this disclosure, when the first microservice module receives the first information returned by the second microservice module in response to the first acquisition request, it may receive the first information returned by the second microservice module in response to the first acquisition request, which is encrypted based on a preset transmission key. When the first microservice module parses the first information to obtain the target data, target instruction, and access parameters, it may decrypt the first information using the preset transmission key to obtain the decrypted first information; then, it may parse the decrypted first information to obtain the target data, target instruction, and access parameters.
[0094] In this possible implementation, some or all microservice modules in the microservice system can maintain a common preset transmission key. This preset transmission key can be determined according to actual needs, and this disclosure does not impose specific limitations on it.
[0095] When the second microservice module sends the first information to the first microservice module, the second microservice module can encrypt the first information based on a preset transmission key before sending the encrypted first information to the first microservice module. After receiving the encrypted first information, the first microservice module can decrypt the encrypted first information based on the preset transmission key to obtain the decrypted first information, and then parse the decrypted first information to obtain the target data, target instructions, and access parameters.
[0096] Based on this possible implementation method, each microservice module in the microservice system can encrypt and decrypt the transmitted information based on a preset transmission key when transmitting information, which can effectively ensure the security of information during the transmission process, thereby improving the data security of the entire microservice system.
[0097] Optionally, in other possible implementations of this disclosure, when the first microservice module receives the first information returned by the second microservice module in response to the first acquisition request, it may also receive the first information returned by the second microservice module in response to the first acquisition request, which encapsulates the target data, target instruction, and access parameters based on a preset encapsulation function obtained from a preset class library. When the first microservice module parses the first information to obtain the target data, target instruction, and access parameters, it may also obtain a preset parsing function corresponding to the preset encapsulation function from the preset class library, and then use the preset parsing function to parse the first information to obtain the target data, target instruction, and access parameters.
[0098] The C / S (Client-Server) communication model, based on common protocols such as HTTP (Hypertext Transfer Protocol), can have either a server or a client. In this embodiment, any microservice module can act as a server to provide data to other microservice modules, or as a client to request data from other microservice modules.
[0099] Based on this, one possible implementation is to establish a pre-defined class library jointly maintained by some or all microservice modules in the microservice system. This allows for the synchronous updating and upgrading of the class libraries of each microservice module, which helps reduce system maintenance costs compared to each microservice module maintaining its own class library.
[0100] Figure 4 This is a diagram illustrating the pre-defined class library used in the caching method of the microservice system disclosed in this publication. For example... Figure 4 As shown, the preset class library can include server-side class libraries and client-side types. Downstream microservice modules can copy (clone) the server-side class library from the preset class library, and upstream microservice modules can copy (clone) the client-side class library from the preset class library to realize information transmission between upstream service modules and downstream modules.
[0101] In this possible implementation, when the second microservice module returns first information to the first microservice module in response to the first retrieval request, it can encapsulate the target data, target instructions, and access parameters based on a preset encapsulation function obtained from a preset class library to obtain the first information. The first microservice module can then use a preset parsing function corresponding to the preset encapsulation function obtained from the preset class library to parse the first information and obtain the target data, target instructions, and access parameters.
[0102] This pre-defined class library allows for the simultaneous implementation of both decode and encode functions for the same operation. Each microservice module can call the corresponding decode or encode function from the pre-defined class library according to its own functional requirements. The encode and decode functions can follow the same pre-defined protocol. The encode function can encapsulate data according to the pre-defined protocol to obtain encapsulated information, and the decode function can parse the encapsulated information according to the pre-defined protocol to obtain the actual data.
[0103] As an example, for database operations, the default protocol can be [version][mysql|pgsql|oracle|…][ip:port][database][table][command], where [version] is the protocol version field, [mysql|pgsql|oracle|…] is the database type field, [ip:port] is the IP address and port field, [database] is the database identifier field, [table] is the table field, and [command] is the operation command field. The encapsulation function can encapsulate the database data according to this default protocol to obtain the encapsulated information, and the parsing function can parse the encapsulated information according to this default protocol to obtain the database data.
[0104] Figure 5 This is a schematic diagram illustrating the interaction between the first and second microservice modules of this disclosure. The following section combines... Figure 5 The caching method for the microservice system disclosed herein is further explained as follows:
[0105] During the first request process, when the first microservice module needs to obtain target data from the storage system, it requests the target data from the second microservice module. After receiving the request from the first microservice module, the second microservice module obtains the target data from the storage system and determines whether the first microservice module supports instruction caching. If the first microservice module does not support instruction caching, it returns the target data to the first microservice module. If the first microservice module supports instruction caching, it adds the target instruction and access parameters to the returned data to return the target data, target instruction, and access parameters to the first microservice module. The first microservice module stores the target instruction and access parameters returned by the second microservice module in the instruction cache area.
[0106] In subsequent requests, when the first microservice module needs to obtain target data from the storage system, it accesses its own instruction cache to obtain the target instruction. If the target instruction is not found in the instruction cache, the first request process is repeated. If the target instruction is found in the instruction cache, it determines whether the target instruction is valid. If the target instruction is not valid, the first request process is repeated. If the target instruction is valid, the first microservice module accesses the storage system based on the access parameters and uses the target instruction to obtain the target data from the storage system.
[0107] The caching method for any microservice system provided in this disclosure can be executed by any suitable device with data processing capabilities, including but not limited to terminal devices and servers. Alternatively, the caching method for any microservice system provided in this disclosure can be executed by a processor, such as by a processor executing the caching method for any microservice system mentioned in this disclosure by calling corresponding instructions stored in memory. Further details will not be elaborated below.
[0108] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.
[0109] Figure 6 This is a schematic diagram illustrating the structure of a caching device for a microservice system according to an embodiment of the present disclosure. The microservice system in this embodiment may include a first microservice module and a second microservice module. The caching device may be disposed in the first microservice module to implement the caching methods of the microservice systems described above. Figure 6 As shown, the apparatus of this embodiment includes: a first determining module 602, a first acquiring module 604, and a second acquiring module 606. Wherein,
[0110] The first determining module 602 is used to determine whether there is a target instruction matching the target data in the instruction cache of the first microservice module in response to the first microservice module needing to obtain target data.
[0111] The first acquisition module 604 is used to, based on the determination result of the first determination module, if there is a target instruction in the instruction cache, acquire access parameters corresponding to the target instruction from the instruction cache, wherein the access parameters include the access address;
[0112] The second acquisition module 606 is used to access the storage system based on access parameters and to acquire target data from the storage system using target instructions.
[0113] Based on the caching device for a microservice system provided in the above embodiments of this disclosure, for a first microservice module and a second microservice module located in the microservice system, when the first microservice module needs to obtain target data from the storage system, it first determines whether there is a target instruction matching the target data in the instruction cache of the first microservice module. If the target instruction exists in the instruction cache, the access parameters corresponding to the target instruction are obtained from the instruction cache. These access parameters include an access address. Then, the access parameters are used to access the storage system, and the target data is obtained from the storage system using the target instruction. Thus, instruction caching of the microservice system is realized. The first microservice module can directly obtain target data from the storage system using the target instruction and access parameters in the instruction cache. Compared to obtaining target data by calling the second microservice module, this effectively reduces the service time of the microservice system and helps improve the service efficiency of the microservice system. Furthermore, when the first microservice module needs target data, it can obtain the current target data from the storage system using the target instruction and access parameters. Compared to caching target data, obtaining cached target data from the data cache helps improve the timeliness and accuracy of the data.
[0114] Figure 7 This is a schematic diagram of another embodiment of the caching device for the microservice system disclosed herein. Figure 6 Based on the caching device of the microservice system shown, the caching device may further include a first request module 608, a first receiving module 610, and a parsing module 612.
[0115] The first request module 608 is configured to, based on the determination result of the first determination module, and in response to the absence of a target instruction in the instruction cache, send a first acquisition request to the second microservice module to acquire the target data; wherein, the first acquisition request includes a first switch parameter for identifying that the first microservice module supports instruction caching;
[0116] The first receiving module 610 is used to receive the first information returned by the second microservice module in response to the first acquisition request;
[0117] The parsing module 612 is used to parse the first information, obtain the target data, target instruction, and access parameters, and store the target instruction and access parameters in the instruction cache area;
[0118] or,
[0119] The first request module 608 is used to send a second acquisition request to the second microservice module to obtain target data in response to the determination result of the first determination module and the absence of the target instruction in the instruction cache; wherein the second acquisition request includes a second switch parameter, which is used to indicate that the first microservice module does not support instruction caching;
[0120] The first receiving module 610 is used to receive the second information returned by the second service module in response to the second acquisition request;
[0121] The parsing module 612 is used to parse the second information to obtain the target data.
[0122] Optionally, in some possible implementations of this disclosure, the caching device for the microservice system described above may further include:
[0123] The second receiving module is used to receive a third acquisition request sent by the third microservice module for obtaining target data; wherein the third acquisition request includes a third switch parameter for identifying whether the third microservice module supports instruction caching;
[0124] The second determining module is used to determine whether the third microservice module supports instruction caching based on the third switch parameter in response to the fact that the third microservice module belongs to the microservice system.
[0125] The sending module is used to send the target data to the third microservice module in response to the third microservice module not supporting instruction caching, based on the determination result of the second determining module.
[0126] The sending module is also configured to send the target instruction and access parameters to the third microservice module in response to the instruction caching supported by the second determining module, based on the determining result of the second determining module, so that the third microservice module can obtain the target data based on the target instruction and access parameters.
[0127] Optionally, in some possible implementations of this disclosure, the caching device for the microservice system described above may further include:
[0128] The third determining module, in response to the fact that the third microservice module does not belong to the microservice system, determines whether the first microservice module is allowed to send instructions to other microservice systems outside the microservice system based on the pre-configured information, and determines whether the third microservice module supports instruction caching based on the third switch parameter.
[0129] The aforementioned sending module is used to send the target instruction and access parameters to the third microservice module in response to the determination result of the third determining module, the first microservice module being allowed to send instructions to other microservice systems outside the microservice system, and the third microservice module supporting instruction caching, so that the third microservice module can obtain the target data based on the target instruction and access parameters.
[0130] The aforementioned sending module is further configured to send the target data to the third microservice module in response to the first microservice module being prohibited from sending instructions to other microservice systems outside the microservice system, based on the determination result of the third determining module.
[0131] Optionally, in some possible implementations of this disclosure, the first receiving module 610 described above is specifically used for:
[0132] Receive the first information, encrypted based on a preset transmission key, returned by the second microservice module in response to the first acquisition request; and / or,
[0133] The system receives first information returned by the second microservice module in response to the first acquisition request. This information encapsulates the target data, target instructions, and access parameters based on a preset encapsulation function obtained from a preset class library. The preset class library is jointly maintained by multiple microservice modules in the microservice system.
[0134] The aforementioned parsing module 612 is specifically used for:
[0135] The first information is decrypted using a preset transmission key to obtain the decrypted first information. The decrypted first information is then parsed to obtain the target data, target instructions, and access parameters; and / or,
[0136] Obtain the preset parsing function corresponding to the preset encapsulation function from the preset class library; use the preset parsing function to parse the first information to obtain the target data, target instructions, and access parameters.
[0137] Optionally, in some possible implementations of this disclosure, the access parameters may also include an expiration policy;
[0138] The fourth determination module is used to determine whether the target instruction is in a valid state based on the expiration policy.
[0139] The release module is used to release the storage space occupied by the target instruction and access parameters in the instruction cache if the target instruction is not in a valid state, based on the determination result of the fourth determination module.
[0140] Optionally, in some possible implementations of this disclosure, the caching device for the microservice system described above may further include:
[0141] The second request module is used to send a third retrieval request to the second microservice module to update the target instruction if the target instruction is not in a valid state, based on the determination result of the fourth determination module, and to update the target instruction and access parameters in the instruction cache using the new target instruction and new access parameters returned by the second microservice module in response to the third retrieval request.
[0142] Optionally, in some possible implementations of this disclosure, the expiration policy may include any of the following: valid access duration, valid usage count.
[0143] Optionally, in some possible implementations of this disclosure, the second acquisition module 606 described above may include:
[0144] The access unit is used to access the proxy layer of the storage system based on access parameters.
[0145] The receiving unit is used to receive target data returned by the agent layer from the storage system using the target instructions.
[0146] In addition, embodiments of this disclosure also provide an electronic device, including:
[0147] Memory, used to store computer programs;
[0148] A processor is configured to execute a computer program stored in the memory, wherein when the computer program is executed, it implements the caching method of the microservice system described in any of the above embodiments of the present disclosure.
[0149] Figure 8 This is a schematic diagram illustrating the structure of an application embodiment of the electronic device disclosed herein. Below, reference is made to… Figure 8 This describes an electronic device according to embodiments of the present disclosure. The electronic device may be either or both of a first device and a second device, or a standalone device independent of them, which may communicate with the first device and the second device to receive acquired input signals from them.
[0150] like Figure 8 As shown, the electronic device includes one or more processors and memory.
[0151] A processor can be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and can control other components in an electronic device to perform desired functions.
[0152] The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and a processor may execute the program instructions to implement the caching methods of the microservice system of the various embodiments of this disclosure described above, and / or other desired functions.
[0153] In one example, the electronic device may also include input devices and output devices, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0154] In addition, the input device may include, for example, a keyboard, a mouse, etc.
[0155] This output device can output various information to the outside, including determined distance information, direction information, etc. The output device may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0156] Of course, for the sake of simplicity, Figure 8 Only some of the components of the electronic device relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0157] In addition to the methods and apparatus described above, embodiments of this disclosure may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the caching methods of a microservice system according to various embodiments of this disclosure as described in the foregoing portions of this specification.
[0158] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0159] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the caching methods of the microservice system according to various embodiments of this disclosure as described in the foregoing portion of this specification.
[0160] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0161] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0162] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0163] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0164] The methods and apparatus of this disclosure may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.
[0165] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions to this disclosure.
[0166] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0167] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A caching method for a microservice system, the microservice system comprising a first microservice module and a second microservice module, the method being applied to the first microservice module, characterized in that, The method includes: In response to the need to obtain target data, it is determined whether there is a target instruction matching the target data in the instruction cache of the first microservice module, wherein the target instruction is the instruction used to obtain the target data from the storage system; In response to the presence of the target instruction in the instruction cache, access parameters corresponding to the target instruction are obtained from the instruction cache; wherein, the access parameters include an access address, and the target instruction and the access parameters are received from the second microservice module and cached in the instruction cache by the first microservice module before the target data is obtained this time; Access the storage system based on the access parameters, and retrieve the target data from the storage system using the target instruction; In response to the absence of the target instruction in the instruction cache, if the first microservice module supports instruction caching, a first acquisition request for acquiring the target data is sent to the second microservice module; wherein, the first acquisition request includes a first switch parameter, which is used to identify that the first microservice module supports instruction caching; Receive the first information returned by the second microservice module in response to the first acquisition request; The first information is parsed to obtain the target data, the target instruction, and the access parameters, and the target instruction and the access parameters are stored in the instruction cache area.
2. The method according to claim 1, characterized in that, Also includes: In response to the absence of the target instruction in the instruction cache, if the first microservice module does not support instruction caching, a second acquisition request for acquiring the target data is sent to the second microservice module; wherein, the second acquisition request includes a second switch parameter, which is used to indicate that the first microservice module does not support instruction caching; Receive the second information returned by the second microservice module in response to the second acquisition request; The second information is parsed to obtain the target data.
3. The method according to claim 1, characterized in that, Also includes: Receive a third acquisition request sent by a third microservice module for obtaining the target data; wherein, the third acquisition request includes a third switch parameter, which is used to identify whether the third microservice module supports instruction caching; In response to the fact that the third microservice module belongs to the microservice system, it is determined whether the third microservice module supports instruction caching based on the third switch parameter; Since the third microservice module does not support instruction caching, the target data is sent to the third microservice module. In response to the third microservice module supporting instruction caching, the target instruction and the access parameters are sent to the third microservice module so that the third microservice module can obtain the target data based on the target instruction and the access parameters.
4. The method according to claim 3, characterized in that, Also includes: If the third microservice module does not belong to the microservice system, determine whether the first microservice module is allowed to send instructions to other microservice systems outside the microservice system according to the pre-configuration information, and determine whether the third microservice module supports instruction caching according to the third switch parameter; If the first microservice module is allowed to send instructions to other microservice systems outside the microservice system, and the third microservice module supports instruction caching, the target instruction and the access parameters are sent to the third microservice module so that the third microservice module can obtain the target data based on the target instruction and the access parameters; If the first microservice module is not allowed to send instructions to other microservice systems outside the microservice system, the target data will be sent to the third microservice module.
5. The method according to claim 2, characterized in that, The receipt of the first information returned by the second microservice module in response to the first acquisition request includes: Receive the first information, encrypted based on a preset transmission key, returned by the second microservice module in response to the first acquisition request; And / or, The system receives first information returned by the second microservice module in response to the first acquisition request. This information encapsulates the target data, the target instruction, and the access parameters based on a preset encapsulation function obtained from a preset library. The preset library is jointly maintained by multiple microservice modules in the microservice system. The step of parsing the first information to obtain the target data, the target instruction, and the access parameters includes: The first information is decrypted using the preset transmission key to obtain the decrypted first information, and the decrypted first information is parsed to obtain the target data, the target instruction, and the access parameters; And / or, Obtain a preset parsing function corresponding to the preset encapsulation function from the preset class library, and use the preset parsing function to parse the first information to obtain the target data, the target instruction, and the access parameters.
6. The method according to any one of claims 1-5, characterized in that, The access parameters also include an expiration policy; Based on the expiration policy, determine whether the target instruction is in a valid state; If the target instruction is not in a valid state, release the storage space occupied by the target instruction and the access parameters in the instruction cache.
7. The method according to claim 6, characterized in that, The expiration policy includes any of the following: valid access duration, valid usage count.
8. The method according to claim 1, characterized in that, The step of accessing the storage system based on the access parameters and retrieving the target data from the storage system using the target instruction includes: Access the proxy layer of the storage system based on the access parameters; Receive the target data retrieved from the storage system using the target instruction, returned by the proxy layer.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the caching method of the microservice system as described in any one of claims 1-8.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the caching method of the microservice system as described in any one of claims 1-8.
Citation Information
Patent Citations
Micro-service cross-service data acquisition method and device and micro-service equipment
CN111125170A
Instruction caching method and device
CN113204370A