Data cache synchronization method and device, electronic equipment and program product

By determining the aging rate of the local latest memory unit after the target device has completed training and performing data cache synchronization, the communication overhead problem when training continuous time dynamic graph neural network is solved, and a more efficient training process is achieved.

CN120387499APending Publication Date: 2025-07-29HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510330834.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

When training continuous time dynamic graph neural networks, the communication overhead of each distributed training device is relatively high.

Method used

After the target device completes training, it is determined that the aging rate of the local latest memory unit compared to the global cache memory unit. If the aging rate is greater than the preset threshold, the data cache of the local latest memory unit will be synchronized to other devices, and the data deviation of the local latest memory unit will be corrected through the data update method.

Benefits of technology

The communication overhead of each distributed training device when training continuous time dynamic graph neural network is reduced, while ensuring training quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120387499A_ABST
    Figure CN120387499A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of data processing, and provides a data cache synchronization method and device, electronic equipment and a program product. The method is applied to a target device, the target device is any one of a plurality of distributed training devices included in a training system of a continuous time dynamic graph neural network, and the method comprises the following steps: after the target device completes any batch of training, determining the aging rate of a local latest memory unit compared with a global cache memory unit; and if the aging rate is greater than a preset aging threshold value, synchronizing the data cache stored in the local latest memory unit to other equipment. According to the method, after any batch of training is completed, only when the aging degree of the latest memory unit of the target equipment compared with the global cache memory unit of the target equipment is greater than the preset threshold value, the target equipment can perform cache synchronization with other training equipment; therefore, the communication overhead of each distributed training device can be reduced when the continuous time dynamic graph neural network is trained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of data processing, and particularly relates to a data cache synchronization method, apparatus, electronic device, and program product. Background Art

[0002] Currently, the time required to train a Memory based Temporal Graph Neural Network (MTGNN) is relatively long. To improve the training efficiency, parallel training is usually performed through multiple distributed training devices.

[0003] When training a Memory based Temporal Graph Neural Network through multiple distributed training devices, after each batch of training is completed, each distributed training device needs to update the states of the memory units (including the local latest memory unit and the global cache memory unit). Therefore, after each batch of training is completed, cache synchronization needs to be implemented among the distributed training devices, which increases the communication overhead of each distributed training device when training the Memory based Temporal Graph Neural Network. Summary of the Invention

[0004] In view of this, embodiments of this application provide a data cache synchronization method, apparatus, electronic device, and program product to solve the technical problem of the relatively high communication overhead of each distributed training device when training the existing Memory based Temporal Graph Neural Network.

[0005] In a first aspect, embodiments of this application provide a data cache synchronization method, which is applied to a target device. The target device is any one of a plurality of distributed training devices included in a training system of a Memory based Temporal Graph Neural Network. The target device is provided with a local latest memory unit and a global cache memory unit. The method includes:

[0006] After the target device completes any batch of training on the Memory based Temporal Graph Neural Network, determine the aging rate of the local latest memory unit compared to the global cache memory unit. The aging rate is used to describe the aging degree of the local latest memory unit compared to the global cache memory unit.

[0007] If the aging rate is greater than a preset aging threshold, synchronize the data cache stored in the local latest memory unit to other devices in the plurality of distributed training devices except the target device.

[0008] Optionally, the determining the aging rate of the local latest memory unit compared to the global cache memory unit includes:

[0009] Determine the global cache hot data in the global cache memory unit before the completion of the arbitrary batch of training on each of the distributed training devices;

[0010] Determine the local cache hot data in the local latest memory unit after the completion of the arbitrary batch of training on the target device;

[0011] Determine the aging rate according to the global cache hot data and the local cache hot data.

[0012] Optionally, it further includes:

[0013] If the aging rate is less than or equal to the aging threshold, and in the batch training of a preset number of times before the arbitrary batch of training, the target device has not cached and synchronized the data stored in the local latest memory unit to the other devices, then cache and synchronize the data stored in the local latest memory unit to the other devices.

[0014] Optionally, before determining the aging rate of the local latest memory unit compared with the global cache memory unit, it further includes:

[0015] Determine the historical change rate of the data stored in the global cache memory unit;

[0016] Predict the memory state deviation of the global cache memory unit according to the historical change rate;

[0017] Update the data stored in the local latest memory unit according to the memory state deviation and the first current memory state of the global cache memory unit.

[0018] Optionally, the updating of the local latest memory unit according to the memory state deviation and the first current memory state of the global cache memory unit includes:

[0019] Obtain the second current memory state corresponding to each non-hot node stored in the local latest memory unit;

[0020] Obtain the third current memory state corresponding to each hot node stored in the local latest memory unit;

[0021] Update each of the third current memory states according to the memory state deviation and the first current memory state of the global cache memory unit, and determine the fourth current memory state corresponding to each of the third current memory states;

[0022] Update the local latest memory unit according to each of the second current memory states and each of the fourth current memory states.

[0023] Optionally, updating each of the third current memory states according to the memory state deviation and the first current memory state of the global cache memory unit to obtain a fourth current memory state corresponding to each of the third current memory states includes:

[0024] Obtaining a preset weighting coefficient;

[0025] Determining the fourth current memory state corresponding to each of the third current memory states according to the memory state deviation, the first current memory state, the third current memory state, and the weighting coefficient.

[0026] Optionally, updating the local latest memory unit according to each of the second current memory states and each of the fourth current memory states includes:

[0027] Performing memory aggregation processing on each of the second current memory states and each of the fourth current memory states to obtain the updated local latest memory unit.

[0028] In a second aspect, an embodiment of the present application provides a data cache synchronization device, which is applied to a target device. The target device is any one of a plurality of distributed training devices included in a training system of a continuous-time dynamic graph neural network. The target device is provided with a local latest memory unit and a global cache memory unit; the device includes:

[0029] An aging rate determination unit, configured to determine an aging rate of the local latest memory unit relative to the global cache memory unit after the target device completes any batch of training of the continuous-time dynamic graph neural network; the aging rate is used to describe the aging degree of the local latest memory unit relative to the global cache memory unit;

[0030] A cache synchronization unit, configured to, if the aging rate is greater than a preset aging threshold, synchronize the data cache stored in the local latest memory unit to other devices except the target device among the plurality of distributed training devices.

[0031] In a third aspect, an embodiment of the present application provides an electronic device, 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, the steps of the data cache synchronization method described in the first aspect are implemented.

[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data cache synchronization method described in the first aspect are implemented.

[0033] In a fifth aspect, an embodiment of the present application provides a computer program which, when running on an electronic device, causes the electronic device to execute the steps of the data cache synchronization method described in the first aspect above.

[0034] The data cache synchronization method, apparatus, electronic device, and program product provided by the embodiments of the present application have the following beneficial effects:

[0035] The data cache synchronization method provided by the embodiments of the present application can be applied to a target device, where the target device is any one of several distributed training devices included in a training system of a continuous-time dynamic graph neural network, and the target device is provided with a local latest memory unit and a global cache memory unit; the data cache synchronization method includes: after the target device completes any batch of training of the continuous-time dynamic graph neural network, determining an aging rate of the local latest memory unit compared to the global cache memory unit, where the aging rate is used to describe the aging degree of the local latest memory unit compared to the global cache memory unit; if the aging rate is greater than a preset aging threshold, synchronizing the data cache stored in the local latest memory unit to other devices except the target device among the several distributed training devices. Through this method, after any batch of training is completed, only when the aging degree of the latest memory unit of the target device compared to the global cache memory unit of the target device is greater than the preset threshold, will the target device perform cache synchronization with other training devices. Compared with the method in the prior art where cache synchronization needs to be implemented between each distributed training device after each batch of training is completed, the data cache synchronization method provided by the embodiments of the present application can reduce the communication overhead of each distributed training device when training a continuous-time dynamic graph neural network. Description of the Drawings

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0037] Figure 1 It is a flowchart of the implementation of a data cache synchronization method provided by an embodiment of the present application;

[0038] Figure 2 It is a flowchart of the implementation of a data update method for a local latest memory unit provided by an embodiment of the present application;

[0039] Figure 3 It is a schematic structural diagram of a data cache synchronization apparatus provided by an embodiment of the present application;

[0040] Figure 4 A structural schematic diagram of an electronic device provided by an embodiment of the present application. Specific implementation manners

[0041] It should be noted that the terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application, rather than being intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, "a plurality" means two or more than two, "at least one", "one or more" means one, two or more than two. The terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features.

[0042] The reference to "one embodiment" or "some embodiments" etc. described in this specification means that a specific feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise particularly emphasized in other ways. The terms "comprise", "include", "have" and their variants all mean "include but not limited to", unless otherwise particularly emphasized in other ways.

[0043] The execution subject of the data cache synchronization method provided by the embodiments of the present application may be a target device, and the target device may be any one of several distributed training devices included in a training system of a continuous-time dynamic graph neural network.

[0044] The data cache synchronization method provided by the embodiments of the present application can be applied to the scenario of training a continuous-time dynamic graph neural network. Specifically, when it is necessary to reduce the communication overhead of each distributed training device when training a continuous-time dynamic graph neural network, each step of the data cache synchronization method provided by the embodiments of the present application can be executed by each training device included in the training system of the continuous-time dynamic graph neural network, so as to reduce the communication overhead of each distributed training device when training the continuous-time dynamic graph neural network.

[0045] Please refer to Figure 1 , Figure 1This is a flowchart for implementing a data cache synchronization method provided by an embodiment of the present application. The data cache synchronization method can be applied to a target device, which is any one of several distributed training devices included in a training system for a continuous-time dynamic graph neural network. The target device is provided with a local latest memory unit and a global cache memory unit. The data cache synchronization method may include S101 to S102, which are described in detail as follows:

[0046] In S101, after the target device completes any batch of training of the continuous-time dynamic graph neural network, determine the aging rate of the local latest memory unit compared to the global cache memory unit.

[0047] In the embodiment of the present application, the process of training the continuous-time dynamic graph neural network may include several batches of training processes. In each batch process, the target device needs to be trained with the training data allocated to the target device.

[0048] In practical applications, the training data allocated to the target device may be a subgraph corresponding to a complete continuous-time dynamic graph. Based on this, the training system of the continuous-time dynamic graph neural network may first divide the complete continuous-time dynamic graph into multiple subgraphs, where the number of subgraphs may be the same as the number of training devices. After obtaining multiple subgraphs, the training system of the continuous-time dynamic graph neural network may send each subgraph to a training device to instruct the training device to perform multiple batches of training according to the received subgraph.

[0049] After the target device completes any batch of training of the continuous-time dynamic graph neural network, the target device may determine the aging rate of the local latest memory unit of the target device compared to the global cache memory unit. Among them, the aging rate can be used to describe the aging degree of the local latest memory unit compared to the global cache memory unit.

[0050] Among them, the Local Latest Memory Unit (LLMU) stores the local cached hot data processed by the target device. The local latest memory unit is mainly used to update and manage the memory state of the hot data on the target device, so as to quickly access and update this data during the training process, and is usually only used inside the local trainer. The Global Cached Memory Unit (GCMU) stores the aggregation results of the local latest memory units on each training device, and is aggregated and updated according to the maximum timestamp. The global cached memory unit is used to manage the memory state of the global hot data in distributed training, ensuring that the hot data information can be shared and synchronized among each training device, but there is a certain update lag. In addition, there may be differences between the local latest memory units in each training device, while the global cached memory units in each training device are the same.

[0051] Among them, the aging rate can be the cosine value of the vector, and this cosine value of the vector can be used to represent the cosine similarity of the vectors of all the data stored in the local latest memory unit of the target device compared to all the data stored in the global cached memory unit of the target device.

[0052] In a possible implementation, the aging rate of the local latest memory unit of the target device compared to the global cached memory unit can be determined through steps a to c. Details are as follows:

[0053] In step a, determine the global cached hot data of the global cached memory unit before any batch of training is completed on each distributed training device.

[0054] In this implementation, when the target device needs to determine the aging rate, it can first determine the global cached hot data stored in the global cached memory unit of the target device before any batch of training is completed on each distributed training device.

[0055] In step b, determine the local cached hot data of the local latest memory unit after any batch of training is completed on the target device.

[0056] In this implementation, when the target device needs to determine the aging rate, it can first determine the local cached hot data stored in the local latest memory unit of the target device after any batch of training is completed on the target device.

[0057] In step c, determine the aging rate according to the global cached hot data and the local cached hot data.

[0058] In this implementation mode, after determining the global cache hot data in the global cache memory unit before any batch of training is completed on each distributed training device, and determining the local cache hot data in the local latest memory unit after any batch of training is completed on the target device, the target device can determine the aging rate of the local latest memory unit of the target device compared to the global cache memory unit through the following formula:

[0059]

[0060] Wherein, represents the global cache hot data in the global cache memory unit of all training devices before any batch of training is completed, and represents the local cache hot data in the local latest memory unit of the target device after any batch of training is completed, represents the aging rate of the local latest memory unit of the target device compared to the global cache memory unit.

[0061] In S102, if the aging rate is greater than the preset aging threshold, the data cache stored in the local latest memory unit is synchronized to other devices except the target device among several distributed training devices.

[0062] In the embodiments of the present application, after determining the aging rate of the local latest memory unit compared to the global cache memory unit, the target device can compare the aging rate of the local latest memory unit compared to the global cache memory unit with the preset aging threshold. Among them, the aging threshold can be a vector cosine threshold with a specific value set in advance. In practical applications, the specific value of the aging threshold can be set according to actual needs.

[0063] In the first possible implementation mode, if the aging rate of the local latest memory unit compared to the global cache memory unit is greater than the preset aging threshold, the data cache stored in the local latest memory unit is synchronized to other devices except the target device among several distributed training devices. If the aging rate of the local latest memory unit compared to the global cache memory unit is less than or equal to the preset aging threshold, the step of synchronizing the data cache stored in the local latest memory unit to other devices except the target device among several distributed training devices is not executed.

[0064] In the first possible implementation mode, the target device determines whether data cache synchronization is required only based on the parameter of the aging rate.

[0065] In the second possible implementation mode, the target device can jointly determine whether data cache synchronization is required based on the aging rate and the number of times the target device has not synchronized the data cache stored in the local latest memory unit to other devices before this any batch of training.

[0066] Specifically, in the second possible implementation manner, if the aging rate of the local latest memory unit compared to the global cache memory unit is greater than a preset aging threshold, the data cache stored in the local latest memory unit is synchronized to other devices except the target device among several distributed training devices. If the aging rate of the local latest memory unit compared to the global cache memory unit is less than or equal to the preset aging threshold, and the target device has not synchronized the data cache stored in the local latest memory unit to other devices in the preset number of batches of training before this arbitrary batch of training, then the data cache stored in the local latest memory unit is synchronized to other devices except the target device among several distributed training devices. If the aging rate of the local latest memory unit compared to the global cache memory unit is less than or equal to the preset aging threshold, and the target device has synchronized the data cache stored in the local latest memory unit to other devices in the preset number of batches of training before this arbitrary batch of training, then the step of synchronizing the data cache stored in the local latest memory unit to other devices except the target device among several distributed training devices is not executed.

[0067] As can be seen from the above, the data cache synchronization method provided by the embodiments of the present application can be applied to a target device, where the target device is any one of several distributed training devices included in a training system of a continuous-time dynamic graph neural network, and the target device is provided with a local latest memory unit and a global cache memory unit; the data cache synchronization method includes: after the target device completes any batch of training on the continuous-time dynamic graph neural network, determining the aging rate of the local latest memory unit compared to the global cache memory unit, where the aging rate is used to describe the aging degree of the local latest memory unit compared to the global cache memory unit; if the aging rate is greater than a preset aging threshold, then synchronize the data cache stored in the local latest memory unit to other devices except the target device among several distributed training devices. Through this method, after any batch of training is completed, only when the aging degree of the latest memory unit of the target device compared to the global cache memory unit of the target device is greater than the preset threshold, will the target device perform cache synchronization with other training devices. Compared with the method in the prior art where cache synchronization needs to be implemented between each distributed training device after each batch of training is completed, the data cache synchronization method provided by the embodiments of the present application can reduce the communication overhead of each distributed training device when training a continuous-time dynamic graph neural network.

[0068] In the data cache synchronization method provided in the embodiments of the present application, only when the aging degree of the latest memory unit of the target device is greater than a preset threshold compared to the global cache memory unit of the target device, will the target device perform cache synchronization with other training devices. Therefore, the global cache memory unit of the target device may have outdated memories. Since the data stored in the local latest memory unit of the target device is determined based on the data stored in the global cache memory unit of the target device, it will cause the data stored in the local latest memory unit of the target device to deviate.

[0069] Based on this, before determining the aging rate of the local latest memory unit compared to the global cache memory unit, after the target device completes any batch of training of the continuous-time dynamic graph neural network, the target device can Figure 2 correct the deviation of the data stored in the local latest memory unit through the implementation flowchart of the data update method of the local latest memory unit as shown in Figure 2 , Figure 2 is the implementation flowchart of a data update method of the local latest memory unit provided in the embodiments of the present application. The data update method of the local latest memory unit may include S201 to S203, which are described in detail as follows:

[0070] In S201, determine the historical change rate of the data stored in the global cache memory unit.

[0071] In the embodiments of the present application, when it is necessary to update the data of the local latest memory unit, the target device may first determine the historical change rate of the data stored in the global cache memory unit.

[0072] In some possible implementation manners, the target device may determine the historical change rate of the data stored in the global cache memory unit by obtaining the historical change rates of the hot nodes corresponding to each training device.

[0073] In S202, predict the memory state deviation of the global cache memory unit according to the historical change rate.

[0074] In the embodiments of the present application, after determining the historical change rate of the data stored in the global cache memory unit, the target device may predict the memory state deviation of the global cache memory unit according to the historical change rate.

[0075] Among them, the memory state deviation of the global cache memory unit is used to describe the difference between the data stored in the current global cache memory unit of the target device and the data stored in the global cache memory unit of the target device after completing data cache synchronization.

[0076] Exemplarily, in practical applications, the memory state deviation of the global cache memory unit can be predicted based on the historical change rate by training a prediction model.

[0077] In S203, the local latest memory unit is updated according to the memory state deviation and the first current memory state of the global cache memory unit.

[0078] In the embodiments of the present application, after determining the memory state deviation of the global cache memory unit, the target device can update the data stored in the local latest memory unit of the target device according to the memory state deviation and the first current memory state of the global cache memory unit of the target device.

[0079] In a possible implementation manner, the target device can update the local latest memory unit of the target device through steps d to g. Details are as follows:

[0080] In step d, obtain the second current memory state corresponding to each non-hot node stored in the local latest memory unit.

[0081] In this implementation manner, the target device may include a memory network update layer corresponding to a continuous-time dynamic graph neural network. The memory network update layer can be used to output, based on each batch of training data, the second current memory state corresponding to each non-hot node and the third current memory state corresponding to each hot node in each batch of training data. Based on this, the target device can obtain the second current memory state corresponding to each non-hot node output by the memory network update layer of the target device, so as to obtain the second current memory state corresponding to each non-hot node stored in the local latest memory unit.

[0082] In step e, obtain the third current memory state corresponding to each hot node stored in the local latest memory unit.

[0083] In this implementation manner, the target device can obtain the third current memory state corresponding to each hot node output by the memory network update layer of the target device, so as to obtain the third current memory state corresponding to each hot node stored in the local latest memory unit.

[0084] In step f, update each third current memory state according to the memory state deviation and the first current memory state of the global cache memory unit, and determine the fourth current memory state corresponding to each third current memory state.

[0085] In this implementation manner, after obtaining the third current memory states corresponding to each hotspot node stored in the local latest memory unit, the target device may further update each third current memory state according to the memory state deviation and the first current memory state of the global cache memory unit to determine the fourth current memory states corresponding to each third current memory state.

[0086] Specifically, the target device may first obtain a preset weighting coefficient, and then determine the fourth current memory states corresponding to each third current memory state according to the memory state deviation, the first current memory state, the third current memory state, and the weighting coefficient. Exemplarily, the target device may use the following formula to determine the fourth current memory states corresponding to each third current memory state:

[0087]

[0088] where γ represents the weighting coefficient, represents each third current memory, ΔS(u,t-t - )) represents the memory state deviation, represents the first current memory state.

[0089] In step g, update the local latest memory unit according to each second current memory state and each fourth current memory state.

[0090] In this implementation manner, after determining the second current memory states corresponding to each non-hotspot node stored in the local latest memory unit and the fourth current memory states corresponding to each hotspot node stored in the local latest memory unit, the target device may update the local latest memory unit according to each second current memory state and each fourth current memory state.

[0091] Specifically, the target device may perform memory aggregation processing on each second current memory state and each fourth current memory state to obtain the updated local latest memory unit.

[0092] As can be seen above, through Figure 1 the corresponding data cache synchronization method, the communication overhead of each distributed training device during the training of the continuous-time dynamic graph neural network can be reduced. Through Figure 2 the corresponding data update method of the local latest memory unit, the problem that the data stored in the local latest memory unit deviates due to delayed data cache synchronization can be avoided to a certain extent. Therefore, the data cache synchronization method provided in the embodiments of the present application can reduce the communication overhead of each distributed training device during the training of the continuous-time dynamic graph neural network while ensuring the training quality.

[0093] Based on the data cache synchronization method provided in the above embodiments, an embodiment of the present application further provides a data cache synchronization device for implementing the method embodiments. The data cache synchronization device is applied to a target device, which is any one of several distributed training devices included in a training system of a continuous-time dynamic graph neural network. The target device is provided with a local latest memory unit and a global cache memory unit. Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of a data cache synchronization device provided by an embodiment of the present application. As Figure 3 shown, the data cache synchronization device 30 may include: an aging rate determination unit 31 and a cache synchronization unit 32. Among them:

[0094] The aging rate determination unit 31 is configured to determine the aging rate of the local latest memory unit compared to the global cache memory unit after the target device completes any batch of training of the continuous-time dynamic graph neural network; the aging rate is used to describe the aging degree of the local latest memory unit compared to the global cache memory unit.

[0095] The cache synchronization unit 32 is configured to, if the aging rate is greater than a preset aging threshold, synchronize the data cache stored in the local latest memory unit to other devices except the target device among several distributed training devices.

[0096] Optionally, the aging rate determination unit 31 is specifically configured to:

[0097] Determine the global cache hot data of the global cache memory unit before each distributed training device completes any batch of training;

[0098] Determine the local cache hot data of the local latest memory unit after the target device completes any batch of training;

[0099] Determine the aging rate according to the global cache hot data and the local cache hot data.

[0100] Optionally, the cache synchronization unit 32 may further be configured to:

[0101] If the aging rate is less than or equal to the aging threshold, and the target device has not synchronized the data cache stored in the local latest memory unit to other devices in a preset number of batches of training before any batch of training, then synchronize the data cache stored in the local latest memory unit to other devices.

[0102] Optionally, the data cache synchronization device 30 may include a data update unit. Among them:

[0103] The data update unit is specifically configured to:

[0104] Determine the historical change rate of the data stored in the global cache memory unit;

[0105] Predict the memory state deviation of the global cache memory unit according to the historical change rate;

[0106] Update the local latest memory unit according to the memory state deviation and the first current memory state of the global cache memory unit.

[0107] Optionally, the data update unit is specifically configured to:

[0108] Obtain the second current memory state corresponding to each non-hot node stored in the local latest memory unit;

[0109] Obtain the third current memory state corresponding to each hot node stored in the local latest memory unit;

[0110] Update each third current memory state according to the memory state deviation and the first current memory state of the global cache memory unit, and determine the fourth current memory state corresponding to each third current memory state;

[0111] Update the local latest memory unit according to each second current memory state and each fourth current memory state.

[0112] Optionally, the data update unit is specifically configured to:

[0113] Obtain a preset weighting coefficient;

[0114] Determine the fourth current memory state corresponding to each third current memory state according to the memory state deviation, the first current memory state, the third current memory state, and the weighting coefficient.

[0115] Optionally, the data update unit is specifically configured to:

[0116] Perform memory aggregation processing on each second current memory state and each fourth current memory state to obtain an updated local latest memory unit.

[0117] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 4 shown, the electronic device 4 provided in this embodiment may include: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40, such as a program corresponding to the data cache synchronization method. When the processor 40 executes the computer program 42, the steps in the embodiment of the data cache synchronization method described above are implemented, such as Figure 1 S101 to S102 shown in Figure 2S201 to S203 shown. Alternatively, when the processor 40 executes the computer program 42, it implements the functions of each module / unit in the above data cache synchronization device embodiments. For example Figure 3 the functions of units 31 to 32 shown.

[0118] Exemplarily, the computer program 42 can be divided into one or more modules / units. One or more modules / units are stored in the memory 41 and executed by the processor 40 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 42 in the electronic device 4. For example, the computer program 42 can be divided into an aging rate determination unit 31 and a cache synchronization unit 32. For the specific functions of each unit, please refer to Figure 3 the relevant descriptions in the corresponding embodiments and will not be elaborated here.

[0119] Those skilled in the art can understand that Figure 4 this is only an example of the electronic device 4 and does not constitute a limitation on the electronic device 4. It may include more or fewer components than shown in the figure, or combine certain components, or different components.

[0120] The processor 40 can be a central processing unit (CPU), or can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or this processor can also be any conventional processor, etc.

[0121] The memory 41 can be an internal storage unit of the electronic device 4, such as the hard disk or memory of the electronic device 4. The memory 41 can also be an external storage device of the electronic device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card or flash card equipped on the electronic device 4, etc. Further, the memory 41 can also include both the internal storage unit and the external storage device of the electronic device 4. The memory 41 is used to store the computer program and other programs and data required by the electronic device. The memory 41 can also be used to temporarily store the data that has been output or will be output.

[0122] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the above division of each functional unit is used as an example. In actual applications, the above functions can be allocated to different functional units according to needs, that is, the internal structure of the data cache synchronization device is divided into different functional units to complete all or part of the functions described above. Each functional unit in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working process of the units in the above system can refer to the corresponding process in the foregoing method embodiment and will not be elaborated here.

[0123] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.

[0124] The embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device is enabled to implement the steps in the foregoing method embodiments.

[0125] In the foregoing embodiments, the descriptions of each embodiment have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0126] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0127] The foregoing embodiments are only used to illustrate the technical solutions of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment of this application, and should all be included in the protection scope of this application.

Claims

1. A data caching synchronization method, characterized in that, Applied to a target device, where the target device is any one of a number of distributed training devices included in a training system of a continuous-time dynamic graph neural network, and the target device is provided with a local latest memory unit and a global cache memory unit; the method includes: After the target device completes any batch of training of the continuous-time dynamic graph neural network, determine the aging rate of the local latest memory unit compared to the global cache memory unit; the aging rate is used to describe the aging degree of the local latest memory unit compared to the global cache memory unit; If the aging rate is greater than a preset aging threshold, synchronize the data cache stored in the local latest memory unit to other devices except the target device among the number of distributed training devices.

2. The method according to claim 1, wherein The determining the aging rate of the local latest memory unit compared to the global cache memory unit includes: Determine the global cache hot data of the global cache memory unit before each of the distributed training devices completes the any batch of training; Determine the local cache hot data of the local latest memory unit after the target device completes the any batch of training; Determine the aging rate according to the global cache hot data and the local cache hot data.

3. The method according to claim 1, wherein It further includes: If the aging rate is less than or equal to the aging threshold, and the target device has not synchronized the data cache stored in the local latest memory unit to the other devices in a preset number of batches of training before the any batch of training, then synchronize the data cache stored in the local latest memory unit to the other devices.

4. The method according to any one of claims 1 to 3, characterized in that Before the determining the aging rate of the local latest memory unit compared to the global cache memory unit, it further includes: Determine the historical change rate of the data stored in the global cache memory unit; Predict the memory state deviation of the global cache memory unit according to the historical change rate; Update the local latest memory unit according to the memory state deviation and the first current memory state of the global cache memory unit.

5. The method according to claim 4, wherein The updating the local latest memory unit according to the memory state deviation and the first current memory state of the global cache memory unit includes: Obtain the second current memory state corresponding to each non-hot node stored in the local latest memory unit; Obtain the third current memory state corresponding to each hot node stored in the local latest memory unit; Update each of the third current memory states according to the memory state deviation and the first current memory state of the global cache memory unit, and determine the fourth current memory state corresponding to each of the third current memory states; Update the local latest memory unit according to each of the second current memory states and each of the fourth current memory states.

6. The method according to claim 5, characterized in that The updating each of the third current memory states according to the memory state deviation and the first current memory state of the global cache memory unit to obtain the fourth current memory state corresponding to each of the third current memory states includes: Obtain a preset weighting coefficient; Determine the fourth current memory state corresponding to each of the third current memory states according to the memory state deviation, the first current memory state, the third current memory state, and the weighting coefficient.

7. The method according to claim 5, wherein Updating the local latest memory unit according to each of the second current memory states and each of the fourth current memory states includes: Performing memory aggregation processing on each of the second current memory states and each of the fourth current memory states to obtain the updated local latest memory unit.

8. A data cache synchronization device, characterized in that, Applied to a target device, the target device is any one of a plurality of distributed training devices included in a training system of a continuous-time dynamic graph neural network, and the target device is provided with a local latest memory unit and a global cache memory unit; the device includes: An aging rate determination unit, configured to determine an aging rate of the local latest memory unit compared to the global cache memory unit after the target device completes any batch of training of the continuous-time dynamic graph neural network; the aging rate is used to describe the aging degree of the local latest memory unit compared to the global cache memory unit; A cache synchronization unit, configured to, if the aging rate is greater than a preset aging threshold, synchronize the data cache stored in the local latest memory unit to other devices except the target device among the plurality of distributed training devices.

9. An electronic 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 steps in the data cache synchronization method according to any one of claims 1 to 7.

10. A computer program product, characterized in that, When the computer program product is executed by a processor, it implements the steps in the data cache synchronization method according to any one of claims 1 to 7.