A data hot updating method and system, a computer device and a storage medium

By configuring a unique identifier and its mapping to microservices in the data management system, and using the unique identifier to notify users of data changes, the problem of microservice cache not being refreshed in a timely manner is solved, achieving efficient hot data updates and improved user experience.

CN117033827BActive Publication Date: 2026-05-29CHINA PING AN LIFE INSURANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA PING AN LIFE INSURANCE CO LTD
Filing Date
2023-07-07
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The inability of data caches between microservices to be refreshed in a timely manner means that all microservices need to be restarted when data changes, which affects user experience and consumes additional time.

Method used

By configuring a unique identifier for target data and a mapping between it and microservices in the data management system, data change notifications can be sent using the unique identifier, enabling microservices to query updated data from the system database and update their caches based on the identifier.

Benefits of technology

It enables precise updates to microservice caches, avoids large-scale restarts, improves the efficiency of hot data updates, ensures user experience, and reduces the occurrence of abnormal errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117033827B_ABST
    Figure CN117033827B_ABST
Patent Text Reader

Abstract

The application relates to the field of data updating, and discloses a data hot updating method and system, a computer device and a storage medium, to solve the problem that microservice data caching cannot be refreshed in time according to requirements. The system comprises a data management system and at least one microservice, and the method comprises the following steps: after target data is acquired, the data management system stores and configures the correspondence between the unique identifier of the target data and the microservice using the target data; it is judged whether a change of the target data is acquired; when the change of the target data is acquired, a data change notification carrying the unique identifier is sent to the microservice. After the microservice acquires the data change notification, the corresponding target data is queried from a system database according to the unique identifier as update data, and the data cached by the microservice is updated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data updating, and more particularly to a method, system, computer device, and storage medium for hot data updating. Background Technology

[0002] As business systems expand, data volumes increase, and content becomes more complex, more and more systems are beginning to divide services into categories based on business modules. Each service is deployed independently and isolated from others; these services are called microservices. Microservices offer excellent high availability. In practical applications, different microservices are called through interfaces to achieve the overall functionality of the application. Microservices can be applied in many scenarios such as appointment booking, electronic medical records, and medical insurance.

[0003] However, in existing technical solutions, microservices typically involve data dependencies. Different microservices need to share some data to varying degrees. Because microservices use data caching, when data changes, the cache may not be refreshed promptly, causing microservices to fail to detect these changes in a timely manner. Therefore, when data changes, a forced restart is often required to update the caches of all microservices. Furthermore, since different microservices use different data, when some data changes, only the corresponding cache needs to be refreshed. Forcing an update of all microservice caches in the traditional way not only consumes extra time but also interrupts user access during service restarts, leading to a degraded user experience. Summary of the Invention

[0004] This invention provides a method, system, computer device, and storage medium for hot data updates to solve the problem that microservice data caches cannot be refreshed in a timely manner according to demand.

[0005] Firstly, a method for hot data updating is provided for a data management system, including:

[0006] After obtaining the target data, the target data is stored in the system database, and the unique identifier of the target data and the correspondence between the microservices that use the target data are configured.

[0007] Determine whether changes to the target data have been detected;

[0008] When a change to the target data is detected, a data change notification carrying the unique identifier is sent to the microservice, so that the microservice can query the corresponding target data from the system database of the data management system according to the unique identifier as the update data, and update the data cached by the microservice according to the update data.

[0009] In one possible design, before sending the data change notification carrying the unique identifier to the microservice, the method further includes:

[0010] A notification function method is constructed, which passes the unique identifier as a parameter to the notification method so that the notification method can query the corresponding microservice based on the unique identifier and construct a data change notification for the microservice carrying the unique identifier.

[0011] In another possible design, the mapping between the unique identifier configuring the target data and the microservices using the target data includes:

[0012] Provide a visual configuration interface to obtain the unique identifier of the target data, the name of the microservice, and the target data set by the user on the configuration interface;

[0013] Obtain the correspondence between the unique identifier configured by the user on the configuration interface and the name of the microservice.

[0014] Secondly, a method for hot data updates is provided for microservices, including:

[0015] Obtain the unique identifier of the target data configured in the data management system, and the correspondence between the identifier and the microservice;

[0016] When the target data changes, after receiving the data change notification sent by the data management system carrying a unique identifier, the corresponding target data is queried from the system database of the data management system according to the unique identifier as the updated data;

[0017] Update the microservice cached data according to the updated data. In one possible design, querying the corresponding target data from the system database of the data management system using the unique identifier as the updated data includes:

[0018] Construct data modification function methods corresponding to each target data;

[0019] Query the corresponding data change function method based on the unique identifier;

[0020] The data modification function method is executed so that the microservice queries the target data corresponding to the unique identifier in the system database of the data management system, and uses the corresponding target data as the update data.

[0021] In another possible design, the method for querying the corresponding data change function based on the unique identifier includes:

[0022] The function method for querying the data modification corresponding to a unique identifier;

[0023] If a data modification function method corresponding to the unique identifier is found, then the corresponding data modification function method is executed;

[0024] If the data modification function method corresponding to the unique identifier cannot be found, the update operation will be terminated.

[0025] In another possible design, updating the microservice cache data according to the updated data includes:

[0026] Iterate through the data cached by the microservice to find the data corresponding to the unique identifier;

[0027] If the data in the microservice cache contains data corresponding to the unique identifier, then the updated data is used to update the data in the microservice cache corresponding to the unique identifier.

[0028] If the data in the microservice cache does not contain data corresponding to the unique identifier, then the updated data is added to the data in the microservice cache.

[0029] Thirdly, a system for hot data updates is provided, including a data management system and at least one microservice.

[0030] The data management system is used to obtain target data, store the target data in the system database, configure a unique identifier for the target data and a microservice that uses the target data, and send a data change notification carrying the unique identifier to the microservice when a change in the target data is obtained, so that the microservice can query the corresponding target data from the system database of the data management system according to the unique identifier as the update data, and update the data cached by the microservice according to the update data.

[0031] The microservice is used to obtain a unique identifier for the target data configured by the data management system and the correspondence between the identifier and the microservice. When the target data changes, after receiving a data change notification carrying a unique identifier sent by the data management system, the microservice queries the corresponding target data from the system database of the data management system according to the unique identifier as the updated data and updates the data cached by the microservice according to the updated data.

[0032] Fourthly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the data management system or microservice in the above-described method for hot data updates.

[0033] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the data management system or microservice in the above-described method for hot data updates.

[0034] The aforementioned method, apparatus, computer equipment, and storage medium for hot data updates involve a data management system that, upon acquiring target data, stores the target data in a system database and configures a unique identifier for the target data and the microservices that use it. This configuration clarifies the relationship between different microservices and the target data, enabling the system to quickly identify the corresponding microservice requiring refresh based on the unique identifier and configuration relationship when the target data changes, effectively improving the efficiency of hot data updates. Furthermore, when the data management system detects a change in the target data, it sends a data change notification carrying the unique identifier to the microservices, causing them to update their cached data. This eliminates the need for large-scale microservice restarts; the microservices receiving the notification only need to re-acquire the target data and refresh their cache to complete the data update, ensuring a better user experience. In addition, during the process of updating data according to the notification, the method configures the correspondence between microservices and target data. This means that when the target data changes, only the specified microservice is queried through the unique identifier, and then the cache of the specified microservice is updated. This process does not require refreshing the cache data of all microservices, which precisely controls the update scope. This prevents other microservices that do not use the target data from making redundant updates, effectively preventing abnormal errors caused by frequent cache refreshes in microservices. Attached Figure Description

[0035] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 This is a schematic diagram of a data hot update system according to an embodiment of the present invention;

[0037] Figure 2 This is a schematic flowchart of a data hot update method in one embodiment of the present invention;

[0038] Figure 3 This is a schematic flowchart of a data hot update method in one embodiment of the present invention;

[0039] Figure 4This is a schematic flowchart of a data hot update method in one embodiment of the present invention;

[0040] Figure 5 This is a schematic flowchart of a data hot update method in one embodiment of the present invention;

[0041] Figure 6 This is a schematic flowchart of a data hot update method in one embodiment of the present invention;

[0042] Figure 7 This is a schematic diagram of a data management system for a computer device according to an embodiment of the present invention. Detailed Implementation

[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0044] The data hot update method provided in this embodiment of the invention can be applied to, for example... Figure 1 The data hot update system shown. Specifically, this data hot update method is applied in a data hot update system, which includes, as shown in the example... Figure 1 The diagram illustrates a data management system and microservices. The data management system communicates with the microservices over a network to process application data and store related configuration information. A microservice refers to a small, independent server that communicates through a well-defined interface; it is easier to expand and develop faster than a large server. The data management system represents the management system for the data shared by the microservices. The data management system can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0045] Medical cloud refers to a cloud platform for healthcare services created using cloud computing, mobile technology, multimedia, 4G communication, big data, and the Internet of Things, combined with medical technology. This platform leverages cloud computing to achieve resource sharing and expand the scope of medical services. Because of the application of cloud computing technology, medical cloud improves the efficiency of medical institutions and facilitates access to healthcare for residents. In the application of medical cloud, many small, independent servers, or microservices, connect to the medical cloud to achieve data sharing while maintaining the independence of each microservice. For example, different appointment registration and electronic medical records for each hospital can connect to the medical cloud to obtain shared data, while ensuring the independence of each hospital's different systems. Therefore, in one embodiment, such as... Figure 2As shown, a data hot update method is provided, which is applied to... Figure 1 Taking a data hot update system as an example, the data management system includes the following steps:

[0046] S10: After obtaining the target data, store the target data in the system database and configure the correspondence between the unique identifier of the target data and the microservices that use the target data.

[0047] After the data management system receives the target data entered by the user, it stores the target data in the system database and sets a unique identifier for the target data based on user input or automatic system configuration. Next, based on which microservices the target data is used on, it sets the mapping between the unique identifier and the microservices.

[0048] The target data includes, but is not limited to, application configuration data, application functional data, and user data. The data management system obtains the target data in ways including, but not limited to, users manually entering the target data through the configuration interface provided by the data management system, and users directly importing the target data into the database management system using text or corresponding formatted files. The unique identifier for the target data is configured in ways including, but not limited to, users customizing the unique identifier for the target data through the configuration interface or when importing data, and it being automatically generated by the data management system. The mapping between the unique identifier and microservices is configured in ways including, but not limited to, users manually specifying the relationship between the unique identifier and microservices through the configuration interface of the data management system, and the data management system directly obtaining the usage relationship between microservices and target data through interfaces.

[0049] The data management system stores the target data, its unique identifier, and the relationship between the unique identifier and the microservice in the system database. Furthermore, each piece of target data can be used by multiple services; that is, a single unique identifier allows the configuration of one or more microservices.

[0050] For example, in a vehicle display application, the configuration data of the main page menu is stored in the system database of the data management system as the target data. The configuration data of the main page menu is generated into a data file according to a specified format, and a unique identifier for the configuration data of that page menu is generated in the data file according to the specified format. Then, the data file is imported into the system database of the data management system from the configuration interface. The data management system will then display the page menu configuration data stored in the current system database, the unique identifiers of the page menu configuration data, and a list of all microservices using the system database in the configuration interface. Users can then modify the unique identifiers, microservice names, and configure the unique identifiers and microservices according to their needs in the configuration interface of the data management system.

[0051] S20: Determine whether the target data has been changed.

[0052] After completing the storage of the target data and configuring the mapping between the target data's unique identifier and the microservices, the data management system needs to determine whether the stored target data has changed. If the target data has changed, proceed to step S30.

[0053] In step S20 of this embodiment, the method for determining whether the target data has changed includes, but is not limited to, methods such as triggering the determination when the target data in the system database is changed by the data management system, or triggering the determination when the user changes the target data from the configuration interface of the data management system.

[0054] S30: When a change to the target data is detected, a data change notification carrying the unique identifier is sent to the microservice, so that the microservice queries the corresponding target data from the system database of the data management system according to the unique identifier as the update data, and updates the data cached by the microservice according to the update data.

[0055] When the data management system detects a change in the target data, it needs to send a notification to each of the microservices corresponding to the target data configured in step S10. Each notification carries a unique identifier for the target data that has changed. Methods for sending data change notifications include, but are not limited to, sending a link containing the unique identifier or calling the notification method through the microservice interface.

[0056] For example, in an organizational structure management application, the data management system originally stored data on the first-level departments of each organization within the application. This first-level department data was used on three microservices: user service, authentication service, and user role service. Therefore, the structure for storing this target data in the data management system is illustrated below:

[0057]

[0058] In the data structure described above, `data` represents the target data, `id` represents the unique identifier of the target data, `relation` represents the three microservices corresponding to the first-level department data, `userService` represents the user service, `authorizeService` represents the authentication service, and `userRoleService` represents the user role service. When the data management system obtains a change in the `data`, it sends a notification with the ID to each of the three microservices stored in the `relation` field of the data management system's system database. That is, it sends a notification with the ID "d95e7e11b9cc47d7b33c254150a73a46" to the user service, authentication service, and user role service, respectively. This allows the three services to obtain the notification that the target data, i.e., the first-level department data, has changed, and update their own data caches based on the ID.

[0059] It should be noted that, in this embodiment, after the data management system obtains the target data, it stores the target data in the system database and configures a unique identifier for the target data and the microservices that use the target data. This configuration clarifies the relationship between different microservices and the target data, so that when the target data changes subsequently, the corresponding microservice that needs to be refreshed can be quickly identified based on the unique identifier and configuration relationship, effectively improving the efficiency of hot data updates. Next, when the data management system detects a change in the target data, it sends a data change notification carrying the unique identifier to the microservice, enabling the microservice to update its cached data. This eliminates the need for large-scale microservice restarts; the corresponding microservice receiving the notification only needs to re-obtain the target data and refresh its cache to complete the data update, ensuring a good user experience.

[0060] In one embodiment, before step S30, that is, before sending the data change notification carrying the unique identifier to the microservice, the data hot update method further includes the following steps:

[0061] S41: Construct a notification function method, pass the unique identifier as a parameter to the notification method, so that the notification method can query the corresponding microservice based on the unique identifier and construct a data change notification for the microservice carrying the unique identifier.

[0062] Before the data management system sends a data change notification, it needs to build a notification function method. This notification function method requires a unique identifier of the target data as a parameter. Then, based on the unique identifier, it queries the system database to find the microservice corresponding to the target data and builds a data change notification carrying the unique identifier. In subsequent steps, the data change notification carrying the unique identifier is sent to the microservice corresponding to the target data retrieved from the system database.

[0063] For example, in step S30, a notification with the ID "d95e7e11b9cc47d7b33c254150a73a46" needs to be sent to the user service, authentication service, and user role service to inform them that the data of the three microservices' first-level departments has changed. Before this, the data management system needs to build a notification function method whose input parameter is ID. The method is illustrated below:

[0064] public void notice(String id){

[0065] String noticeUrl='http: / / xxxx / notice / '+id;

[0066] String microservices=findService(id);

[0067]

[0068] return sendNotice(noticeUrl,microservices);

[0069] }

[0070] As illustrated in the above notification function method, after obtaining the unique identifier `id`, this method constructs a change notification link `noticeUrl`, which carries the `id`. Simultaneously, the method uses the `id` and the system database query method `findService` to retrieve the corresponding microservices `microservices`. Based on the query results, the values ​​of `microservices` are `userService`, `authorizeService`, and `userRoleService`, meaning three microservices are retrieved: User Service, Authentication Service, and User Role Service. Finally, the notification function method sends the data change notification `noticeUrl` to these three microservices sequentially.

[0071] It should be noted that this embodiment constructs a notification function method when sending data change notifications. This method encapsulates the process from the unique identifier to sending the data change notification. Encapsulating this process makes the overall information processing a modular function method, making the overall program logic clearer. Furthermore, the encapsulated notification function method facilitates code reuse, and its encapsulation of the notification sending process improves code security.

[0072] In one embodiment, step S10, which configures the correspondence between the unique identifier of the target data and the microservices using the target data, specifically includes the following steps:

[0073] S11: Provide a visual configuration interface to obtain the unique identifier of the target data, the name of the microservice, and the target data set by the user on the configuration interface.

[0074] S12: Obtain the correspondence between the unique identifier and the name of the microservice configured by the user on the configuration interface.

[0075] The data management system provides a visual configuration interface, allowing users to enter target data. Entry methods include, but are not limited to, providing input boxes for user input and importing data files. After acquiring the target data, the configuration interface provides input boxes for users to enter a unique identifier corresponding to the target data and lists all microservices that use data from the system database. Users can modify the names of microservices and change the mapping between target data and microservices in the configuration interface.

[0076] If the unique identifier obtained by the data management system is empty, the original unique identifier of the target data will be retained without any changes. If the target data did not originally have a unique identifier, then when the data management system obtains an empty unique identifier, it will specify a random value or string as the unique identifier for the target data. This unique identifier includes, but is not limited to, random values ​​and random strings.

[0077] In addition, when the data management system obtains the target data, unique identifier, and microservice name entered by the user in the configuration management interface, the data management system will perform a validity verification on the user's input. This validity verification includes, but is not limited to, unique identifier verification, filtering of illegal strings, and prevention of cross-site scripting attacks.

[0078] It should be noted that the data management system in this embodiment provides a visual configuration interface, which is more conducive to users and developers to input and configure target data, improves the overall operating experience, and has good visual effects and operability.

[0079] In one embodiment, such as Figure 3 As shown, a data hot update method is provided, which is applied to... Figure 1 Taking a data hot update system as an example, the microservice includes the following steps:

[0080] S50: Obtain the unique identifier of the target data configured by the data management system, and the correspondence between the identifier and the microservice.

[0081] Based on the unique identifiers of the target data configured in the data management system and the mapping relationship between these unique identifiers and microservices, the microservices establish a mapping relationship with the target data they use. This facilitates the microservices receiving corresponding data change notifications in subsequent steps.

[0082] S60: When the target data changes, after receiving the data change notification carrying a unique identifier sent by the data management system, the corresponding target data is queried from the system database of the data management system according to the unique identifier as the updated data.

[0083] After receiving a data change notification from the data management system, the microservice retrieves the corresponding target data from the data management system's database based on the unique identifier carried in the notification, and uses that target data as the updated data. The methods for receiving data change notifications include, but are not limited to, receiving notification calls from the data management system through the microservice's open interface, or the microservice listening for notification messages from the data management system.

[0084] S70: Update the data in the microservice cache according to the updated data.

[0085] After a microservice retrieves the target data as update data, it updates the data in its cache accordingly. This updating can be done in several ways, including, but not limited to, refreshing the cache after the microservice performs structural changes on the retrieved update data, or updating all data in its cache upon receiving a data change notification.

[0086] It should be noted that during the process of microservices updating data according to the notification, because the method configures the correspondence between microservices and target data, when the target data changes, only the specified microservice is queried through the unique identifier, and then the cache of the specified microservice is updated. This process does not require refreshing the cache data of all microservices, which precisely controls the update scope. This prevents other microservices that do not use the target data from making redundant updates, effectively preventing abnormal errors caused by frequent cache refreshes in microservices.

[0087] In one embodiment, such as Figure 4 As shown, step S60, which involves querying the corresponding target data from the system database of the data management system according to the unique identifier as the update data, specifically includes the following steps:

[0088] S61: Construct the data modification function method corresponding to each target data.

[0089] S62: Query the corresponding data change function method based on the unique identifier.

[0090] S63: Execute the data change function method so that the microservice queries the target data corresponding to the unique identifier in the system database of the data management system, and uses the corresponding target data as the update data.

[0091] In one embodiment, the microservice declares a listener function method that listens for data change notifications issued by the data management system. When the data management system sends a data change notification for target data used by the microservice, the listener function method learns that the target data has changed through the unique identifier in the data change notification. After learning that the target data has changed, the listener function method queries the corresponding data change function method based on the unique identifier. If a corresponding data change function method is found, it is executed.

[0092] The unique identifier is passed as an input parameter to the data modification function. The functions of the data modification function include, but are not limited to, querying the corresponding target data based on the unique identifier, processing the target data to conform to the data format required by the microservice, and using the target data as update data to perform actions to update the data cached by the microservice.

[0093] In one embodiment, the data change function method will be provided as an open method, allowing microservice developers to customize the data change function method.

[0094] It's worth noting that in this embodiment, the microservice declares an internal listener, or listener function method. This listener ensures that when the data management system receives a unique identifier, a corresponding attribute is available to store the unique identifier, allowing subsequent data modification function methods to use it. Furthermore, this embodiment exposes the data modification function method to developers, allowing them to customize the method. This aligns better with actual development processes, where developers need to process target data differently based on the usage and requirements of different microservices, and then cache the processed data. This makes the entire hot data update process smoother and more efficient.

[0095] In one embodiment, such as Figure 5 As shown, step S62, which involves querying the corresponding data change function method based on the unique identifier, specifically includes the following steps:

[0096] S621: Method for querying the data modification function corresponding to a unique identifier.

[0097] S622: If a data modification function method corresponding to the unique identifier is found, then the corresponding data modification function method is executed.

[0098] S623: If the data change function method corresponding to the unique identifier cannot be found, the update action is terminated.

[0099] In one embodiment, all data modification function methods are exposed to microservice developers, allowing them to customize these methods according to different functional requirements. Therefore, it's possible that developers haven't defined data modification function methods for certain unique identifiers. Thus, in steps S621-S623, this embodiment determines and handles the case where the data modification function method corresponding to the unique identifier does not exist.

[0100] When a microservice's listener function receives a unique identifier, it queries the corresponding data modification function. If no matching function is found, the update process is terminated. If a matching function is found, it is executed.

[0101] It should be noted that since the data modification functions mentioned in steps S61-S63 are open to developers for customization, there is a possibility that developers may not have defined these functions. Therefore, this embodiment includes fault tolerance measures to address this situation, thereby improving the fault tolerance and security of the entire data hot update process.

[0102] In one embodiment, such as Figure 6 As shown, step S70, which involves updating the microservice cache data according to the updated data, specifically includes the following steps:

[0103] S71: Traverse and search for the data corresponding to the unique identifier in the microservice cache.

[0104] S72: If the data in the microservice cache contains data corresponding to the unique identifier, then update the data in the microservice cache corresponding to the unique identifier with the updated data.

[0105] S73: If the data in the microservice cache does not contain data corresponding to the unique identifier, then the updated data is added to the data in the microservice cache.

[0106] In one embodiment, the microservice caches all target data used by the microservice in an in-memory data cache pool. When a microservice receives a data change notification, it needs to traverse and query all cached data in the microservice's data cache pool according to the data change notification. If the corresponding cached data exists, the cached data is updated according to the target data; if the corresponding cached data does not exist, the target data is added to the data cache pool.

[0107] It's worth noting that microservices build in-memory data cache pools to cache data, which effectively alleviates communication latency issues between devices and improves the overall performance and read speed of microservices. For different types of data, local cache updates based on unique identifiers can reduce the frequency of data cache refreshes and improve data cache update efficiency.

[0108] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0109] In one embodiment, a system for hot data updating is provided, and the hot data updating method described in the above embodiments is applied to this system. For example... Figure 1 As shown, the system for hot data updates includes a data management system and at least one microservice. The data management system and each microservice are described in detail below:

[0110] The data management system is used to obtain target data, store the target data in the system database, configure a unique identifier for the target data and a microservice that uses the target data, and send a data change notification carrying the unique identifier to the microservice when a change in the target data is obtained, so that the microservice can query the corresponding target data from the system database of the data management system according to the unique identifier as the update data, and update the data cached by the microservice according to the update data.

[0111] The microservice is used to obtain a unique identifier for the target data configured by the data management system and the correspondence between the identifier and the microservice. When the target data changes, after receiving a data change notification carrying a unique identifier sent by the data management system, the microservice queries the corresponding target data from the system database of the data management system according to the unique identifier as the updated data and updates the data cached by the microservice according to the updated data.

[0112] Specific limitations regarding the data management system and various microservices in the data hot update system can be found in the limitations of the data hot update method described above, and will not be repeated here. The data management system and various microservices in the aforementioned data hot update system can be implemented entirely or partially through software, hardware, or a combination thereof. The aforementioned data management system and various microservices can be embedded in hardware or independent of the processor in the computer device, or they can be stored in software in the memory of the computer device, so that the processor can call and execute the corresponding operations of the above modules.

[0113] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The system database stores target data, unique identifiers for the target data, and relationships between the identifiers of the target data and the microservices using the target data. The network interface of the computer device communicates with external terminals via a network connection. When executed by the processor, the computer program implements a method for hot data updates.

[0114] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program to implement a data management system, the following steps are included:

[0115] After obtaining the target data, the target data is stored in the system database, and the unique identifier of the target data and the correspondence between the microservices that use the target data are configured.

[0116] Determine whether changes to the target data have been detected;

[0117] When a change to the target data is detected, a data change notification carrying the unique identifier is sent to the microservice, so that the microservice can query the corresponding target data from the system database of the data management system according to the unique identifier as the update data, and update the data cached by the microservice according to the update data.

[0118] The process of executing computer programs to implement microservices includes the following steps:

[0119] Obtain the unique identifier of the target data configured in the data management system, and the correspondence between the identifier and the microservice;

[0120] When the target data changes, after receiving the data change notification sent by the data management system carrying a unique identifier, the corresponding target data is queried from the system database of the data management system according to the unique identifier as the updated data;

[0121] Update the data in the microservice cache according to the updated data.

[0122] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon. When the computer program is executed by a processor to implement a data management system, the following steps are included:

[0123] After obtaining the target data, the target data is stored in the system database, and the unique identifier of the target data and the correspondence between the microservices that use the target data are configured.

[0124] Determine whether changes to the target data have been detected;

[0125] When a change to the target data is detected, a data change notification carrying the unique identifier is sent to the microservice, so that the microservice can query the corresponding target data from the system database of the data management system according to the unique identifier as the update data, and update the data cached by the microservice according to the update data.

[0126] When a computer program is executed by a processor to implement microservices, the following steps are included:

[0127] Obtain the unique identifier of the target data configured in the data management system, and the correspondence between the identifier and the microservice;

[0128] When the target data changes, after receiving the data change notification sent by the data management system carrying a unique identifier, the corresponding target data is queried from the system database of the data management system according to the unique identifier as the updated data;

[0129] Update the data in the microservice cache according to the updated data.

[0130] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0131] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0132] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for hot data updating, used in a data management system, characterized in that, include: After obtaining the target data, the target data is stored in the system database, and the unique identifier of the target data and the correspondence between the microservices that use the target data are configured. Determine whether changes to the target data have been detected; When a change to the target data is detected, a data change notification carrying the unique identifier is sent to the microservice, so that the microservice can query the corresponding target data from the system database of the data management system according to the unique identifier as the update data, and update the data cached by the microservice according to the update data; Before sending the data change notification carrying the unique identifier to the microservice, the method further includes: constructing a notification function method, passing the unique identifier as a parameter to the notification function method, so that the notification function method can query the corresponding microservice based on the unique identifier and construct the data change notification carrying the unique identifier for the microservice. After obtaining the unique identifier of the parameter, the notification function method constructs a change notification link, which carries the unique identifier; the change notification link is sent to the microservice, and the microservice declares an internal listener, which enables a corresponding attribute to store the unique identifier when it is passed in.

2. The data hot update method as described in claim 1, characterized in that, The mapping relationship between the unique identifier configured for the target data and the microservices that use the target data includes: Provide a visual configuration interface to obtain the unique identifier of the target data, the name of the microservice, and the target data set by the user on the configuration interface; Obtain the correspondence between the unique identifier configured by the user on the configuration interface and the name of the microservice.

3. A method for hot data updates in microservices, characterized in that, include: Obtain the unique identifier of the target data configured in the data management system, and the correspondence between the identifier and the microservice; When the target data changes, after receiving the data change notification sent by the data management system carrying a unique identifier, the corresponding target data is queried from the system database of the data management system according to the unique identifier as the updated data; Update the data in the microservice cache according to the updated data; The step of querying the corresponding target data from the system database of the data management system according to the unique identifier as update data includes: constructing a data change function method; querying the corresponding data change function method according to the unique identifier; and executing the data change function method so that the microservice queries the target data corresponding to the unique identifier in the system database of the data management system and uses the corresponding target data as update data. Before the data management system sends the data change notification carrying the unique identifier to the microservice, the method further includes: the data management system constructing a notification function method, passing the unique identifier as a parameter to the notification function method, so that the notification function method can query the corresponding microservice based on the unique identifier and construct the data change notification carrying the unique identifier for the microservice. After obtaining the unique identifier of the parameter, the notification function method constructs a change notification link, which carries the unique identifier; the change notification link is sent to the microservice, and the microservice declares an internal listener, which enables a corresponding attribute to store the unique identifier when it is passed in.

4. The data hot update method as described in claim 3, characterized in that, The method for querying the corresponding data change function based on the unique identifier includes: The function method for querying the data modification corresponding to a unique identifier; If a data modification function method corresponding to the unique identifier is found, then the corresponding data modification function method is executed; If the data modification function method corresponding to the unique identifier cannot be found, the update operation will be terminated.

5. The data hot update method as described in claim 3, characterized in that, The step of updating the microservice cache data according to the updated data includes: Iterate through the data cached by the microservice to find the data corresponding to the unique identifier; If the data in the microservice cache contains data corresponding to the unique identifier, then the updated data is used to update the data in the microservice cache corresponding to the unique identifier. If the data in the microservice cache does not contain data corresponding to the unique identifier, then the updated data is added to the data in the microservice cache.

6. A system for hot data updates, characterized in that, The system for hot data updates includes a data management system and at least one microservice. The data management system is used to obtain target data, store the target data in the system database, configure a unique identifier for the target data and a microservice that uses the target data, and send a data change notification carrying the unique identifier to the microservice when a change in the target data is obtained, so that the microservice can query the corresponding target data from the system database of the data management system according to the unique identifier as the update data, and update the data cached by the microservice according to the update data. The microservice is used to obtain a unique identifier for the target data configured by the data management system, and the correspondence between the identifier and the microservice; When the target data changes, after receiving the data change notification sent by the data management system carrying a unique identifier, the corresponding target data is queried from the system database of the data management system according to the unique identifier as the updated data; Update the data in the microservice cache according to the updated data; Before sending the data change notification carrying the unique identifier to the microservice, the data management system constructs a notification function method and passes the unique identifier as a parameter to the notification function method so that the notification function method can query the corresponding microservice based on the unique identifier and construct the data change notification carrying the unique identifier for the microservice. After obtaining the unique identifier, the notification function method constructs a change notification link, which carries the unique identifier. The change notification link is then sent to the microservice. The microservice declares an internal listener, which ensures that when the unique identifier is passed in, there is a corresponding attribute to store the unique identifier.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the data management system steps in the data hot update method as described in any one of claims 1 to 2, or the microservice steps in the data hot update method as described in any one of claims 3 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the data management system in the data hot update method as described in any one of claims 1 to 2, or the steps of the microservices in the data hot update method as described in any one of claims 3 to 5.