Cache method, device, medium and program product of server management software front end

By receiving data update events, updating the target view component according to field priority, and using inverted indexes to map and query data objects, the problem of low data caching efficiency in the front end of server management software is solved, achieving efficient data updates and queries and improving interface performance.

CN120804200BActive Publication Date: 2025-11-28LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511300442.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-12
Publication Date
2025-11-28
Estimated Expiration
2045-09-12

AI Technical Summary

Technical Problem

The data caching on the front end of the server management software relies on the browser's native mechanism, which leads to problems such as data packet failure due to field changes, inefficient query and update operations, and invalid rendering of view components.

Method used

By receiving data update events, the target view component is updated according to field priority. The data object is queried using the inverse index mapping and obtained in the main data mapping. A caching method with fields as the smallest unit is adopted to avoid invalid rendering and frequent updates of irrelevant components.

Benefits of technology

Significantly reduce network traffic, prevent data packets from becoming invalid due to field changes, improve interface performance and query efficiency, and avoid invalid rendering of irrelevant components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804200B_ABST
    Figure CN120804200B_ABST
Patent Text Reader

Abstract

The application discloses a kind of server management software front-end cache method, equipment, medium and program product, it is related to server management software technical field, comprising: receiving data update event;Data update event is generated for the field of data object that change listener listens to be modified;According to data update event, according to the priority of the field that is modified, update corresponding field in target view component;Target view component is view component that subscribes the field that is modified;Receive the query request of view layer where target view component is located, and according to the value corresponding to the key carried in query request in reverse index mapping inquires;According to value, the data object corresponding to value is acquired in main data mapping, and data object is returned to view layer.The method can solve the problem that entire data packet is invalid due to field change, the problem of low efficiency in executing complex data operations such as query and updating data and the problem of invalid rendering of view component.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of server management software, and particularly relates to a cache method, device, medium and program product of a front end of server management software. BACKGROUND

[0002] In the related art, the front end of server management software performs data caching depending on a native mechanism or a general scheme provided by a browser. However, the related art has a problem that an entire data object is invalidated due to field changes. In addition, the related art has a problem of inefficient rendering of a view component. Therefore, how to solve the above technical defects has become a technical problem to be solved by the person skilled in the art. SUMMARY

[0003] The present application provides a cache method, device, medium and program product of a front end of server management software, to at least solve the problems of invalidation of an entire data object due to field changes, inefficient rendering of a view component, and inefficient execution of complex data operations such as queries and data updates in the related art.

[0004] The present application provides a cache method of a front end of server management software, comprising:

[0005] receiving a data update event; the data update event is generated by a change listener when a field of a data object is modified;

[0006] updating, according to the data update event, a corresponding field in a target view component according to a priority of the modified field; the target view component is a view component that subscribes to the modified field;

[0007] receiving a query request of a view layer where the target view component is located, and querying, according to the query request, a value corresponding to a key carried by the query request in a reverse index mapping;

[0008] obtaining, according to the value, a data object corresponding to the value in a main data mapping, and returning the data object to the view layer.

[0009] The present application also provides a cache device of a front end of server management software, comprising:

[0010] a first receiving module configured to receive a data update event; the data update event is generated by a change listener when a field of a data object is modified;

[0011] an updating module configured to update, according to the data update event, a corresponding field in a target view component according to a priority of the modified field; the target view component is a view component that subscribes to the modified field;

[0012] The second receiving module is configured to receive a query request of a view layer in which the target view component is located, and query, according to the query request, a value corresponding to a key carried by the query request in the reverse index mapping;

[0013] The obtaining module is configured to obtain a data object corresponding to the value in the primary data mapping according to the value, and return the data object to the view layer.

[0014] The application further provides an electronic device, comprising a memory configured to store a computer program, and a processor configured to execute the computer program to implement the steps of the cache method of the server management software front end.

[0015] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the cache method of the server management software front end.

[0016] The application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of the cache method of the server management software front end.

[0017] The server management software front end cache method provided by the application updates in the field as the minimum unit, can significantly reduce network traffic, and can avoid the problem that the entire data packet is invalid due to field changes in the related scheme of caching in the entire API response or file unit. In addition, the server management software front end cache method provided by the application only updates the view component that subscribes to the modified field, can avoid invalid rendering of irrelevant components, and improves the interface performance. When querying data, the corresponding value is first found in the reverse index mapping, and then the complete data object corresponding to the value is taken out from the primary data mapping, so that the entire data set is avoided to be traversed, and the query efficiency can be greatly improved. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0019] Figure 1 A flowchart of a server management software front end cache method provided by an embodiment of the application is shown in the figure.

[0020] Figure 2An architecture diagram of a cache system of a server management software is provided for an embodiment of the present application.

[0021] Figure 3 A signal interaction schematic diagram is provided for an embodiment of the present application.

[0022] Figure 4 An assembly interaction schematic diagram is provided for an embodiment of the present application.

[0023] Figure 5 A cache control schematic diagram is provided for an embodiment of the present application.

[0024] Figure 6 A browser comparison schematic diagram is provided for an embodiment of the present application.

[0025] Figure 7 A cache device schematic diagram of a server management software front end is provided for an embodiment of the present application. DETAILED DESCRIPTION

[0026] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0027] It should be noted that, in the description of the present application, the terms "comprise", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0028] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0029] Embodiments of the present application provide a cache method of a server management software front end. The method will be described in detail below in combination with the execution flow of the method.

[0030] Reference Figure 1 As shown in the figure, the cache method of the server management software front end provided by the embodiments of the present application comprises:

[0031] S101: receiving a data update event; the data update event is generated by a change listener when a field of a data object is modified.

[0032] S102: updating a corresponding field in a target view component according to the data update event and a priority of the modified field; the target view component is a view component that subscribes to the modified field.

[0033] The execution subject of the embodiment of the application is a cache control layer in a cache system of a server management software front end. Referring to Figure 2 The cache system includes a view layer, a cache control layer, and a data storage layer. The view layer provides an API interface for interacting with the cache system. The cache control layer is responsible for cache strategies, event processing, version management, etc. The data storage layer stores actual cached data objects and their indexes, and supports IndexedDB (indexed database) and memory storage. IndexedDB is a client-side non-relational database provided by a browser, and supports storing structured cloned objects, files, etc. The signal interaction between the cache control layer and the view layer, the data storage layer, the change listener, and the synchronization engine can be referred to Figure 3 .

[0034] The change listener continuously monitors changes in data objects in the data storage layer. When the change listener detects that any field of a data object is modified, the change listener generates a data change event. The data change event can include the ID of the modified data object, information of the modified field (i.e., which fields are modified), the value of the modified field after modification, and the data version number.

[0035] The cache control layer includes an event dispatcher. The change listener sends the data update event to the event dispatcher.

[0036] The event dispatcher updates a corresponding field in a target view component according to the priority of the modified field, so as to update the value of the corresponding field in the target view component to the value of the modified field after modification. The target view component is a view component that subscribes to the modified field.

[0037] Updating in the field as the smallest unit can significantly reduce network traffic, and can avoid the problem of invalidation of the entire data packet due to field changes in related solutions that cache in the unit of an entire API response or file. After the field is modified, only the view component that subscribes to the modified field is updated, which can avoid invalid rendering of irrelevant components and improve interface performance.

[0038] The view layer provides a unified API interface, which can be used for adding, deleting, querying, and updating operations.

[0039] interface CacheAPI {

[0040] getServer(id: string): ServerObject; / / Get single server data by ID

[0041] queryServers(criteria: QueryCriteria): ServerObject[]; / / Query server collection by criteria

[0042] updateServer(patch: ServerPatch): void; / / Update server data (support field level patch)

[0043] batchUpdate(patches: ServerPatch[]): void; / / Batch update

[0044] }。

[0045] When a view component fetches data by getServer or queryServers, it needs to declare the data range it depends on. For example, it depends on the cpuUsage and memoryUsage fields of the server with ID srv-001.

[0046] The cache control layer records the subscription relationship between view components and data.

[0047] When the event dispatcher dispatches an event, it accurately matches which components subscribe to the modified fields, and only updates the view components that subscribe to the modified fields.

[0048] In some embodiments, updating the corresponding fields in the target view component according to the priority of the modified fields includes:

[0049] If the priority of the modified field is the first priority, the modified field is directly packaged and sent to the target view component for updating.

[0050] If the priority of the modified field is the second priority, the modified field is packaged and sent to the target view component for updating after a preset time, together with other modified fields within the preset time.

[0051] If the priority of the modified field is the first priority, i.e., high priority, for example, the modified field is a critical alarm field, and its priority is the first priority, the modified field is directly packaged and sent to the target view component for updating.

[0052] If the priority of the modified field is the second priority, i.e., the middle-low priority, for example, the modified field is a non-core configuration, and the priority of the modified field is the second priority, after a preset time, the modified field and other modified fields within the preset time are packaged and sent to the target view component in batches for updating. The priority of the other modified fields within the preset time is the second priority. For example, the preset time is 50 ms, and after 50 ms, the modified field and other modified fields within 50 ms are packaged and sent to the target view component in batches for updating.

[0053] In this embodiment, the field is updated according to the priority of the field. For the field of the first priority, the millisecond-level reaction to the interface can be realized, and the interval delay of the polling is avoided. For the field of the second priority, the update is delayed and performed in batches, and the frequent update can be avoided.

[0054] The priority of the field can be defined by the cache controller of the cache control layer. In addition, the cache controller can dynamically calculate the storage weight and make decisions according to the data type, access frequency, memory / storage pressure and other information.

[0055] For the first priority data, i.e., the high priority data (for example, real-time alarm data), the data is stored in the memory preferentially, and a short automatic invalidation time or a strong dependent event update is set.

[0056] For the second priority data, i.e., the middle priority data (for example, server configuration data), the data is stored in the memory or IndexedDB on demand, and a moderate update strategy is set.

[0057] For the third priority data, i.e., the low priority data (for example, an archive log), the data is stored in the IndexedDB, and a manual refresh or a timing update is relied on.

[0058] Therefore, in some embodiments, the method further includes:

[0059] The data object is stored according to the priority of the data object.

[0060] If the data object is the first priority data, the data object is stored in the memory preferentially, and an automatic invalidation time or a strong dependent event update is set.

[0061] If the data object is the second priority data, the data object is stored in the memory or IndexedDB.

[0062] If the data object is the third priority data, the data object is stored in the IndexedDB, and a manual refresh or a timing update is relied on.

[0063] In some embodiments, the method further includes:

[0064] When the data update event is a target event, the modified field is synchronized to a target object; the target event is an event that requires the modified field to be synchronized to a backend or a client; and the target object is the backend or the client.

[0065] For fields that need to be synchronized to the backend or other clients, the modified fields are transmitted to the backend or other clients for synchronization by a synchronization engine. The synchronization engine is responsible for communication with the backend and other clients. The synchronization engine only transmits the changed fields instead of the entire data object. The synchronization engine performs network transmission, confirmation, and retry when transmission fails, etc.

[0066] Synchronizing data in the field as the minimum unit can reduce network traffic.

[0067] S103: Receive a query request of a view layer in which the target view component is located, and according to the query request, query a value corresponding to a key carried by the query request in a reverse index mapping.

[0068] S104: Obtain a data object corresponding to the value in a main data mapping according to the value, and return the data object to the view layer.

[0069] The data storage layer adopts a double Map structure, including a main data Map, i.e., a main data mapping, and a reverse index Map, i.e., a reverse index mapping. The main data Map is used to store complete data objects (for example, ServerObject). The key (Key) in the main data Map is a unique identifier (for example, server ID). The value is the complete data object corresponding to the key. The reverse index Map is used to construct various query indexes to achieve fast data object lookup. The key (Key) in the reverse index Map is a query condition (for example, RACK_LOCATION:A-12, CPU_USAGE:>90, TAG:critical), and the value (Value) is a set of keys in the main data Map that meet the query condition (for example, [‘srv-001’, ‘srv-005’]).

[0070] The cache control layer includes a cache controller. The cache controller receives a query request from the view layer, and according to the query request, first queries a value corresponding to a key carried by the query request in the reverse index Map, i.e., finds a set of keys in the main data Map that meet the query condition. Then, according to the queried value, obtains a data object corresponding to the value in the main data Map, and returns the data object to the view layer.

[0071] When querying data objects in this embodiment, the cache control layer first looks up the corresponding keys in the reverse index Map, and then takes out the complete data objects corresponding to these keys from the main data Map, thus avoiding traversal of the entire data set and greatly improving query efficiency (close to O(1) complexity).

[0072] In some embodiments, obtaining the data objects corresponding to the values in the main data map according to the values comprises:

[0073] If the values are located in different shards, determining the shards in which the values are located;

[0074] Sending query requests to the shards in parallel;

[0075] Receiving and aggregating the data objects corresponding to the values returned by the shards.

[0076] Sharding refers to dividing a large data set into smaller and more manageable parts. If the corresponding values found in the reverse index map according to the keys carried by the query request are scattered in multiple shards, the shards to which the values belong are determined, and query requests are initiated to these shards in parallel. Each shard independently performs the query, finds the data objects using its internal double Map structure, and returns the found data objects. The cache control layer aggregates the data objects returned by the shards and returns the final result to the view layer.

[0077] For example, the view layer initiates a query request through CacheAPI.queryServers(), such as "get all servers of A-12 rack".

[0078] The cache control layer receives the query request, looks up the value corresponding to the key RACK_LOCATION:A-12 (a set of server ID, such as ['srv-001','srv-003',...]) in the reverse index Map.

[0079] If the values are scattered in multiple shards, the shards to which the values belong are determined.

[0080] Query requests are initiated to these shards (each shard can run in an independent Web Worker thread to improve performance) in parallel: "return the server objects in the shard whose ID is in the set ['srv-001','srv-003',...]".

[0081] Each shard independently performs the query (using its internal double Map structure to quickly locate) and returns the result.

[0082] The cache control layer aggregates the results returned by all shards. The final result is returned to the view layer.

[0083] The reverse index Map and the parallel query of the shards can greatly optimize the efficiency of complex data retrieval, and the complex data retrieval performance can be improved by more than 10 times.

[0084] In some embodiments, further comprising:

[0085] When the local version number of the data object is higher than the received update version number, the corresponding data object is not modified;

[0086] When the locally modified field and the received modified field do not overlap, the locally modified object and the received modified field are merged.

[0087] When the locally and remotely modified fields are the same, the locally modified field, the remotely modified field, and the original version of the field are compared, and when it is determined according to the comparison result that the locally modified field and the remotely modified field exist conflict, an alarm is given for manual processing.

[0088] When a batch operation is received, each operation is sorted according to the logical time of the operation and each operation is executed in sequence.

[0089] When the data object is damaged and cannot be recovered according to the data version number, the data object is rolled back to the nearest checkpoint backup.

[0090] The cache control layer includes a data version manager. The data version manager is used to control the data version, solve the read-write conflict in the distributed high-concurrency environment, realize the data rollback, and provide the operation safety net mechanism. When the data versions do not conflict, the data is operated according to the normal process. When the data versions exist conflict, different processing modes are taken according to different conflict types.

[0091] The conflict types include version lag, non-overlapping field modification, field conflict, batch operation, and data damage.

[0092] If the conflict type is version lag, that is, the local version number is higher than the received update version number, the corresponding data object is not modified. The local version number refers to the version number that has been updated locally. The update version number refers to the version number that has not been updated locally.

[0093] If the conflict type is non-overlapping field modification, that is, the locally modified field and the received modified field do not overlap, the locally modified object and the received modified field are merged.

[0094] If the conflict type is field conflict, that is, the locally and remotely modified fields are the same, the locally modified field, the remotely modified field, and the original version of the field are compared to determine that the locally modified field and the remotely modified field exist conflict, and an alarm is given for manual processing.

[0095] If the conflict type is batch operation, each operation is sorted according to the logical time of the operation and executed in order. The logical time of the operation is the time when the operation is generated.

[0096] If the conflict type is data corruption, i.e. the data object is corrupted and cannot be recovered according to the data version number, the system rolls back to the nearest checkpoint. In this case, the checkpoint backup of the data object is created regularly, so that when the data object is corrupted and cannot be recovered according to the data version number, the system rolls back to the nearest checkpoint.

[0097] In some embodiments, further comprising:

[0098] receiving an update request;

[0099] updating the target object according to the update request; the target object is a part of the field of the data object or the whole data object.

[0100] Referring to Figure 4 As shown, the cache control layer receives the update request sent by the view layer, and writes the update to the data storage layer according to the update request. After writing the update, the data change is triggered, the change listener publishes a notification to the cache controller, the cache controller sends a synchronization instruction to the synchronization engine, and then the synchronization engine synchronizes the changed data to the backend or other clients, and writes back the confirmation. The cache controller sends an update confirmation to the view layer.

[0101] In some embodiments, further comprising:

[0102] When the local update data is completed or the modified field is synchronized to the target object, the data version number of the data object is updated.

[0103] After the local confirmation of the update or the receipt of the confirmation of the successful synchronization of the synchronization engine, the data version number corresponding to the related data is updated.

[0104] In some embodiments, further comprising:

[0105] receiving a data deletion event; the data deletion event is generated by the event listener when the field of the data object or the data object is deleted;

[0106] According to the data deletion event, the corresponding view component is notified to remove the corresponding part.

[0107] Referring to Figure 5As shown, when the event listener detects that a field of a data object or the data object is deleted, a data deletion event is generated. The data deletion event can include the ID of the data object and information of the deleted part. The event dispatcher notifies the corresponding view component to remove the deleted part according to the data deletion event. In addition, the event dispatcher can record a deletion log and trigger a synchronous deletion.

[0108] In some embodiments, notifying the corresponding view component to remove the corresponding part according to the data deletion event includes:

[0109] Notifying the corresponding view component to remove the corresponding part according to the priority of the deleted part.

[0110] If the deleted part is a field, notifying the corresponding view component to remove the deleted field according to the priority of the field;

[0111] If the deleted part is a data object, notifying the corresponding view component to remove the deleted data object according to the priority of the data object.

[0112] The embodiments set priorities for fields and data objects, and notify the corresponding view component to remove the deleted part according to the priority of the field and the priority of the data object, so that the view component can more accurately perform data deletion.

[0113] In some embodiments, notifying the corresponding view component to remove the corresponding part according to the priority of the deleted part includes:

[0114] If the deleted part is a field and the priority of the field is a first priority, directly notifying the corresponding view component to remove the corresponding field;

[0115] If the deleted part is a field and the priority of the field is a second priority, notifying the corresponding view component to remove the deleted field and other deleted fields within a second preset time after a delay of the second preset time.

[0116] The embodiments delete fields according to the priority of the fields. The deletion of the field with the first priority can make the reaction of the field to the interface within milliseconds, avoiding the interval delay of the polling. The deletion of the field with the second priority can notify the corresponding view component to delete in batches, avoiding frequent notification of the view component.

[0117] In some embodiments, the method further includes:

[0118] Determining a target data object according to a historical access situation of the view component to the data object;

[0119] Preloading the target data object to the view component.

[0120] The target data object can be a frequently accessed or critically monitored data object in the view component. For frequently accessed data objects, pre-load them into the view component instead of loading them only after receiving a query request. This allows the target data object to be displayed on the interface more promptly. For example, if the target data object is the server status of a high-failure rack, pre-loading the server status of such racks ensures that their status is displayed on the interface immediately, making it convenient for relevant personnel to view.

[0121] In some embodiments, preloading the target data object into the view component includes:

[0122] The target data object is preloaded into the view component using dedicated loading resources.

[0123] A dedicated loading resource is responsible for loading the target data object into the view component. When loading the target data object is not required, the dedicated loading resource remains idle and is not used for other tasks. When loading the target data object is needed, the dedicated loading resource works to load the target data object into the view component.

[0124] Based on the caching method provided in the above embodiments of the present invention, different schemes can be adopted to ensure compatibility depending on the browser version. For example, refer to... Figure 6 As shown, modern browsers can use IndexedDB. Older browsers can use LocalStorage.

[0125] In summary, the caching method for the server management software front-end provided by this invention updates data at the field level, significantly reducing network traffic and avoiding the problem of entire data packets becoming invalid due to field changes, which is common in caching solutions that cache entire API responses or files. Furthermore, the caching method only updates view components that subscribe to the modified fields, avoiding invalid rendering of irrelevant components and improving interface performance. When querying data, the corresponding values ​​are first found in the inverted index mapping, and then the complete data objects corresponding to these values ​​are retrieved from the master data mapping. This avoids traversing the entire dataset, greatly improving query efficiency.

[0126] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0127] Embodiments of the present invention also provide a caching device for the front end of server management software, see reference. Figure 7 As shown, the device includes:

[0128] The first receiving module 10 is configured to receive a data update event; the data update event is generated by a change listener when a field of a data object is modified;

[0129] The updating module 20 is configured to update a corresponding field in a target view component according to the data update event and a priority of the modified field; the target view component is a view component that subscribes to the modified field.

[0130] The second receiving module 30 is configured to receive a query request of a view layer where the target view component is located, and query a value corresponding to a key carried by the query request in the reverse index mapping according to the query request.

[0131] The obtaining module 40 is configured to obtain a data object corresponding to the value in a master data mapping according to the value, and return the data object to the view layer.

[0132] In the above embodiment, as a specific implementation, the updating module 20 comprises:

[0133] The first updating unit is configured to directly send the modified field to the target view component for updating if the priority of the modified field is a first priority.

[0134] The second updating unit is configured to delay a preset time and then send the modified field and other modified fields within the preset time to the target view component for updating if the priority of the modified field is a second priority.

[0135] In the above embodiment, as a specific implementation, the obtaining of the data object corresponding to the value in the master data mapping according to the value comprises:

[0136] The shard determining unit is configured to determine a shard where the value is located if the value is located in different shards.

[0137] The query request sending unit is configured to send query requests to the shards in parallel.

[0138] The aggregation unit is configured to receive and aggregate the data objects corresponding to the values returned by the shards.

[0139] In the above embodiment, as a specific implementation, the method further comprises:

[0140] The synchronization module is configured to synchronize the modified field to a target object when the data update event is a target event; the target event is an event that needs to synchronize the modified field to a backend or a client; and the target object is the backend or the client.

[0141] On the basis of the above-mentioned embodiments, as a specific implementation, further comprising:

[0142] The version management module is configured to, when the local version number of the data object is higher than the received update version number, not modify the corresponding data object; when the locally modified field and the received modified field do not overlap, merge the locally modified object and the received modified field; when the locally and remotely modified fields are the same, compare the locally modified field, the remotely modified field and the original version of the field, and when it is determined according to the comparison result that the locally modified field and the remotely modified field exist conflict, an alarm is given for manual processing; when a batch operation is received, the operations are sorted according to the logical time of the operation and the operations are executed in sequence; when the data object is damaged and cannot be recovered according to the data version number, the data object is rolled back to the nearest checkpoint backup.

[0143] On the basis of the above-mentioned embodiments, as a specific implementation, further comprising:

[0144] The third receiving module is configured to receive an update request.

[0145] The target object updating module is configured to update a target object according to the update request; the target object is a part of a field of the data object or the entire data object.

[0146] On the basis of the above-mentioned embodiments, as a specific implementation, further comprising:

[0147] The data version number updating module is configured to, when the local update data is completed or the modified field is synchronized to the target object, update the data version number of the data object.

[0148] On the basis of the above-mentioned embodiments, as a specific implementation, further comprising:

[0149] The fourth receiving module is configured to receive a data deletion event; the data deletion event is generated by an event listener when a field of a data object or the data object is deleted.

[0150] The notification module is configured to, according to the data deletion event, notify a corresponding view component to remove a corresponding part.

[0151] On the basis of the above-mentioned embodiments, as a specific implementation, the notification module is configured to:

[0152] According to the priority of the deleted part, the notification module is configured to notify a corresponding view component to remove a corresponding part.

[0153] On the basis of the above-mentioned embodiments, as a specific implementation, the notification module comprises:

[0154] The first notifying unit is configured to notify the corresponding view component to remove the corresponding field directly if the deleted part is a field and the priority of the field is the first priority.

[0155] The second notifying unit is configured to notify the corresponding view component to remove the deleted field and other deleted fields within a second preset time after delaying for the second preset time if the deleted part is a field and the priority of the field is the second priority.

[0156] On the basis of the above-mentioned embodiments, as a specific implementation, the method further comprises:

[0157] The target data object determining module is configured to determine a target data object according to historical access of the view component to the data object.

[0158] The preloading module is configured to preload the target data object to the view component.

[0159] On the basis of the above-mentioned embodiments, as a specific implementation, the preloading module is configured to:

[0160] Preload the target data object to the view component through a dedicated processing resource.

[0161] The server management software front-end cache device provided by the application updates in the field as the minimum unit, which can significantly reduce network traffic and avoid the problem of invalidation of the entire data packet caused by field changes in the related scheme of caching in the unit of the entire API response or file. In addition, the server management software front-end cache device provided by the application only updates the view component that subscribes to the modified field, which can avoid invalid rendering of irrelevant components and improve interface performance. When querying data, the corresponding values are first searched in the reverse index mapping, and then the complete data object corresponding to the values is taken out from the main data mapping, which avoids traversing the entire data set and greatly improves the query efficiency.

[0162] The features of the embodiments of the server management software front-end cache device can be referred to the related description of the embodiments of the server management software front-end caching method, which will not be repeated here.

[0163] The embodiments of the application also provide an electronic device comprising a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned server management software front-end caching method embodiments.

[0164] The electronic device provided by the application can update in a field as a minimum unit, can significantly reduce network traffic, and can avoid the problem of invalidation of the entire data packet caused by field changes in the related solution of caching in the unit of an entire API response or file. In addition, the electronic device provided by the application can only update the view component subscribing to the modified field, can avoid invalid rendering of irrelevant components, and improves the interface performance. When querying data, the corresponding values are first searched in the reverse index mapping, and then the complete data object corresponding to the values is taken out from the main data mapping, so that the entire data set is avoided to be traversed, and the query efficiency can be greatly improved.

[0165] The embodiment of the application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program.

[0166] In an example embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media capable of storing a computer program.

[0167] The embodiment of the application further provides a computer program product, and the computer program product includes a computer program.

[0168] The embodiment of the application further provides another computer program product, and the computer program product includes a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program.

[0169] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.

[0170] The above describes in detail the cache method, device, medium and program product of the server management software front end provided by the application. The principles and implementation manners of the application are described by using specific examples in this paper, and the above description of the examples is only applicable to helping understand the method of the application and the core idea thereof. It should be pointed out that, for those skilled in the art, some improvements and modifications can be made to the application without departing from the principles of the application, and these improvements and modifications also fall within the protection scope of the application.

Claims

1. A caching method for the front end of server management software, characterized in that, include: Receive data update events; The data update event is generated when the change listener detects that a field of a data object has been modified. Based on the data update event, the corresponding fields in the target view component are updated according to the priority of the modified fields; the target view component is a view component that subscribes to the modified fields. Receive a query request from the view layer where the target view component is located, and query the value corresponding to the key carried in the query request in the inverted index mapping according to the query request; Based on the value, obtain the data object corresponding to the value in the master data mapping, and return the data object to the view layer; Receive data deletion event; The data deletion event is generated when the event listener detects that a field of a data object or the data object itself has been deleted. Based on the data deletion event, notify the corresponding view component to remove the corresponding part; Based on the data deletion event, the corresponding view component is notified to remove the relevant portion, including: Based on the priority of the deleted parts, notify the corresponding view components to remove the corresponding parts; Based on the priority of the deleted parts, the corresponding view components are notified to remove the corresponding parts, including: If the deleted part is a field and the field has the highest priority, then the corresponding view component is notified directly to remove the corresponding field. If the deleted part is a field and the field has the second priority, then after a second preset time delay, the corresponding view component will be notified to remove the deleted field and other deleted fields within the second preset time.

2. The caching method according to claim 1, characterized in that, Based on the priority of the modified fields, the corresponding fields in the target view component are updated, including: If the field being modified has the highest priority, then the modified field will be packaged and sent directly to the target view component for updating. If the modified field has the second priority, the modified field will be packaged with other modified fields within the preset time and sent to the target view component for updating after a preset delay.

3. The caching method according to claim 1, characterized in that, Retrieving the data object corresponding to the value in the master data mapping based on the value includes: If the value is located in different partitions, then determine the partition in which the value is located; Query requests are sent to the shards in parallel; Receive and aggregate the data objects corresponding to the values ​​returned by the shards.

4. The caching method according to claim 1, characterized in that, Also includes: When the data update event is a target event, the modified fields will be synchronized to the target object; The target event is the event that requires the modified fields to be synchronized to the backend or client; the target object is the backend or client.

5. The caching method according to claim 1, characterized in that, Also includes: If the local version number of a data object is higher than the received update version number, the corresponding data object is not modified. If the locally modified field does not overlap with the received modified field, then the locally modified object and the received modified field are merged. When the fields modified locally and remotely are the same, the modified fields locally, the modified fields remotely, and the original versions of the fields are compared. If the comparison results indicate a conflict between the modified fields locally and remotely, an alarm is triggered for manual handling. When a batch of operations are received, the operations are sorted according to their logical time and executed in sequence. If a data object is corrupted and cannot be recovered based on the data version number, roll the data object back to the most recent checkpoint backup.

6. The caching method according to claim 1, characterized in that, Also includes: Receive update request; Update the target object according to the update request; The target object is a portion of a field of a data object or the entire data object.

7. The caching method according to claim 1, characterized in that, Also includes: Once local data updates are complete or the modified fields are synchronized to the target object, update the data version number of the data object.

8. The caching method according to claim 1, characterized in that, Also includes: The target data object is determined based on the historical access history of the data object by the view component; Preload the target data object into the view component.

9. The caching method according to claim 8, characterized in that, Preloading the target data object into the view component includes: The target data object is preloaded into the view component using dedicated processing resources.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the caching method for the server management software front end as described in any one of claims 1 to 9 when executing the computer program.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the caching method for the front end of the server management software as described in any one of claims 1 to 9.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the caching method for the front end of the server management software as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Local caching method and device based on Velocity block instruction

    CN107346305A

  • Data query method and system and computer readable storage medium

    CN112506964A