CN109388508B - Embedded cache sharing system and method for realizing zero dependence - Google Patents

Embedded cache sharing system and method for realizing zero dependence Download PDF

Info

Publication number
CN109388508B
CN109388508B CN201811181478.3A CN201811181478A CN109388508B CN 109388508 B CN109388508 B CN 109388508B CN 201811181478 A CN201811181478 A CN 201811181478A CN 109388508 B CN109388508 B CN 109388508B
Authority
CN
China
Prior art keywords
data
cache
service
cache memory
data processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811181478.3A
Other languages
Chinese (zh)
Other versions
CN109388508A (en
Inventor
孟希杰
范渊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dbappsecurity Technology Co Ltd
Original Assignee
Hangzhou Dbappsecurity Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dbappsecurity Technology Co Ltd filed Critical Hangzhou Dbappsecurity Technology Co Ltd
Priority to CN201811181478.3A priority Critical patent/CN109388508B/en
Publication of CN109388508A publication Critical patent/CN109388508A/en
Application granted granted Critical
Publication of CN109388508B publication Critical patent/CN109388508B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention provides an embedded cache sharing system for realizing zero dependence, which is applied to a cache memory and comprises the following components: data receiving module, thread module and data operation module, wherein: the data receiving module is used for receiving a data processing request sent by a micro service in a server through a micro service thread, wherein the micro service comprises at least one of the following: an alarm service, a login authentication authority service, a log service and an RPC service; the thread module is used for creating a corresponding data access channel for each data processing request between the cache memory and the server under the condition that the data processing requests are multiple, so that the micro-service accesses the cache memory through the corresponding data access channels; and the data operation module is used for executing corresponding data processing operation in the cache memory according to the data processing request. The cache sharing method and the cache sharing device have the advantage that a plurality of micro-service threads can share one cache through the thread module in the cache.

Description

Embedded cache sharing system and method for realizing zero dependence
Technical Field
The invention relates to the technical field of data caching, in particular to a zero-dependence embedded cache sharing system and method.
Background
The operation of the terminal server safety management platform can facilitate a user to know the information and the use condition of the current terminal server more clearly and clearly. The Cache technology required for data sharing among a plurality of service applications of the terminal server security management platform is also paid more and more attention by people. How to use high-speed and efficient cache technology to control the safe and stable operation of the whole server safety management platform becomes increasingly important.
In the prior art, the problems that different service applications cannot coexist and data is shared can be caused by using a traditional Berkeley DB database, and meanwhile, different services all need independent caches, so that the problem of resource waste is caused.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a system and a method for implementing zero-dependency embedded cache sharing, which implement a technical effect that multiple micro-service threads can share one cache memory through a thread module in the cache memory, and solve a problem of resource waste caused when independent cache memories are needed for different services.
In a first aspect, an embodiment of the present invention provides a zero-dependency embedded cache sharing system, which is applied to a cache memory, and includes: data receiving module, thread module and data operation module, wherein: the data receiving module is configured to receive a data processing request sent by a micro service in a server through a micro service thread, where the micro service includes at least one of: an alarm service, a login authentication authority service, a log service and an RPC service; the thread module is used for creating a corresponding data access channel for each data processing request between the cache memory and the server under the condition that the data processing request is multiple, so that the micro-service accesses the cache memory through the corresponding data access channel; and the data operation module is used for executing corresponding data processing operation in the cache memory according to the data processing request.
Further, the system further comprises: and the transaction module is used for calling and running a lock mechanism under the condition that a plurality of micro services execute target operation in the cache memory through micro service threads at the same time, wherein the lock mechanism is used for controlling the plurality of micro services to execute the target operation in the cache memory in sequence, and the target operation is that each micro service writes data in a specified storage address of the cache memory or reads the data stored in the specified storage address in the cache memory.
Further, the data manipulation module comprises: the data processing device comprises a data reading module and a data writing module, wherein the data reading module is used for reading data to be read from the cache memory when the data processing request is a data reading request; and the data writing module is used for writing data to be written into the cache memory when the data processing request is a data writing request.
In a second aspect, an embodiment of the present invention provides a method for implementing zero-dependency embedded cache sharing, which is applied to a cache memory, and includes: receiving a data processing request sent by a micro service in a server through a micro service thread, wherein the micro service comprises at least one of the following: an alarm service, a login authentication authority service, a log service and an RPC service; if the data processing request is multiple, creating a corresponding data access channel for each data processing request between the cache memory and the server, so that the micro-service accesses the cache memory through the corresponding data access channel; and executing corresponding data processing operation in the cache memory according to the data processing request.
Further, in the case that the data processing request is a data read request, performing a corresponding data processing operation in the cache memory comprises: opening a cache file in a cache memory; searching whether a storage key value of the data to be read requested by the read data request exists in a cache file of the cache memory; and if the storage key value exists, returning the data to be read to the server through a corresponding data access channel so that the server feeds the data to be read back to the micro services.
Further, in the case that the data processing request is a data write request, performing a corresponding data processing operation in the cache memory comprises: opening a cache file in a cache memory; searching whether a data key value of the data to be written requested by the data writing request exists in a cache file of the cache memory; if the data key value exists, replacing the original data corresponding to the data key value with the data to be written; and if the data key value does not exist, creating the data key value in the cache file, and determining the data to be written as cache data corresponding to the data key value.
In a third aspect, an embodiment of the present invention provides a method for implementing zero-dependency embedded cache sharing, which is applied to a server, where the server includes at least one microservice, and the method includes: a micro-service in the server sends a data processing request to a cache memory through a micro-service thread, wherein the micro-service comprises at least one of: an alarm service, a login authentication authority service, a log service and an RPC service; wherein if the cache memory obtains a plurality of data processing requests, a corresponding data access channel is created between the cache memory and a server for each data processing request, so that the micro-service accesses the cache memory through the corresponding data access channel; and executing corresponding data processing operations in the cache memory according to the data processing request.
Further, before sending the data processing request to the cache memory, the method further comprises: acquiring a file to be deployed, wherein the file to be deployed is a GNU compiler suite; the GNU compiler suite is used for calling a GNU compiler when the cache sharing system is operated, and creating a compiling environment based on the GNU compiler; and deploying the file to be deployed in the cache sharing system.
Further, the acquiring the file to be deployed includes: acquiring a target data packet, wherein the target data packet comprises the file to be deployed; deploying the file to be deployed in the cache sharing system comprises the following steps: decompressing the target data packet to obtain the file to be deployed, and deploying the file to be deployed in the cache sharing system.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method in any one of the above aspects.
In the embodiment of the invention, aiming at the problem that in the prior art, due to the micro-service of a terminal management platform, a plurality of different service threads cannot share one cache, so that each service needs an independent cache to cause resource waste, the invention realizes the technical effect that a plurality of micro-service threads can share one cache through a thread module in a cache, and solves the problem of resource waste caused by the condition that different services need independent caches; meanwhile, the problem of difficult deployment of the cache system is solved through an embedded architecture thought. The diversity and the stability of the terminal security management platform in deployment are enhanced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of an embedded cache sharing system for implementing zero dependency according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of another embedded cache sharing system for implementing zero dependency according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for implementing zero-dependency embedded cache sharing according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a read data operation according to an embodiment of the present invention;
FIG. 5 is a flow chart of a write data operation according to an embodiment of the present invention;
fig. 6 is a flowchart of another method for implementing zero-dependency embedded cache sharing according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
the embodiment of the invention provides an embedded cache sharing system for realizing zero dependence, and the following description specifically describes the embedded cache sharing system for realizing zero dependence provided by the embodiment of the invention.
Fig. 1 is a schematic diagram of an embedded cache sharing system for implementing zero dependency according to an embodiment of the present invention, and as shown in fig. 1, the embedded cache sharing system mainly includes: a data receiving module 10, a thread module 20 and a data operating module 30, wherein:
a data receiving module 10, configured to receive a data processing request sent by a microservice in a server through a microservice thread, where the microservice includes at least one of: an alarm service, a login authentication authority service, a log service and an RPC service; the data processing request comprises a write data request and a read data request;
a thread module 20, configured to create, when a plurality of data processing requests are received, a corresponding data access channel for each data processing request between a cache (i.e., a cache) and a server, so that the micro-service accesses the cache through the corresponding data access channel; for example: at a certain moment, three data processing requests, namely a data processing request A, a data processing request B and a data processing request C, access the target cache at the same time, and then different data access channels can be created for the three data processing requests at the same time through the thread module 20 to be connected to the target cache, so that the three data requests can access data in the same target cache at the same time through different channels;
and a data operation module 30, configured to perform a corresponding data processing operation in the cache memory according to the data processing request.
The embedded cache sharing system for realizing zero dependence realizes the technical effect that a plurality of micro service threads can share one cache through the thread module 20 in the cache, and solves the problem of resource waste caused by the condition that different services all need independent caches.
In this embodiment of the present invention, as shown in fig. 2, the embedded cache sharing system for implementing zero dependency further includes: and the transaction module 40 is used for calling and running a lock mechanism under the condition that a plurality of micro services execute target operations in the cache memory through micro service threads at the same time, wherein the lock mechanism is used for controlling the plurality of micro services to execute the target operations in the cache memory in sequence, and the target operations are that each micro service writes data in a specified storage address of the cache memory or reads the data stored in the specified storage address of the cache memory. For example:
at a certain moment, the micro service a, the micro service B and the micro service C access the address D inside the cache through the data access channel created by the thread module 20, and then the transaction module 40 invokes and runs a lock mechanism to arrange that the micro service a, the micro service B and the micro service C sequentially access the address D according to the sequence, wherein the lock mechanism is used for locking the micro service a when the micro service a accesses the address D, that is, the micro service B and the micro service C except the micro service a are locked outside the address D, so that the uniqueness of the micro service a when accessing the address D is ensured. Only after microservice A completes the data operation on address D is the next microservice, microservice B, allowed to continue accessing address D.
In the embodiment of the present invention, the data operation module 30 includes: a data reading module 31 and a data writing module 32, wherein,
a data reading module 31, configured to read data to be read from the cache memory when the data processing request is a data reading request;
and the data writing module 32 is configured to write the data to be written into the cache memory when the data processing request is a data writing request.
From the above description, it can be seen that the embedded cache sharing system for realizing zero dependency provided by the present invention realizes the technical effect that a plurality of micro service threads can share one cache through the thread module 20 in the cache memory, and solves the problem of resource waste caused by the condition that different services all need independent caches. Meanwhile, the correctness and consistency of data access and operation processes in the cache are ensured through the transaction module 40.
Example two:
in accordance with an embodiment of the present invention, there is provided a method embodiment for implementing zero-dependent embedded cache sharing, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions, and that although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than here.
Fig. 3 is a flowchart of a method for implementing zero-dependency embedded cache sharing according to an embodiment of the present invention, and as shown in fig. 3, the method includes the following steps:
step S302, receiving a data processing request sent by a micro service in a server through a micro service thread, wherein the micro service comprises at least one of the following: an alarm service, a login authentication authority service, a log service and an RPC service; the data processing request comprises a write data request and a read data request;
step S304, if a plurality of data processing requests are available, a corresponding data access channel is created between the cache memory and the server for each data processing request, so that the micro-service accesses the cache memory through the corresponding data access channel; for example: at a certain moment, three data processing requests, namely a data processing request A, a data processing request B and a data processing request C, access a target cache at the same time, and the target cache can establish different data access channels for the three data processing requests at the same time, so that the target cache can receive the three data requests at the same time;
step S306, according to the data processing request, corresponding data processing operation is executed in the cache memory.
According to the zero-dependence embedded cache sharing method, the corresponding data access channel is created for each data processing request between the cache and the server, the technical effect that a plurality of micro service threads can share one cache is achieved, and the problem of resource waste caused by the fact that different services need independent caches is solved.
Fig. 4 is a flowchart of a read data operation, and in particular, as shown in fig. 4, in the case that the data processing request in step S306 is a data read request, performing the corresponding data processing operation in the cache memory includes the following steps:
step S401, opening a cache file in a cache memory;
step S402, searching whether a storage key value of data to be read requested by a data reading request exists in a cache file of a cache memory;
step S403, if the storage key exists, returning data to be read to the server through the corresponding data access channel, so that the server feeds back the data to be read to the plurality of microservices.
Specifically, for example: the data reading request A accesses data D in the cache, and a storage key value corresponding to the data D is K, the steps are that firstly, a cache file in the cache is opened, then, whether the storage key value K exists in the storage key value is searched in the cache file, if the storage key value K exists is searched, the data D corresponding to the K is returned to a server sending the data reading request A; and if the storage key value K is not found in the cache file opened in the cache, returning null data to the server sending the data reading request A.
Fig. 5 is a flow chart of a write data operation, and in particular, as shown in fig. 5, in the case that the data processing request in step S306 is a data write request, performing the corresponding data processing operation in the cache memory includes the following steps:
step S501, opening a cache file in a cache memory;
step S502, searching whether a data key value of data to be written requested by a data writing request exists in a cache file of a cache memory;
step S503, if the data key value exists, replacing the original data corresponding to the data key value with the data to be written;
step S504, if the data key value does not exist, the data key value is created in a cache file, and the data to be written is determined as the cache data corresponding to the data key value.
Specifically, for example: the data writing method comprises the steps that a data writing request A is written into a cache, data D are written into the cache, a storage key value corresponding to the data D is K, firstly, a cache file in the cache is opened, then, the storage key value is searched in the cache file, whether the storage key value K exists or not is judged, and if the storage key value K exists, the data corresponding to the K are replaced by the data D; and if the storage key value K is not found in the cache file opened in the cache, creating the storage key value K in the cache, writing the data D into the cache, and determining the data D as the data corresponding to the storage key value K.
It should be noted that, in steps S503 and S504 in the above method flow, each time step S503 or S504 is executed, the transaction module 40 in the first embodiment monitors the data write operation, and opens and runs the lock mechanism to ensure the accuracy and consistency of each piece of data modification and write operation.
As can be seen from the above description, in the embodiments of the present invention, aiming at the problem in the prior art that due to micro-servings of a terminal management platform, a plurality of different service threads cannot share one cache, so that each service needs an independent cache, thereby causing resource waste, a method for creating a corresponding data access channel for each data processing request between the cache and a server is used, so as to achieve a technical effect that a plurality of micro-service threads can share one cache, and solve the problem of resource waste caused when different services all need independent caches.
Example three:
there is also provided another embodiment of a method for implementing zero-dependent embedded cache sharing according to the embodiments of the present invention, where the steps shown in the flowchart of the drawings may be executed in a computer system such as a set of computer-executable instructions, and where a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown.
Fig. 6 is a flowchart of another method for implementing zero-dependency embedded cache sharing according to an embodiment of the present invention, and as shown in fig. 6, the method includes the following steps:
step S602, the micro service in the server sends a data processing request to the cache through the micro service thread, wherein the micro service comprises at least one of the following: an alarm service, a login authentication authority service, a log service and an RPC service;
step S604, if the cache memory obtains a plurality of data processing requests, a corresponding data access channel is created between the cache and the server for each data processing request, so that the micro-service accesses the cache through the corresponding data access channel; and executing corresponding data processing operation in the cache according to the data processing request.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the method described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
In the embodiment of the present invention, before sending the data processing request to the cache memory, the method further includes the following steps: the method comprises the steps that a server obtains a file to be deployed, wherein the file to be deployed is a GNU compiler suite (GCC for short); the GNU compiler suite is used for calling the GNU compiler when the cache sharing system is operated, and a compiling environment is created based on the GNU compiler; and then deploying the file to be deployed in the cache sharing system.
Specifically, the obtained file to be deployed may be an obtained target data package, where the target data package includes the file to be deployed.
In the embodiment of the invention, the step of deploying the file to be deployed in the cache sharing system comprises the following steps: and decompressing the target data packet to obtain a file to be deployed, and deploying the file to be deployed in the cache sharing system. For example:
the method comprises the steps that compression processing is carried out on an environment deployment file, namely a GUN compiler suite, required by the deployment of a cache system, and the environment deployment file and an installation file of the cache system are compressed into the same ISO mirror image file, so that when the deployment cache system is installed, the environment file does not need to be additionally deployed through network connection, the ISO mirror image file can be decompressed, and then the GCC environment deployment file and the cache system are installed in a one-key mode. The embedded architecture idea can solve the difficulty of traditional Redis deployment.
As can be seen from the above description, the embodiment of the present invention perfects a cache technology independent of the environment and a shared cache technology for a plurality of different microservice applications; and the problem of cache sharing among a plurality of micro-service applications is solved, and zero dependence on a deployment environment is achieved. Meanwhile, the diversity and the stability of the terminal safety management platform in deployment are enhanced.
Example four:
an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method in any one of the foregoing embodiments.
In all examples shown and described herein, any particular value should be construed as merely exemplary, and not as a limitation, and thus other examples of example embodiments may have different values.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based logic that performs the specified functions or acts
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (5)

1. An embedded cache sharing system for realizing zero dependence is characterized in that the embedded cache sharing system is applied to a cache memory and comprises the following components: data receiving module, thread module and data operation module, wherein:
the data receiving module is configured to receive a data processing request sent by a micro service in a server through a micro service thread, where the micro service includes at least one of: an alarm service, a login authentication authority service, a log service and an RPC service;
the thread module is used for creating a corresponding data access channel for each data processing request between the cache memory and the server under the condition that the data processing request is multiple, so that the micro-service accesses the cache memory through the corresponding data access channel;
the data operation module is used for executing corresponding data processing operation in the cache memory according to the data processing request;
the system further comprises: and the transaction module is used for calling and running a lock mechanism under the condition that a plurality of micro services execute target operation in the cache memory through micro service threads at the same time, wherein the lock mechanism is used for controlling the plurality of micro services to execute the target operation in the cache memory in sequence, and the target operation is that each micro service writes data in a specified storage address of the cache memory or reads the data stored in the specified storage address in the cache memory.
2. The system of claim 1, wherein the data manipulation module comprises: a data reading module and a data writing module, wherein,
the data reading module is used for reading data to be read from the cache memory when the data processing request is a data reading request;
and the data writing module is used for writing data to be written into the cache memory when the data processing request is a data writing request.
3. A method for realizing zero-dependence embedded cache sharing is characterized in that the method is applied to a cache memory and comprises the following steps:
receiving a data processing request sent by a micro service in a server through a micro service thread, wherein the micro service comprises at least one of the following: an alarm service, a login authentication authority service, a log service and an RPC service;
if the data processing request is multiple, creating a corresponding data access channel for each data processing request between the cache memory and the server, so that the micro-service accesses the cache memory through the corresponding data access channel;
executing corresponding data processing operation in the cache memory according to the data processing request;
in the case that the data processing request is a data write request, performing a corresponding data processing operation in the cache memory comprises:
opening a cache file in a cache memory;
searching whether a data key value of the data to be written requested by the data writing request exists in a cache file of the cache memory;
if the data key value exists, replacing the original data corresponding to the data key value with the data to be written;
if the data key value does not exist, the data key value is created in the cache file, and the data to be written is determined to be cache data corresponding to the data key value;
when data is written, monitoring data writing operation through a transaction module, and opening and operating a locking mechanism; the lock mechanism is used for controlling the plurality of micro-services to sequentially execute target operations in the cache memory, and the target operations are used for writing data in a specified storage address of the cache memory for each micro-service.
4. The method of claim 3, wherein, in the case that the data processing request is a data read request, performing the corresponding data processing operation in the cache memory comprises:
opening a cache file in a cache memory;
searching whether a storage key value of the data to be read requested by the data reading request exists in a cache file of the cache memory;
and if the storage key value exists, returning the data to be read to the server through a corresponding data access channel so that the server feeds the data to be read back to the micro services.
5. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any of the preceding claims 3-4 are performed by the processor when executing the computer program.
CN201811181478.3A 2018-10-10 2018-10-10 Embedded cache sharing system and method for realizing zero dependence Active CN109388508B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811181478.3A CN109388508B (en) 2018-10-10 2018-10-10 Embedded cache sharing system and method for realizing zero dependence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811181478.3A CN109388508B (en) 2018-10-10 2018-10-10 Embedded cache sharing system and method for realizing zero dependence

Publications (2)

Publication Number Publication Date
CN109388508A CN109388508A (en) 2019-02-26
CN109388508B true CN109388508B (en) 2021-02-26

Family

ID=65426937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811181478.3A Active CN109388508B (en) 2018-10-10 2018-10-10 Embedded cache sharing system and method for realizing zero dependence

Country Status (1)

Country Link
CN (1) CN109388508B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6044207A (en) * 1997-03-21 2000-03-28 Adaptec, Inc. Enhanced dual port I/O bus bridge
US6785759B1 (en) * 2000-05-10 2004-08-31 International Business Machines Corporation System and method for sharing I/O address translation caching across multiple host bridges
CN1763719A (en) * 2004-10-14 2006-04-26 阿尔卡特公司 Database ram cache
CN103455442A (en) * 2013-08-30 2013-12-18 华为技术有限公司 Multi-channel first-in first-out buffer queue controller and access method
CN104580226A (en) * 2015-01-15 2015-04-29 上海瀚之友信息技术服务有限公司 Session data sharing system and method
CN105955971A (en) * 2015-11-30 2016-09-21 中国银联股份有限公司 Key value buffer memory implementation method and device
CN107623729A (en) * 2017-09-08 2018-01-23 华为技术有限公司 A kind of caching method, equipment and cache service system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6044207A (en) * 1997-03-21 2000-03-28 Adaptec, Inc. Enhanced dual port I/O bus bridge
US6785759B1 (en) * 2000-05-10 2004-08-31 International Business Machines Corporation System and method for sharing I/O address translation caching across multiple host bridges
CN1763719A (en) * 2004-10-14 2006-04-26 阿尔卡特公司 Database ram cache
CN103455442A (en) * 2013-08-30 2013-12-18 华为技术有限公司 Multi-channel first-in first-out buffer queue controller and access method
CN104580226A (en) * 2015-01-15 2015-04-29 上海瀚之友信息技术服务有限公司 Session data sharing system and method
CN105955971A (en) * 2015-11-30 2016-09-21 中国银联股份有限公司 Key value buffer memory implementation method and device
CN107623729A (en) * 2017-09-08 2018-01-23 华为技术有限公司 A kind of caching method, equipment and cache service system

Also Published As

Publication number Publication date
CN109388508A (en) 2019-02-26

Similar Documents

Publication Publication Date Title
CN110826111B (en) Test supervision method, device, equipment and storage medium
US8713646B2 (en) Controlling access to resources on a network
CN108289098B (en) Authority management method and device of distributed file system, server and medium
CN110199283B (en) System and method for authenticating platform trust in a network functions virtualization environment
CN103297441A (en) Access control method and device
CN113569285A (en) Identity authentication and authorization method, device, system, equipment and storage medium
US20220342977A1 (en) Method and system for improved data control and access
JP2018509692A (en) Selective block-based integrity protection techniques
US20140041053A1 (en) Data block access control
US20160373421A1 (en) Virtual content repository
CN109977644B (en) Hierarchical authority management method under Android platform
CN113986296A (en) Firmware upgrading method and device, electronic equipment and storage medium
CN108256351B (en) File processing method and device, storage medium and terminal
CN112131041A (en) Method, apparatus and computer program product for managing data placement
US10606813B2 (en) Systems and methods for securely managing program execution
CN109388508B (en) Embedded cache sharing system and method for realizing zero dependence
CN105183799A (en) Authority management method and client
CN111698227B (en) Information synchronization management method, device, computer system and readable storage medium
CN109582454A (en) Permission releasing control method, device and equipment in a kind of distributed storage cluster
CN110597557B (en) System information acquisition method, terminal and medium
CN107589917B (en) Distributed storage system and method
CN108111501B (en) Control method and device for cheating flow and computer equipment
CN112818408A (en) Data management system, data management device, storage medium, and data management method
US20210044589A1 (en) Access control
CN111459899A (en) Log sharing method and device and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: No. 188, Lianhui street, Xixing street, Binjiang District, Hangzhou, Zhejiang Province, 310000

Applicant after: Hangzhou Anheng Information Technology Co.,Ltd.

Address before: 310000 15-storey Zhejiang Zhongcai Building, No. 68 Tonghe Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: Hangzhou Anheng Information Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant