CN111639088B - Local cache updating system, method, electronic equipment and storage medium - Google Patents

Local cache updating system, method, electronic equipment and storage medium Download PDF

Info

Publication number
CN111639088B
CN111639088B CN202010472940.6A CN202010472940A CN111639088B CN 111639088 B CN111639088 B CN 111639088B CN 202010472940 A CN202010472940 A CN 202010472940A CN 111639088 B CN111639088 B CN 111639088B
Authority
CN
China
Prior art keywords
updating
server
local cache
application server
application
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
CN202010472940.6A
Other languages
Chinese (zh)
Other versions
CN111639088A (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.)
Ctrip Computer Technology Shanghai Co Ltd
Original Assignee
Ctrip Computer Technology Shanghai 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 Ctrip Computer Technology Shanghai Co Ltd filed Critical Ctrip Computer Technology Shanghai Co Ltd
Priority to CN202010472940.6A priority Critical patent/CN111639088B/en
Publication of CN111639088A publication Critical patent/CN111639088A/en
Application granted granted Critical
Publication of CN111639088B publication Critical patent/CN111639088B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The invention discloses an updating system, a method, electronic equipment and a storage medium of a local cache.A application server in communication connection with a database server is used for receiving a first request, acquiring first updating data from the database server according to the first request to update the local cache, and sending the first updating data to a WebSocket server while updating the local cache; the WebSocket server is used for receiving the first updating data and sending the received first updating data to other application servers in the application server cluster to update the local cache; and other application servers in the application server cluster except the application server acquiring the first updating data are used for receiving the first updating data to update the local cache. The invention improves the utilization rate of local cache, updates the cache more timely and reduces the problem of instability of the database server caused by overdue transparent transmission.

Description

Local cache updating system, method, electronic equipment and storage medium
Technical Field
The present invention relates to cache updating, and in particular, to a system, a method, an electronic device, and a storage medium for updating a local cache.
Background
At present, the updating of the local cache of a plurality of application servers in the application server cluster depends on the updating of the local cache of each application server, that is, each application server in the application server cluster realizes the data updating of the local cache according to the first request received after the cache of each application server is expired. When a large number of requests with the same parameters simultaneously fall into different application servers in an application server cluster, all the application servers receiving the requests access the database server to update local cache data of the application servers, so that severe pressure is caused to the database server, and the database server is unstable.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a local cache updating system, method, electronic device and storage medium to overcome the defect that the updating of a plurality of local caches of application servers in an application server cluster depends on the updating of each local cache of the application servers in the prior art.
The invention solves the technical problems through the following technical scheme:
a local cache update system, comprising: an application server cluster, a WebSocket (a protocol for full duplex communication over a single TCP connection) server, and a database server, the application server cluster comprising a plurality of application servers; wherein:
at least one of the application servers is in communication connection with the database server;
the WebSocket server is in communication connection with all the application servers;
the application server is in communication connection with the database server and is used for receiving a first request, acquiring first updating data from the database server according to the first request to update a local cache, and sending the first updating data to the WebSocket server while updating the local cache;
the WebSocket server is used for receiving the first updating data and sending the received first updating data to other application servers in the application server cluster except the application server which acquires the first updating data;
and the other application servers in the application server cluster except the application server acquiring the first updating data are used for receiving the first updating data to update the local cache.
Preferably, the update system further includes a first terminal device, the first terminal device is in communication connection with an application server in communication connection with the database server, and the first terminal device is configured to send the first request.
Preferably, the WebSocket server is further configured to receive a second request and second update data, and send the second update data to all application servers in the application server cluster according to the second request.
Preferably, the update system further includes a second terminal device, the second terminal device is in communication connection with the WebSocket server, and the second terminal device is configured to send the second request and the second update data.
Preferably, the updating system further comprises a plurality of other application server clusters which are in communication connection with the WebSocket server;
the WebSocket server is further used for sending the received first updating data to the application servers in the plurality of other application server clusters.
A method for updating a local cache is implemented by using the local cache updating system, and includes:
receiving a first request by an application server in communication connection with the database server;
the application server receiving the first request acquires first updating data from the database server according to the first request so as to update a local cache;
the application server which acquires the first updating data sends the first updating data to the WebSocket server while updating the local cache;
the WebSocket server receives the first updating data;
the WebSocket server sends the received first updating data to other application servers in the application server cluster except the application server which acquires the first updating data;
and other application servers in the application server cluster except the application server acquiring the first updating data receive the first updating data to update the local cache.
Preferably, the updating method further comprises:
and the WebSocket server receives a second request and second updating data and sends the second updating data to all application servers in the application server cluster according to the second request.
Preferably, the updating system further comprises a plurality of other application server clusters which are in communication connection with the WebSocket server;
after the step of the WebSocket server receiving the first update data, the method further includes:
and the WebSocket server sends the received first updating data to application servers in a plurality of other application server clusters.
An electronic device comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the local cache updating method.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method for updating a local cache.
The invention has the positive effects that: according to the invention, through deploying the WebSocket server and simultaneously carrying out communication connection on all the application servers in the application server cluster and the WebSocket server, any one application server in the application server cluster updates the local cache and simultaneously informs all other application servers through the WebSocket server to update the local caches of all the application servers.
Drawings
Fig. 1 is a block diagram of a local cache update system according to embodiment 1 of the present invention.
Fig. 2 is a block diagram of a local cache update system according to embodiment 2 of the present invention.
Fig. 3 is a schematic diagram of the local cache update system according to embodiment 2 of the present invention to update the local cache.
Fig. 4 is a flowchart of a local cache updating method according to embodiment 3 of the present invention.
Fig. 5 is a partial flowchart of a local cache updating method according to embodiment 4 of the present invention.
Fig. 6 is a partial flowchart of a local cache updating method according to embodiment 4 of the present invention.
Fig. 7 is a schematic structural diagram of an electronic device according to embodiment 5 of the present invention.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, the local cache updating system of this embodiment includes: the WebSocket server comprises a WebSocket server 1, an application server cluster 2 and a database server 3, wherein the application server cluster 2 comprises a plurality of application servers, and referring to fig. 1, the application server cluster 2 comprises application servers 2A to 2N.
In the present embodiment, the WebSocket server 1 is in communication connection with all the application servers in the application server cluster 2, that is, the WebSocket server 1 is in communication connection with both the application server 2A and the application server 2N.
At least one application server in the cluster of application servers 2 is communicatively connected to the database server 3.
In this embodiment, an example of the communication connection between the application server 2A and the database server 3 is as follows:
when receiving a first request sent by a client, the application server 2A obtains first update data from the database server 3 to update the local cache, and while updating the local cache, sends the obtained first update data to the WebSocket server 1, where the WebSocket server 1 is configured to receive the first update data and send the received first update data to other application servers in the application server cluster 2 (i.e., other application servers in the application server cluster 2 except for the application server 2A), and the other application servers in the application server cluster 2 update the local cache based on the received first update data.
In the local cache updating system of this embodiment, when the local cache of one application server in the application server cluster 2 is updated, the WebSocket server 1 enables other application servers in the application server cluster 2 to update the local cache at the same time.
The connection relationship between the application server 2A and the database server 3 is only an example, and actually, a plurality of application servers in the application server cluster 2 may be connected to the database server 3 in a communication manner.
Under the condition that a plurality of application servers in the application server cluster 2 are in communication connection with the database server 3, when any one of the plurality of application servers in the application server cluster 2 in communication connection with the database server 3 receives a first request, first updating data is obtained from the database server 3 to update the local cache, the obtained first updating data is sent to the WebSocket server 1 while the local cache is updated, the WebSocket server 1 receives the first updating data and sends the received first updating data to other application servers in the application server cluster 2, and the other application servers in the application server cluster 2 are used for receiving the first updating data to update the local cache so as to update the local cache of the other application servers in the application server cluster 2 at the same time.
The local cache updating system of the embodiment can greatly improve the utilization rate of the local cache.
For example, if there are 20 application servers in the application server cluster 2, there are 20 caches, and if the local cache expiration time is 10 minutes, the cache of each application server will expire after 10 minutes, in the existing local cache updating process of application servers, after each application server with expired local cache receives the first request, it will go to the database server 3 to obtain the first updating data to update the local cache, so that at least 20 first requests fall on the database server 3, and the local cache utilization ratio is (100-20)/100 =80% calculated by taking the number of requests of the application server cluster 2 as 100.
In the local cache updating system of this embodiment, when the application server in the application server cluster 2 receives the request, the first update data is obtained from the database server 3 to perform local cache updating, and the first update data is sent to the WebSocket server 1, the WebSocket server 1 sends the received first update data to other application servers in the application server cluster 2, and the other application servers in the application server cluster 2 are configured to receive the first update data to update the local cache. Also calculated with the number of requests of the application server cluster 2 as 100, then the local cache utilization is (100-1)/100 =99%.
It can be seen that the local cache updating system of the embodiment greatly improves the utilization rate of the local cache of the application server in the application server cluster 2. In the local cache updating system of this embodiment, by deploying the WebSocket server and simultaneously performing communication connection between all the application servers in the application server cluster and the WebSocket server, when any one application server in the application server cluster updates the local cache, the WebSocket server notifies all other application servers to update the local caches of all the application servers.
Example 2
As shown in fig. 2, the local cache updating system of the present embodiment is a further improvement of embodiment 1, and specifically: the local cache updating system of the present embodiment further includes a first terminal device 5.
The first terminal device 5 is in communication connection with an application server in the application server cluster 2, the application server being connected to the database server, and the first terminal device 5 is configured to send a first request to a corresponding application server.
In the present embodiment, an example is given in which the first terminal device 5 is communicatively connected to the application server 2A in the application server cluster 2. Specifically, the first request may be sent by a client installed on the first terminal device 5 (in an actual application, the client may be, for example, a web (web) application), the application server cluster 2 is an application server, the application server in the application server cluster 2 accesses the database server 3 to provide data services for the client, and the application server in the application server cluster 2, after the local cache expires, receives the first request of the client and then goes to the database server 3 to obtain the first update data to update the local cache.
In this embodiment, the same client may send multiple requests with the same parameters, and when the parameters of the multiple requests are the same, the first update data obtained from the database server 3 is also the same; different clients may send a plurality of requests with different parameters, and the first update data obtained from the database server 3 when the parameters of the plurality of requests are different is also different.
As shown in fig. 2, the local cache updating system of this embodiment further includes an application server cluster 4, where the application server cluster 4 includes an application server 4A to an application server 4N, and the application server 4A to the application server 4N are all in communication connection with the WebSocket server 1.
In this embodiment, the first terminal device 5 sends a first request to the application server 2A in the application server cluster 2, the application server 2A accesses the database server 3 to obtain first update data to update the local cache, meanwhile, the application server 2A sends the obtained first update data to the WebSocket server 1, and the WebSocket server 1 is configured to receive the first update data and send the received first update data to other application servers in the application server cluster 2 and all application servers in the application server cluster 4, and the other application servers in the application server cluster 2 and all application servers in the application server cluster 4 update the local cache based on the received first update data.
In the local cache updating system of this embodiment, when a local cache of one application server in the application server cluster 2 is updated, the WebSocket server 1 enables other application servers in the application server cluster 2 and all application servers in the application server cluster 4 to update the local cache at the same time.
The local cache updating system of this embodiment may further include a plurality of other application server clusters besides the application server cluster 2, and the application server cluster 4 in this embodiment is only used for illustration and is not intended to limit the number of other application server clusters. When any local cache of an application server in the distributed application server cluster is updated, the WebSocket server 1 enables all other application servers in the distributed application server cluster, which are in communication connection with the WebSocket server 1, to update the local caches simultaneously.
Under the condition that a plurality of application servers in the application server cluster 2 are in communication connection with the database server 3, when any one of the application servers in the application server cluster 2 in communication connection with the database server 3 receives a first request sent by the first terminal device 5 for requesting cache updating, the first update data is obtained from the database server 3 to update the local cache, and is sent to the WebSocket server 1 while updating the local cache, the WebSocket server 1 is used for receiving the first update data and sending the received first update data to the other application servers in the application server cluster 2 and all application servers in the application server cluster 4, and the other application servers in the application server cluster 2 and all application servers in the application server cluster 4 are used for receiving the first update data to update the local cache, so that the local caches of the other application servers in the application server cluster 2 and all application servers in the application server cluster 4 are updated simultaneously.
Therefore, the local cache updating system of the embodiment can realize the passive cache updating of the application server based on the first request. Specifically, the definition of the passive cache update is that the update of the cache is not manually updated by a user, but is determined in the update system whether the cache needs to be updated or not, and how long the cache needs to be updated, that is, the update system itself completes the whole cache update process.
As shown in fig. 2, the local cache updating system of this embodiment further includes a second terminal device 6, where the second terminal device 6 is in communication connection with the WebSocket server 1, and the second terminal device 6 is configured to send a second request and second update data. The second request sent by the second terminal device 6 may be manually intervened, that is, when it is manually determined that the application server in the update system needs to perform cache update, a manual intervention instruction, that is, the second request, is sent to the WebSocket server 1. The second terminal device 6 sends the second request and is accompanied with second update data required by the application server for cache update, and when the WebSocket server 1 receives the second update data, the WebSocket server 1 notifies all application servers in all application server clusters to update the local cache based on the received second update data. In this case, since the second terminal device 6 sends the second request with the update data, the application server does not go to the database server to obtain the update data, and thus, the database is not affected.
For example, although the description information of the article a corresponding to the cache is "price 10 meta", the description information of the article is already updated to "price 12 meta" in the database server, and the local cache information is still "price 10 meta" for some reason, at this time, without increasing the load of the database server, the description information may be updated to "price 12 meta" through human intervention, that is, the second terminal device 6 sends the second request and the second update data "price 12 meta" to the WebSocket server 1, and the WebSocket server 1 notifies all the application servers in all the application server clusters based on the second request to actively update the description information of the article a cached locally from "price 10 meta" to "price 12 meta".
Therefore, the local cache updating system of the embodiment can realize the active cache updating of the application server based on the second request. In particular, active cache update is defined in that cache update requires human intervention, i.e. whether update is required is determined manually. For example, the update of the configuration information of the total station by the administrator of one website is an active cache update.
The application scenario is specifically shown in fig. 3:
the Client is a Client, request1 and Request2 are requests sent by the Client, an application server cluster corresponding to the Client is an application server side, the application server cluster comprises a plurality of application servers, namely S1, S2, S3, S4, S5 and S6, DB is a database server, the WebSocket server is in communication connection with all the application servers (S1, S2, S3, S4, S5 and S6), and the application server S1 is in communication connection with DB. Assuming that the local cache of the application server S1 is expired, when the Request2 of the client arrives at the application server S1, the application server S1 will query the DB data, the DB returns the update data to the application server S1, and the application server S1 updates the local cache and simultaneously notifies the WS (WebSocket) server of the need to forward the part of data (i.e., the update data) to other machines (i.e., the application servers S2, S3, S4, S5, and S6) to update the local caches of other application servers, where the dashed line in the figure represents the update process. When a Request comes next time, such as Request1, no matter which machine (i.e. application server) it requests, the latest cache is obtained when the cache is not expired, and the updated data is obtained without accessing the DB.
On the basis of embodiment 1, in this embodiment, the WebSocket server is in communication connection with the distributed application server cluster, so that simultaneous updating of the local cache of the application server in the distributed application server cluster can be realized, and the updating system of this embodiment can be applied not only to passive updating of the cache, but also to active updating of the local cache, so that diversification of application scenes can be realized.
Example 3
As shown in fig. 4, the local cache updating method of this embodiment is implemented by using the local cache updating system provided in embodiment 1 or 2, and the local cache updating method of this embodiment includes:
s100, an application server in communication connection with a database server receives a first request;
s200, the application server receiving the first request obtains first updating data from the database server according to the first request so as to update the local cache;
s300, the application server acquiring the first updating data sends the first updating data to the WebSocket server while updating the local cache;
s400, the WebSocket server receives first updating data;
s500, the WebSocket server sends the received first updating data to other application servers in the application server cluster except the application server which acquires the first updating data;
s600, other application servers in the application server cluster except the application server acquiring the first updating data receive the first updating data to update the local cache.
The method for updating the local cache of the embodiment can greatly improve the utilization rate of the local cache.
For example, if there are 20 application servers in the application server cluster 2, there are 20 caches, and if the local cache expiration time is 10 minutes, the cache of each application server will expire after 10 minutes, in the existing local cache updating process of the application servers, after receiving the first request, each application server with expired local cache will go to the database server 3 to obtain the first updating data to update the local cache, so that at least 20 first requests fall on the database server 3, and the local cache utilization ratio is (100-20)/100 =80% as calculated by taking the number of requests of the application server cluster 2 as 100.
In the method for updating the local cache of this embodiment, when the application server in the application server cluster 2 receives the request, the first update data is obtained from the database server 3 to perform local cache updating, and the first update data is sent to the WebSocket server 1, the WebSocket server 1 sends the received first update data to other application servers in the application server cluster 2, and the other application servers in the application server cluster 2 are configured to receive the first update data to update the local cache. Also calculated with the number of requests of the application server cluster 2 as 100, then the local cache utilization is (100-1)/100 =99%.
It can be seen that the local cache updating method of the present embodiment greatly improves the utilization rate of the local cache of the application server in the application server cluster 2. In the local cache updating method of this embodiment, a WebSocket server is deployed, and all application servers in an application server cluster are in communication connection with the WebSocket server, so that when any one application server in the application server cluster updates a local cache, all other application servers are notified by the WebSocket server to update the local caches of all application servers.
Example 4
The local cache updating method of this embodiment is a further improvement of embodiment 3, and specifically, on the basis that the passive cache updating of the application server can be realized by the updating method of embodiment 3 based on the first request, the updating method of this embodiment may further realize the active cache updating of the application server, where the definition of the passive cache updating is that, the cache updating is not manually updated by a user, but is determined in the updating system whether the cache needs to be updated or not, how long the cache needs to be cached, that is, the updating system itself completes the whole cache updating process, and the definition of the active cache updating is that the cache updating needs to be manually intervened, that is, it is determined by a human whether the cache needs to be updated or not. For example, an administrator at a website updates configuration information for the total station, which is an active cache update.
As shown in fig. 5, the method for updating a local cache of this embodiment further includes:
s700, the WebSocket server receives the second request and the second updating data, and sends the second updating data to all application servers in the application server cluster according to the second request.
When the application server in the system needs to perform cache updating is judged manually, a manual intervention instruction, namely a second request, is sent to the WebSocket server through the second terminal device 6, second updating data needed by the application server for cache updating is attached, and the WebSocket server informs all application servers in all application server clusters of performing active updating of local caches based on the received second updating data based on the received second request. When the cache is actively updated, the second terminal device 6 already acquires the update data when sending the second request, and the application server does not go to the database server to acquire the update data, so that the database is not affected.
Therefore, the local cache updating method of the embodiment can realize the active cache updating of the application server based on the second request.
When the update system further includes a plurality of other application server clusters communicatively connected to the WebSocket server, referring to fig. 6, after step S400, the method further includes:
s800, the WebSocket server sends the received first updating data to application servers in a plurality of other application server clusters.
In the method for updating the local cache of the embodiment, when the update system includes a plurality of application server clusters and the local cache of one application server in the distributed application server cluster is updated, the WebSocket server enables other application servers in the plurality of application server clusters to update the local cache at the same time.
On the basis of embodiment 3, in this embodiment, the WebSocket server is in communication connection with the distributed application server cluster, so that simultaneous updating of the local cache of the application server in the distributed application server cluster can be realized, and the updating system of this embodiment can be applied not only to passive updating of the cache, but also to active updating of the local cache, so that diversification of application scenes can be realized.
Example 5
Fig. 7 is a schematic structural diagram of an electronic device implementing a method for updating a local cache according to embodiment 5 of the present invention. The electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the local cache updating method of embodiment 3 or 4 when executing the program. The electronic device 30 shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 7, the electronic device 30 may be embodied in the form of a general purpose computing device, which may be, for example, a server device. The components of the electronic device 30 may include, but are not limited to: the at least one processor 31, the at least one memory 32, and a bus 33 connecting the various system components (including the memory 32 and the processor 31).
The bus 33 includes a data bus, an address bus, and a control bus.
The memory 32 may include volatile memory, such as Random Access Memory (RAM) 321 and/or cache memory 322, and may further include Read Only Memory (ROM) 323.
Memory 32 may also include a program/utility 325 having a set (at least one) of program modules 324, such program modules 324 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The processor 31 executes various functional applications and data processing, such as the local cache updating method provided in embodiment 3 or 4 of the present invention, by executing the computer program stored in the memory 32.
The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). Such communication may be through an input/output (I/O) interface 35. Also, model-generating device 30 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via network adapter 36. As shown in FIG. 7, network adapter 36 communicates with the other modules of model-generating device 30 via bus 33. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the model-generating device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Example 6
The present embodiment provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the steps of the local cache updating method provided in embodiment 3 or 4.
More specific examples, among others, that the readable storage medium may employ may include, but are not limited to: a portable disk, a hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible implementation, the invention can also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps of implementing the local cache updating method of embodiment 3 or 4 when the program product is run on the terminal device.
Where program code for carrying out the invention is written in any combination of one or more programming languages, the program code may execute entirely on the user's device, partly on the user's device, as a stand-alone software package, partly on the user's device, partly on a remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (10)

1. A local cache update system, comprising: the system comprises an application server cluster, a WebSocket server and a database server, wherein the application server cluster comprises a plurality of application servers; wherein:
at least one of the application servers is in communication connection with the database server;
the WebSocket server is in communication connection with all the application servers;
the application server is in communication connection with the database server and is used for receiving a first request, obtaining first updating data from the database server according to the first request to update a local cache, and sending the first updating data to the WebSocket server while updating the local cache;
the WebSocket server is used for receiving the first updating data and sending the received first updating data to other application servers in the application server cluster except the application server which acquires the first updating data;
and the other application servers in the application server cluster except the application server acquiring the first updating data are used for receiving the first updating data to update the local cache.
2. The locally cached updating system of claim 1, further comprising a first terminal device communicatively coupled to an application server communicatively coupled to the database server, the first terminal device configured to send the first request.
3. The local-cache updating system of claim 1, wherein the WebSocket server is further configured to receive a second request and second update data, and send the second update data to all application servers in the application server cluster according to the second request.
4. The local cache updating system according to claim 3, wherein the updating system further includes a second terminal device, the second terminal device is in communication connection with the WebSocket server, and the second terminal device is configured to send the second request and the second update data.
5. The locally-cached update system of claim 1, further comprising a plurality of other clusters of application servers communicatively coupled to the WebSocket server;
the WebSocket server is also used for sending the received first updating data to application servers in a plurality of other application server clusters.
6. A method for updating a local cache, wherein the method is implemented by the local cache updating system according to claim 1, and the method comprises:
receiving a first request by an application server in communication connection with the database server;
the application server receiving the first request acquires first updating data from the database server according to the first request so as to update a local cache;
the application server which acquires the first updating data sends the first updating data to the WebSocket server while updating the local cache;
the WebSocket server receives the first updating data;
the WebSocket server sends the received first updating data to other application servers in the application server cluster except the application server which acquires the first updating data;
and other application servers in the application server cluster except the application server acquiring the first updating data receive the first updating data to update the local cache.
7. The local cache updating method of claim 6, wherein the updating method further comprises:
and the WebSocket server receives a second request and second updating data and sends the second updating data to all application servers in the application server cluster according to the second request.
8. The local cache updating method according to claim 6, wherein the updating system further comprises a plurality of other application server clusters communicatively connected to the WebSocket server;
after the step of the WebSocket server receiving the first update data, the method further includes:
and the WebSocket server sends the received first updating data to application servers in a plurality of other application server clusters.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of updating a local cache according to any one of claims 6 to 8 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for updating a local cache of any one of claims 6 to 8.
CN202010472940.6A 2020-05-29 2020-05-29 Local cache updating system, method, electronic equipment and storage medium Active CN111639088B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010472940.6A CN111639088B (en) 2020-05-29 2020-05-29 Local cache updating system, method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010472940.6A CN111639088B (en) 2020-05-29 2020-05-29 Local cache updating system, method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111639088A CN111639088A (en) 2020-09-08
CN111639088B true CN111639088B (en) 2023-03-21

Family

ID=72332254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010472940.6A Active CN111639088B (en) 2020-05-29 2020-05-29 Local cache updating system, method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111639088B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475904A (en) * 2013-05-29 2013-12-25 深圳市九洲电器有限公司 Publishing method and publishing system of EPG (electronic program guide), and Websocket server
CN111147599A (en) * 2019-12-31 2020-05-12 北京奇艺世纪科技有限公司 Cache data updating method and device, server and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9129126B2 (en) * 2011-05-20 2015-09-08 Red Hat, Inc. Updating changes to caches
US11048684B2 (en) * 2018-01-16 2021-06-29 Salesforce.Com, Inc. Lazy tracking of user system web cache

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475904A (en) * 2013-05-29 2013-12-25 深圳市九洲电器有限公司 Publishing method and publishing system of EPG (electronic program guide), and Websocket server
CN111147599A (en) * 2019-12-31 2020-05-12 北京奇艺世纪科技有限公司 Cache data updating method and device, server and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张震伟 ; 马雁云 ; .基于超元数据缓存的高速数据访问系统.2016,(09),全文. *
赵建飞 ; 梁忠民 ; 王军 ; 李留东 ; .基于B/S和开源框架技术的临安市水文水资源信息系统开发.2017,(05),全文. *

Also Published As

Publication number Publication date
CN111639088A (en) 2020-09-08

Similar Documents

Publication Publication Date Title
CN107590001B (en) Load balancing method and device, storage medium and electronic equipment
US7447799B2 (en) System and method for automatically updating a wireless device
US7716353B2 (en) Web services availability cache
EP1546924B1 (en) Method, system, and program for maintaining data in distributed caches
US6792510B1 (en) System and method for updating a cache
US20030069903A1 (en) Database migration
US9626262B1 (en) Primary role reporting service for resource groups
EP2671360B1 (en) Correlating input and output requests between client and server components in a multi-tier application
CN109413140B (en) Remote automatic upgrading method for PACS server
US20060168079A1 (en) System and method for automatically connecting a client computer to a server
CN109117252A (en) Method, system and the container cluster management system of task processing based on container
CN111818145B (en) File transmission method, device, system, equipment and storage medium
CN110929128A (en) Data crawling method, device, equipment and medium
CN1653420A (en) A system and method to re-synchronize client devices while refreshing them from a server
CN110188118B (en) Data synchronization method and device
WO2021115485A1 (en) Epg data management method, server, and readable storage medium
US6553406B1 (en) Process thread system receiving request packet from server thread, initiating process thread in response to request packet, synchronizing thread process between clients-servers.
CN111639088B (en) Local cache updating system, method, electronic equipment and storage medium
CN1833207A (en) System and method for web based monitoring and control of several spatially distributed systems
KR102367262B1 (en) Method, Apparatus and System for Monitoring Using Middleware
KR101696911B1 (en) Distributed Database Apparatus and Method for Processing Stream Data Thereof
JPH10105481A (en) Method for mediating service and its device
JP2001331398A (en) Server-managing system
KR100496172B1 (en) Dual web service system using host server in p2p web server configuration
CN112671871B (en) Mirror image distribution method and device, terminal equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant