A method, system, apparatus and medium for data update based on message queue

CN117609256BActive Publication Date: 2026-10-23QINGDAO HAIER TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311458944.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2026-10-23
Estimated Expiration
2043-11-03

AI Technical Summary

Technical Problem

但是这种方式存在缓存击穿的风险,同时实际数据重新加载到缓存中也增加了用户的等待时长

Benefits of technology

[0035] In implementing the technical solution of this invention, the invention controls a second service module to obtain update message data from a first service module corresponding to the second service module through a message queue. The update message data is the data update information corresponding to the update data of the first service module. Based on the update frequency of the update data, the cached data in the second service module is updated according to the update message data. The first service module is the producer of the update data, and the second service module is the consumer of the update data. Through this configuration, the invention obtains update message data from the first service module corresponding to the second service module in a timely manner through a message queue, and updates the cached data in the second service module in a timely manner according to the update frequency and update message data. This ensures that the cached data and the updated data in the second service module remain consistent, and also ensures that the cached data in the second service module does not expire, effectively preventing the risk of buffer breakdown.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117609256B_ABST
    Figure CN117609256B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of cache data, and particularly provides a data updating method, system and device based on a message queue and a medium, aiming to solve the technical problem of how to avoid cache breakage and ensure real-time consistency of data. For the purpose, the data updating method based on the message queue comprises the following steps: a second service module is controlled to acquire update message data of a first service module corresponding to the second service module through a message queue, wherein the update message data is data update information corresponding to update data of the first service module; and based on the update frequency of the update data, the cache data in the second service module is updated according to the update message data, wherein the first service module is a production side of the update data, and the second service module is a consumption side of the update data. Through the above configuration mode, the application can effectively avoid cache breakage and ensure real-time consistency of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cached data technology, and specifically provides a method, system, apparatus, and medium for data updating based on message queues. Background Technology

[0002] With the widespread adoption of internet application technologies, users have increasingly higher demands for the response speed of websites or apps. As a result, more and more servers are adopting caching technologies to improve data loading speed. However, in real-world business scenarios, cached data and actual data may not be synchronized. It is necessary to reconcile the cached data with the actual data to maintain business stability.

[0003] To address the issue of maintaining consistency between cached and actual data, the industry typically employs methods such as timed cache expiration or deleting the cache upon data write. This involves setting a time limit for cache expiration, or deleting the cache when data is modified or added, and then re-saving the actual data to the cache upon retrieval. However, this approach carries the risk of cache breakdown, and reloading the actual data into the cache increases user wait times. Furthermore, the rise of distributed services has exacerbated the inconsistency between cached and actual data. In real-world business scenarios, cached and actual data reside in two separate services, making it difficult to synchronously delete cached data when the actual data is modified.

[0004] Accordingly, a new data update scheme is needed in this field to address the above problems. Summary of the Invention

[0005] To overcome the above-mentioned shortcomings, this invention is proposed to provide a solution, or at least a partial solution, to the technical problem of how to avoid cache breakdown and ensure real-time data consistency.

[0006] In a first aspect, the present invention provides a method for data updating based on a message queue, the method comprising:

[0007] The control second service module obtains update message data of the first service module corresponding to the second service module through a message queue; wherein, the update message data is the data update information corresponding to the update data of the first service module;

[0008] Based on the update frequency of the updated data, the cached data in the second service module is updated according to the update message data;

[0009] The first service module is the producer of the updated data, and the second service module is the consumer of the updated data.

[0010] In one technical solution of the above-mentioned message queue-based data update method, updating the cached data in the second service module according to the update message data based on the update frequency of the updated data includes:

[0011] If the update frequency is less than or equal to the first preset frequency, then the cached data corresponding to the update message data in the second service module is deleted according to the update message data. When a call instruction corresponding to the update message data is received, the update data is obtained through the query interface of the first service module and the update data is stored in the second service module.

[0012] In one technical solution of the above-mentioned message queue-based data update method, updating the cached data in the second service module according to the update message data based on the update frequency of the updated data includes:

[0013] If the update frequency is greater than the second preset frequency and less than or equal to the third preset frequency, when the update message data is received, the update data corresponding to the update message data is obtained through the query interface of the first service module, and the corresponding cache data in the second service module is updated according to the update data;

[0014] Wherein, the second preset frequency is greater than or equal to the first preset frequency.

[0015] In one technical solution of the above-mentioned message queue-based data update method, updating the cached data in the second service module according to the update message data based on the update frequency of the updated data includes:

[0016] If the update frequency is greater than the fourth preset frequency, then the update data corresponding to the update message data is obtained through the message queue and the corresponding cache data in the second service module is updated according to the update data;

[0017] The fourth preset frequency is greater than or equal to the third preset frequency.

[0018] In one technical solution of the above-mentioned message queue-based data update method, the control of the second service module to obtain update message data of the first service module corresponding to the second service module through the message queue includes:

[0019] After obtaining the marked partition information of the updated message data by marking and partitioning the updated message data through the message service module, the updated message data is sent to the message queue through the message service module.

[0020] The second service module is controlled to obtain the update message data of the first service module corresponding to the second service module through the message queue based on the marked partition information.

[0021] In one technical solution of the above-mentioned message queue-based data update method, controlling the second service module to obtain update message data corresponding to the first service module through the message queue according to the marked partition information includes:

[0022] The second service module is controlled to obtain the update message data through a broadcast switch; wherein the message queue is bound to the broadcast switch;

[0023] Based on the marked partition information, determine whether the update message data is data from the second service module's own partition;

[0024] If so, then obtain the updated message data.

[0025] In one technical solution of the above-described message queue-based data update method, before updating the cached data in the second service module based on the update frequency of the updated data, the method further includes:

[0026] Based on the update message data, determine whether the version of the update data is higher than the version of the corresponding cached data in the second service module. If so, update the cached data in the second service module according to the update message data based on the update frequency of the update data.

[0027] In a second aspect, the present invention provides a technical solution for the above-described message queue-based data update method, wherein the system comprises:

[0028] The data acquisition module is configured to control the second service module to acquire update message data of the first service module corresponding to the second service module through a message queue;

[0029] The update message data is the data update information corresponding to the update data of the first service module;

[0030] A data processing module is configured to update the cached data in the second service module based on the update frequency of the updated data and the update message data.

[0031] The first service module is the producer of the updated data, and the second service module is the consumer of the updated data.

[0032] In a third aspect, a control device is provided, comprising at least one processor and at least one storage device, the storage device being adapted to store a plurality of program codes, the program codes being adapted to be loaded and executed by the processor to perform the message queue-based data update method described in any of the above-described technical solutions.

[0033] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, the program codes being adapted to be loaded and run by a processor to perform the message queue-based data update method described in any of the above-described technical solutions.

[0034] The above-described technical solutions of the present invention have at least one or more of the following beneficial effects:

[0035] In implementing the technical solution of this invention, the invention controls a second service module to obtain update message data from a first service module corresponding to the second service module through a message queue. The update message data is the data update information corresponding to the update data of the first service module. Based on the update frequency of the update data, the cached data in the second service module is updated according to the update message data. The first service module is the producer of the update data, and the second service module is the consumer of the update data. Through this configuration, the invention obtains update message data from the first service module corresponding to the second service module in a timely manner through a message queue, and updates the cached data in the second service module in a timely manner according to the update frequency and update message data. This ensures that the cached data and the updated data in the second service module remain consistent, and also ensures that the cached data in the second service module does not expire, effectively preventing the risk of buffer breakdown. Attached Figure Description

[0036] The disclosure of this invention will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Furthermore, similar numbers in the drawings are used to denote similar components, wherein:

[0037] Figure 1 This is a flowchart illustrating the main steps of a message queue-based data update method according to an embodiment of the present invention.

[0038] Figure 2 This is a flowchart illustrating the main steps of a message queue-based data update method according to an embodiment of the present invention.

[0039] Figure 3This is a schematic diagram of the main components of a message queue-based data update system according to an embodiment of the present invention.

[0040] List of reference numerals :

[0041] 11: Data acquisition module; 12: Data processing module. Detailed Implementation

[0042] Some embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0043] In the description of this invention, "module" and "processor" can include hardware, software, or a combination of both. A module can include hardware circuitry, various suitable sensors, communication ports, memory, and may also include software components, such as program code, or a combination of software and hardware. A processor can be a central processing unit, microprocessor, image processor, digital signal processor, or any other suitable processor. The processor has data and / or signal processing capabilities. The processor can be implemented in software, in hardware, or a combination of both. Non-transitory computer-readable storage media includes any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The terms "at least one A or B" or "at least one of A and B" have a similar meaning to "A and / or B" and can include only A, only B, or A and B. The singular terms "a" or "this" can also include plural forms.

[0044] See appendix Figure 1 , Figure 1 This is a schematic flowchart illustrating the main steps of a message queue-based data update method according to an embodiment of the present invention. Figure 1 As shown, the data update method based on message queue in this embodiment of the invention mainly includes the following steps S101-S102.

[0045] Step S101: Control the second service module to obtain the update message data of the first service module corresponding to the second service module through the message queue.

[0046] In this embodiment, the control second service module obtains update message data from the first service module corresponding to the second service module through a message queue. The update message data is the data update information corresponding to the update data of the first service module. The message queue, also known as a message list, is an application-to-application communication method. During message transmission, it acts as a container for storing messages; that is, the producer puts the generated messages into the message queue, and the consumer retrieves the messages from the message queue.

[0047] In one implementation, the first service module can be the data producer, and the second service module can be the data consumer.

[0048] In one embodiment, step S101 may include steps S1011 to S1012:

[0049] Step S1011: After obtaining the marked partition information of the updated message data by marking and partitioning the updated message data through the message service module, the updated message data is sent to the message queue through the message service module.

[0050] Step S1012: Control the second service module to obtain the update message data of the first service module corresponding to the second service module through the message queue according to the marked partition information.

[0051] In this embodiment, after the message service module marks and partitions the update message data to obtain the marked partition information, the update message data with the marked partition information is sent to the message queue through the message service module. The second service module is then controlled to retrieve the update message data corresponding to the first service module from the message queue based on the marked partition information. The message service module serves as the unified entry point for data updates; all data producers can call the message service module through its interface when data updates occur.

[0052] In one implementation, the marker partition information can be test information, which is information used to test the program.

[0053] In one implementation, the partition information can be formal information, which is information used for program execution.

[0054] In one embodiment, step S1012 may include steps S10121 to S10123:

[0055] Step S10121: Control the second service module to obtain update message data through the broadcast switch.

[0056] Step S10122: Determine whether the update message data is data of the second service module's own partition based on the marked partition information. If so, proceed to step S10123.

[0057] Step S10123: Obtain the update message data.

[0058] In this implementation, firstly, the second service module listens to the broadcast switch to obtain updated message data from the message queue. Then, based on the marked partition information, it determines whether the updated message data belongs to the second service module's own partition; if so, it obtains the updated message data. The message queue is bound to the broadcast switch. Using the same message queue, this configuration method enables automatic isolation of partitions through marked partition information, improving deployment convenience and cost-effectiveness.

[0059] In one implementation, the update message data can be the update message data of the first service module.

[0060] Step S102: Based on the update frequency of the update data, update the cached data in the second service module according to the update message data.

[0061] In this embodiment, the cached data in the second service module can be updated based on the update frequency of the updated data and the update message data.

[0062] In one implementation, step S102 may include step S1021:

[0063] Step S1021: If the update frequency is less than or equal to the first preset frequency, then delete the cached data corresponding to the update message data in the second service module according to the update message data. When a call instruction corresponding to the update message data is received, obtain the update data through the query interface of the first service module and store the update data in the second service module.

[0064] In this embodiment, when the update frequency is less than or equal to the first preset frequency, i.e. for data with a low update frequency, the cached data corresponding to the update message data in the second service module can be deleted according to the update message data. When a call instruction corresponding to the update message data is received, the update data is obtained through the query interface of the first service module and stored in the second service module.

[0065] In one implementation, the first preset frequency may be once a day.

[0066] In one implementation, the message service module can assign a message ID to the updated message data, and the cached data corresponding to the updated message data in the second service module can be deleted based on the message ID of the updated message data.

[0067] In one embodiment, step S102 may further include step S1022:

[0068] Step S1022: If the update frequency is greater than the second preset frequency and less than or equal to the third preset frequency, when the update message data is received, the update data corresponding to the update message data is obtained through the query interface of the first service module, and the corresponding cached data in the second service module is updated according to the update data.

[0069] In this embodiment, when the update frequency is greater than a second preset frequency and less than or equal to a third preset frequency (i.e., for data with a high update frequency), upon receiving update message data, due to the delay in obtaining the update data corresponding to the update message data using a message queue, the update data corresponding to the update message data can be obtained through the query interface of the first service module. The corresponding cached data in the second service module is then updated based on the update data. In other words, receiving update message data triggers a call to the query interface to ensure timely updates of the corresponding cached data in the second service module. The second preset frequency is greater than or equal to the first preset frequency.

[0070] In one implementation, the second preset frequency can be ten times per day.

[0071] In one implementation, the third preset frequency can be twenty times per day.

[0072] In one embodiment, step S102 may further include step S1023:

[0073] Step S1023: If the update frequency is greater than the fourth preset frequency, then obtain the update data corresponding to the update message data through the message queue and update the corresponding cache data in the second service module according to the update data.

[0074] In this embodiment, when the update frequency is greater than the fourth preset frequency, i.e., for hot data, since obtaining the update data corresponding to the update message data through the query interface of the first service module is inefficient, a message queue can be used to obtain the update data corresponding to the update message data. Then, the corresponding cached data in the second service module is updated according to the update data, ensuring the timely update of the corresponding cached data and preventing cache breakdown.

[0075] In one implementation, the fourth preset frequency could be one thousand times per day.

[0076] By using the above configuration method, different cache data update methods are adopted based on the different update frequencies of the updated data, realizing cache updates in different scenarios and providing a complete distributed service cache update method.

[0077] In one implementation, step S103 may be included before step S102:

[0078] Step S103: Determine whether the version of the updated data is higher than the version of the corresponding cached data in the second service module based on the updated message data. If so, proceed to step S102.

[0079] In this embodiment, it is determined whether the version of the updated data is higher than the version of the corresponding cached data in the second service module based on the update message data. If so, the cached data in the second service module is updated according to the update frequency of the updated data and the update message data.

[0080] Based on steps S101-S102 above, this embodiment of the invention controls the second service module to obtain update message data of the first service module corresponding to the second service module through a message queue. The update message data is the data update information corresponding to the update data of the first service module. Based on the update frequency of the update data, the cached data in the second service module is updated according to the update message data. The first service module is the producer of the update data, and the second service module is the consumer of the update data. Through this configuration, this embodiment of the invention obtains the update message data of the first service module corresponding to the second service module in a timely manner through a message queue, and updates the cached data in the second service module in a timely manner according to the update frequency and update message data. This ensures that the cached data and the updated data in the second service module are consistent, and also ensures that the cached data in the second service module does not expire, effectively preventing the risk of buffer breakdown.

[0081] In one embodiment of the present invention, please refer to the appendix. Figure 2 , Figure 2 This is a schematic flowchart illustrating the main steps of a message queue-based data update method according to an embodiment of the present invention, as shown below. Figure 2 As shown, when Service A (the first service module) modifies a record (data update), ServerVersion (the server version, i.e., the version of the updated data) is incremented by 1, and a bus service call is triggered. The message service module is called through the message bus service, and the message service module pushes the information (updated message data) to the message queue. The message queue service broadcasts the message. Service B (the second service module), based on the broadcast, retrieves the message (updated message data) for its own partition and obtains the LocalVersion (the local version, i.e., the version of the corresponding data in the cache) corresponding to the updated message data in its own cache. If ServerVersion > LocalVersion, cached data processing is required. This processing is asynchronous and can be performed in three ways:

[0082] For data that is updated infrequently, delete the corresponding cache based on the message ID in the message queue.

[0083] For data with a high update frequency, the latest data is retrieved from the processing queue and saved to the cache, incrementing LocalVerision by 1. That is, upon receiving update message data, the basic data interface call of service A is triggered to retrieve the updated data and save it to the cache.

[0084] For hot data, the cached data is updated based on the data transmitted from the message queue, and LocalVersion is assigned the value ServerVersion.

[0085] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders, and these variations are all within the scope of protection of the present invention.

[0086] Furthermore, the present invention also provides a system for data updating based on message queues.

[0087] See appendix Figure 3 , Figure 3 This is a main structural block diagram of a message queue-based data update system according to an embodiment of the present invention. Figure 3 As shown, the data update system based on a message queue in this embodiment of the invention mainly includes a data acquisition module 11 and a data processing module 12. In some embodiments, one or more of the data acquisition module 11 and the data processing module 12 can be combined into a single module. In some embodiments, the data acquisition module 11 can be configured to control a second service module to acquire update message data of a first service module corresponding to the second service module through a message queue. The update message data is the data update information corresponding to the update data of the first service module. The data processing module 12 can be configured to update the cached data in the second service module based on the update frequency of the update data and the update message data. The first service module is the producer of the update data, and the second service module is the consumer of the update data.

[0088] The above-mentioned message queue-based data update system is used for execution Figure 1The illustrated method embodiments for data updating based on message queues are similar in technical principle, the technical problems they solve, and the technical effects they produce. Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process and related descriptions of the system for data updating based on message queues can be found in the embodiments of the method for data updating based on message queues, and will not be repeated here.

[0089] Those skilled in the art will understand that all or part of the processes in the method of the above embodiment of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable storage medium can include any entity or device capable of carrying the computer program code, a medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0090] Furthermore, the present invention also provides a control device. In one embodiment of the control device according to the present invention, the control device includes a processor and a storage device. The storage device can be configured to store a program for executing the message queue-based data update method of the above-described method embodiments. The processor can be configured to execute the program in the storage device, which includes, but is not limited to, a program for executing the message queue-based data update method of the above-described method embodiments. For ease of explanation, only the parts related to the embodiments of the present invention are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. This control device can be a control device device comprising various electronic devices.

[0091] In embodiments of the present invention, the control device may be a control device device comprising various electronic devices. In some possible implementations, the control device may include multiple storage devices and multiple processors. The program executing the message queue-based data update method of the above method embodiments can be divided into multiple subroutines, each subroutine can be loaded and run by a processor to execute different steps of the message queue-based data update method of the above method embodiments. Specifically, each subroutine can be stored in different storage devices, and each processor can be configured to execute programs in one or more storage devices to jointly implement the message queue-based data update method of the above method embodiments, that is, each processor executes different steps of the message queue-based data update method of the above method embodiments to jointly implement the message queue-based data update method of the above method embodiments.

[0092] The aforementioned multiple processors can be processors deployed on the same device. For example, the aforementioned control device can be a high-performance device composed of multiple processors, and the aforementioned multiple processors can be processors configured on that high-performance device. Alternatively, the aforementioned multiple processors can also be processors deployed on different devices. For example, the aforementioned control device can be a service module cluster, and the aforementioned multiple processors can be processors on different service modules within the service module cluster.

[0093] Furthermore, the present invention also provides a computer-readable storage medium. In one embodiment of the computer-readable storage medium according to the present invention, the computer-readable storage medium can be configured to store a program for performing the message queue-based data update method of the above-described method embodiments. This program can be loaded and run by a processor to implement the above-described message queue-based data update method. For ease of explanation, only the parts related to the embodiments of the present invention are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. The computer-readable storage medium can be a storage device comprising various electronic devices. Optionally, in the embodiments of the present invention, the computer-readable storage medium is a non-transitory computer-readable storage medium.

[0094] Furthermore, it should be understood that since the various modules are only provided to illustrate the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the processor's software, hardware, or a combination of software and hardware. Therefore, the number of modules shown in the figures is merely illustrative.

[0095] Those skilled in the art will understand that the various modules in the device can be adaptively split or combined. Such splitting or combining of specific modules will not cause the technical solution to deviate from the principles of the present invention; therefore, the technical solutions after splitting or combining will fall within the protection scope of the present invention.

[0096] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A method for data updating based on a message queue, characterized in that, The method includes: The control second service module obtains update message data of the first service module corresponding to the second service module through a message queue; wherein, the update message data is the data update information corresponding to the update data of the first service module; Based on the update frequency of the updated data, the cached data in the second service module is updated according to the update message data; Wherein, the first service module is the producer of the updated data, and the second service module is the consumer of the updated data; The update frequency based on the updated data, and the updating of the cached data in the second service module according to the updated message data, includes: If the update frequency is less than or equal to the first preset frequency, then the cached data corresponding to the update message data in the second service module is deleted according to the update message data. When a call instruction corresponding to the update message data is received, the update data is obtained through the query interface of the first service module and the update data is stored in the second service module. If the update frequency is greater than the second preset frequency and less than or equal to the third preset frequency, when the update message data is received, the update data corresponding to the update message data is obtained through the query interface of the first service module, and the corresponding cache data in the second service module is updated according to the update data; Wherein, the second preset frequency is greater than or equal to the first preset frequency; If the update frequency is greater than the fourth preset frequency, then the update data corresponding to the update message data is obtained through the message queue and the corresponding cache data in the second service module is updated according to the update data; Wherein, the fourth preset frequency is greater than or equal to the third preset frequency.

2. The data update method based on a message queue according to claim 1, characterized in that, The control second service module obtains update message data corresponding to the first service module through a message queue, including: After obtaining the marked partition information of the updated message data by marking and partitioning the updated message data through the message service module, the updated message data is sent to the message queue through the message service module. The second service module is controlled to obtain the update message data of the first service module corresponding to the second service module through the message queue based on the marked partition information.

3. The data update method based on a message queue according to claim 2, characterized in that, The control of the second service module to obtain update message data of the first service module corresponding to the second service module through the message queue according to the marked partition information includes: The second service module is controlled to obtain the update message data through a broadcast switch; wherein the message queue is bound to the broadcast switch; Based on the marked partition information, determine whether the update message data is data from the second service module's own partition; If so, then obtain the updated message data.

4. The data update method based on a message queue according to claim 1, characterized in that, Before updating the cached data in the second service module based on the update frequency of the updated data and the update message data, the method further includes: Based on the update message data, determine whether the version of the update data is higher than the version of the corresponding cached data in the second service module. If so, update the cached data in the second service module according to the update message data based on the update frequency of the update data.

5. A data update system based on a message queue, characterized in that, The system includes: The data acquisition module is configured to control the second service module to acquire update message data of the first service module corresponding to the second service module through a message queue; The update message data refers to the data update information corresponding to the update data of the first service module. A data processing module is configured to update the cached data in the second service module based on the update frequency of the updated data and the update message data. The update frequency based on the updated data, and the updating of the cached data in the second service module according to the updated message data, includes: If the update frequency is less than or equal to the first preset frequency, then the cached data corresponding to the update message data in the second service module is deleted according to the update message data. When a call instruction corresponding to the update message data is received, the update data is obtained through the query interface of the first service module and the update data is stored in the second service module. If the update frequency is greater than the second preset frequency and less than or equal to the third preset frequency, when the update message data is received, the update data corresponding to the update message data is obtained through the query interface of the first service module, and the corresponding cache data in the second service module is updated according to the update data; Wherein, the second preset frequency is greater than or equal to the first preset frequency; If the update frequency is greater than the fourth preset frequency, then the update data corresponding to the update message data is obtained through the message queue and the corresponding cache data in the second service module is updated according to the update data; Wherein, the fourth preset frequency is greater than or equal to the third preset frequency; The first service module is the producer of the updated data, and the second service module is the consumer of the updated data.

6. A control device comprising at least one processor and at least one storage device, said storage device being adapted to store a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by the processor to perform the message queue-based data update method according to any one of claims 1 to 4.

7. A computer-readable storage medium storing a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by a processor to perform the message queue-based data update method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Distributed data cache management method, device and equipment and storage medium

    CN112039979A

  • Data processing method, apparatus and device, and storage medium

    WO2021169268A1