Data synchronization method and device

A local backup directory for model files in data processing systems addresses the inefficiencies of repeated pulls from remote disks, ensuring rapid and stable model updates and restorations.

CN119066076APending Publication Date: 2024-12-03BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310652821.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-02
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The existing data processing systems require multiple pulls from a remote network disk for model updates and restorations, leading to long recovery times and poor stability due to network bandwidth and storage limitations.

Method used

Implementing a local backup directory to pre-pull model files, allowing index node codes to be modified for model synchronization, avoiding repeated pulls and ensuring rapid processing.

Benefits of technology

This approach reduces data synchronization time and enhances stability by eliminating incomplete file issues during model updates and restorations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066076A_ABST
    Figure CN119066076A_ABST
Patent Text Reader

Abstract

The invention discloses a data synchronization method and device, and relates to the technical field of computers. A specific embodiment of the method comprises the following steps: acquiring a data synchronization request; according to a target model indicated by the data synchronization request, determining a first index node code corresponding to the target model from a local backup directory; a second index node code corresponding to the current application model is determined from a service directory, and the service directory comprises one or more index node codes received from a local backup directory in advance and the number of index nodes corresponding to each index node code; and processing the number of the index nodes corresponding to the first index node code and the number of the index nodes corresponding to the second index node code, so as to take the target model as a new current application model according to the number of the processed index nodes. According to the implementation mode, the model file does not need to be repeatedly pulled, and rapid processing of the model is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for data synchronization. Background Art

[0002] In the existing data processing process, different machine learning models are required for different data processing, and only one machine learning model of the current application can be installed on each terminal at the same time. Therefore, the existing technology is to store multiple machine learning models in a remote network disk, and each time the model needs to be tested or updated / restored, the required target model is pulled from the remote network disk to the local service directory, so that the model usage platform can load the model according to the model file in the service directory.

[0003] However, with the rapid update of machine learning models, when the model version needs to be updated or restored multiple times, it relies on pulling data from the network disk multiple times. For example, when updating from model A to model B, and restoring from model B to model A, it is necessary to pull model B once and then pull model A once. Due to the limitations of system network bandwidth, storage media and other reasons, it will lead to problems such as long model status recovery time and poor recovery stability. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a method and device for data synchronization. By setting a local backup directory, the model files stored in the remote network disk are pre-pulled to the local computer. When the service directory is needed to load the model, there is no need to repeatedly pull the model files. It is only necessary to modify the number of index nodes of the first index node code corresponding to the target model and the second index node code corresponding to the current application model in the service directory. This avoids the problem of incomplete files caused by copying failure, saves data synchronization time, and realizes rapid processing of the model.

[0005] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for data synchronization is provided.

[0006] A data synchronization method according to an embodiment of the present invention includes: obtaining a data synchronization request; determining a first index node code corresponding to a target model to be synchronized indicated by the data synchronization request from a local backup directory; wherein the local backup directory includes index node codes corresponding to one or more pre-created model files; determining a second index node code corresponding to a current application model from a service directory, wherein the service directory includes one or more index node codes received in advance from the local backup directory, and the number of index nodes corresponding to each index node code; processing the numbers of index nodes corresponding to the first index node code and the second index node code, respectively, so as to use the target model as a new current application model according to the number of processed index nodes.

[0007] Optionally, the method further includes: creating an index node corresponding to the target model in the service directory, and deleting the index node corresponding to the current application model.

[0008] Optionally, the processing of the number of index nodes corresponding to the first index node code and the second index node code respectively includes: determining the number of first nodes corresponding to the first index node code and the number of second nodes corresponding to the second index node code according to the number of index nodes in the local backup directory and the service directory; increasing the number of first nodes and decreasing the number of second nodes to process the number of index nodes corresponding to the first index node code and the second index node code respectively.

[0009] Optionally, before obtaining the data synchronization request, the method further includes: obtaining one or more model files using a local backup directory, and creating index nodes corresponding to each of the model files and index node codes corresponding to the index nodes.

[0010] Optionally, determining the first index node code corresponding to the target model from the local backup directory includes: when the first index node code does not exist in the local backup directory, using the local backup directory to obtain the target model file corresponding to the target model, and creating a corresponding first index node code for the target model file.

[0011] Optionally, the method also includes: verifying the version code and model file corresponding to the model, and if the verification passes, loading the target model using the loading machine learning model; and determining the service status of the target model based on the loading result.

[0012] Optionally, after obtaining the data synchronization request, it also includes: modifying the service status of the model in the service directory to model updating or model recovery; determining the service status of the target model based on the loading result, including: when the loading is successful, determining that the service status of the target model is update completed or recovery completed.

[0013] Optionally, the method further includes: in case of a loading failure, determining that the service status of the target model is an update failure or a recovery failure, and reporting the service status to an alarm system to indicate that the data synchronization request processing has failed.

[0014] To achieve the above objective, according to another aspect of an embodiment of the present invention, a device for data synchronization is provided.

[0015] A data synchronization device according to an embodiment of the present invention includes: an acquisition module for acquiring a data synchronization request; a first determination module for determining a first index node code corresponding to a target model to be synchronized indicated by the data synchronization request from a local backup directory; wherein the local backup directory includes index node codes corresponding to one or more pre-created model files; a second determination module for determining a second index node code corresponding to a current application model from a service directory, wherein the service directory includes one or more index node codes received in advance from the local backup directory, and the number of index nodes corresponding to each index node code; a processing module for processing the number of index nodes corresponding to the first index node code and the second index node code, so as to use the target model as a new current application model according to the number of processed index nodes.

[0016] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.

[0017] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a data synchronization method according to an embodiment of the present invention.

[0018] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.

[0019] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a data synchronization method according to an embodiment of the present invention is implemented.

[0020] An embodiment of the above invention has the following advantages or beneficial effects: by setting a local backup directory, the model files stored in the remote network disk are pre-pull to the local computer. When the model needs to be loaded using the service directory, there is no need to repeatedly pull the model files. It is only necessary to modify the number of index nodes of the first index node code corresponding to the target model and the second index node code corresponding to the current application model in the service directory, thereby avoiding the problem of incomplete files caused by copying failure, saving data synchronization time, and realizing rapid processing of the model.

[0021] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0023] Figure 1 is a flowchart of a method for data synchronization according to an embodiment of the present invention;

[0024] Figure 2 is a schematic diagram of a flow chart of processing the number of index nodes corresponding to the first index node code and the second index node code respectively according to an embodiment of the present invention;

[0025] Figure 3 is a schematic diagram of a specific process of data synchronization according to an embodiment of the present invention;

[0026] Figure 4 is a schematic diagram of a process of loading a target model according to an embodiment of the present invention;

[0027] Figure 5 is a schematic diagram of main modules of a data synchronization device according to an embodiment of the present invention;

[0028] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0029] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0031] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.

[0032] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0033] In the prior art, there are only two roles in the model update process, the network disk directory that stores the model files and the service directory that loads the model, where the network disk directory is set in the remote network disk, and the service directory is set in the local storage. Every time the model needs to be loaded, whether it is updated to a new model or restored to an old model, the service directory needs to pull the model file from the remote network disk directory, which is highly dependent on the network, and when the model file is large, the pulling time is long. In order to solve the problem of multiple pulls, the embodiment of the present invention sets a new role locally, namely the local backup directory, which effectively solves the problems existing in the prior art.

[0034] Figure 1 is a schematic diagram of main steps of a method for data synchronization according to an embodiment of the present invention.

[0035] like Figure 1 As shown, the data synchronization method of the embodiment of the present invention mainly includes the following steps:

[0036] Step S101: obtaining a data synchronization request;

[0037] Step S102: according to the target model to be synchronized indicated by the data synchronization request, determining a first index node code corresponding to the target model from the local backup directory; wherein the local backup directory includes index node codes corresponding to one or more pre-created model files respectively;

[0038] Step S103: determining a second index node code corresponding to the current application model from the service directory, wherein the service directory includes one or more index node codes received in advance from the local backup directory, and the number of index nodes corresponding to each index node code;

[0039] Step S104: Process the number of index nodes corresponding to the first index node code and the second index node code respectively, so as to use the target model as a new current application model according to the number of index nodes after the processing.

[0040] Only one machine learning model can be installed and used on each terminal at the same time. The current application model refers to the machine learning model currently in use. Specifically, the machine learning model can be a model that estimates indicators such as advertising click-through rate and conversion rate, or a model that reflects the user's current habits. The target model refers to the model that needs to be updated, which can be an iterative version of the current application model or a model with different functions.

[0041] Among them, after obtaining the data synchronization request, the service directory does not directly obtain the model file of the target model from the remote network disk directory, but obtains the first index node code from the local backup directory and changes the number of index nodes corresponding to the index node code to load the model file. Among them, the target model can be understood as the new model that the service directory needs to load, and the current application model can be understood as the model that has been loaded (in use) in the service directory. After obtaining the data synchronization request, the current application model in the service directory needs to be replaced with the target model.

[0042] In addition, the model file in the local backup directory in step S102 is pre-pulled (synchronized) from the remote network disk directory. If the synchronization is successful, it can be considered that the model file stored in the local backup directory is consistent with the model file in the network disk directory. The index node code can be understood as a unique code indicating the model file and the processing operation. Each model file can correspond to multiple index node codes, and each index node code can represent a different processing process. For example, the current application model is model A, and three processing requests are obtained in sequence, namely, processing request 1, processing request 2, and processing request 3. Among them, the target model indicated by processing request 1 is model B, and the index node code B1 corresponding to the first processing is created for model B in the local backup directory. The target model indicated by processing request 2 is model C, and the index node code C1 corresponding to the first processing is created for model C in the local backup directory. The target model indicated by processing request 3 is also model B, and the index node code B2 corresponding to the second processing is created for model B in the local backup directory. That is, the index node code not only corresponds to the model file, but also corresponds to the corresponding number of processing times, so as to record the multiple processing processes of the model. For the purpose of distinction, the first index node code refers to the index node code corresponding to the target model, and the second index node code refers to the index node code corresponding to the current application model.

[0043] In order to successfully obtain the first index node code corresponding to the target model in step S102, it is necessary to obtain one or more model files using the local backup directory before obtaining the data synchronization request, and create index nodes corresponding to each model file and index node codes corresponding to the index nodes.

[0044] In an optional embodiment, the data synchronization request in step S101 includes not only the target model, but also the processing type, such as model update or model recovery. It is understandable that when facing different processing types, it is necessary to determine whether the target model exists in the local backup directory. For example, in the case of model update, it may happen that the local backup directory is not synchronized from the network disk directory in time, so there is no target model in the local backup directory, that is, step S102 can further include: in the case where the first index node code does not exist in the local backup directory, the target model file corresponding to the target model is obtained using the local backup directory, and the corresponding first index node code is created for the target model file. In the case of model recovery, the target model is one of the historical models, so the model file must have been stored in the local backup directory, so there is no need to determine whether the target model exists in the local backup directory, and the first index node code corresponding to the target model can be directly obtained from the local backup directory. In the above manner, it can be ensured that whether it is a model update or a model recovery, the first index node code corresponding to the target model can be successfully obtained in the local backup directory, ensuring the stability of subsequent data synchronization.

[0045] It should be noted that the data synchronization request in step S101 can be obtained by the service directory. In a further optional embodiment, the number of index nodes is determined according to the total number of index nodes in the local backup directory and the service directory, that is, by changing the index nodes in the service directory, the number of index nodes corresponding to different models is changed. Specifically, after the data synchronization request is obtained, an index node corresponding to the target model is created in the service directory, and the index node corresponding to the current application model is deleted. Exemplarily, in the process of updating from model B (current application model) to model C (target model), it is necessary to delete the index node of model B set in the service directory and create the index node of model C. Specifically, the node code of the index node of the same model in the service directory is the same as the node code of the index node in the backup directory, that is, the node code of the index node of the created model C is the same as the node code of the index node of model C in the local backup directory. Since the index nodes corresponding to model B and model C are pre-created in the local backup directory, and unique index node codes are set, the first index node code corresponding to model C can be obtained from the local backup directory. Normally, the estimation service used to load the model will read files from the service directory and load them into the program memory to provide services. In order to ensure stability during the service provision process, the embodiment of the present invention chooses not to change the service directory itself, but to change the nodes and the number of nodes to synchronize the model files in the local backup directory to the service directory.

[0046] In an optional embodiment, step S104 may be as follows Figure 2 As shown, further comprising:

[0047] Step S201: Determine the number of first nodes corresponding to the first index node code and the number of second nodes corresponding to the second index node according to the number of index nodes in the local backup directory and the service directory;

[0048] Step S202: increasing the number of first nodes and decreasing the number of second nodes, so as to process the number of index nodes corresponding to the first index node code and the second index node code respectively.

[0049] It should be noted that there are also multiple index nodes in the local backup directory, and each index node corresponds to a unique index node code. Therefore, the first node number in step S201 refers to the total number of index nodes corresponding to the first node code in the local backup directory and the service directory, and the second node number refers to the total number of index nodes corresponding to the second node code in the local backup directory and the service directory. Among them, increasing the first node number can be understood as adding one to the number, and decreasing the second node number can be understood as subtracting one from the number. Similarly, taking the update from model B (current application model) to model C (target model) as an example, model files and index nodes corresponding to model B and model C are pre-created in the local backup directory, and each index node corresponds to a unique index node code, for example, the index node code of model B is 0001, and the index node code of model C is 0002. In the service directory, since the current application model is model B, there is only one index node corresponding to model B in the service directory, wherein, in order to ensure that it is the same model, the index node code of model B in the service directory is also 0001. At this time, the first node quantity is the number of nodes corresponding to model C, which is 1 (only 1 index node exists in the service directory), and the second node quantity is the number of nodes corresponding to model B, which is 2 (each of which exists in the service directory and the local backup directory). In order to update the current application model (model B) to the target model (model C), the embodiment of the present invention creates an index node corresponding to the target model in the service directory, and deletes the index node corresponding to the current application model, that is, deletes the existing index node of model B in the service directory, and creates an index node of model C, wherein the index node code of model C is the same as the index node code of model C in the backup directory, both of which are 0002. That is to say, after the update is completed, only the index node of model C exists in the service directory, then at this time, the first node quantity is the number of nodes corresponding to model C, which is 2 (each of which exists in the service directory and the local backup directory), and the second node quantity is the number of nodes corresponding to model B, which is 1 (only 1 index node exists in the service directory). By increasing the number of first nodes and decreasing the number of second nodes, the number of nodes corresponding to model C is changed from 1 to 2, and the number of nodes corresponding to model B is changed from 2 to 1, thereby realizing the process of updating the current application model in the service directory from B to C.

[0050] The data synchronization method provided by the present invention is described below with a specific embodiment. It is assumed that multiple model files have been synchronized from the network disk directory in the local backup directory, namely model A, model B and model C. The current application model providing services in the service directory is model B. Now, model B is to be updated to model C. The specific process is as follows: Figure 3 As shown, including:

[0051] Step S301: obtaining a data synchronization request; the data synchronization request indicates that the target model is model C;

[0052] Step S302: Determine whether there is a first index node code corresponding to the target model in the local backup directory;

[0053] If no, execute step S303 and then step S304; if yes, directly execute step S304;

[0054] Step S303: using the local backup directory to obtain the target model file corresponding to the target model C from the network disk directory, and creating a corresponding first index node code for the target model file;

[0055] Step S304: Determine the second index node code corresponding to the current application model B from the service directory;

[0056] Step S305: create an index node corresponding to the target model C in the service directory, and delete the index node corresponding to the current application model B;

[0057] Step S306: Determine the number of first nodes corresponding to the first index node code and the number of second nodes corresponding to the second index node according to the number of index nodes in the local backup directory and the service directory;

[0058] Step S307: increasing the number of first nodes and decreasing the number of second nodes, so as to process the number of index nodes corresponding to the first index node code and the second index node code respectively.

[0059] Through the above process, the model in the service directory can be updated or restored by modifying the node without affecting the running service itself. At the same time, there is no need to pull the model file from the remote network disk every time the model changes, which not only saves the time of data synchronization, but also ensures the stability of data synchronization.

[0060] In an optional embodiment, before loading the model, the changed target model needs to be verified, as follows: Figure 4 As shown, including:

[0061] Step S401: Verify the version code and model file corresponding to the model. If the verification passes, load the target model by using the machine learning model.

[0062] Step S402: Determine the service status of the target model according to the loading result.

[0063] Among them, in step S401, by checking the model version number, it is ensured that the correct version of the model can be loaded, the service self-protection capability is improved, and the reliability of the machine learning platform is guaranteed. The consistency check of the model file can prevent errors during network transmission, further improving the reliability of model loading.

[0064] Specifically, the loading results include loading success and loading failure, and the service status of the target model may include model updating, model restoring, update completed, restoration completed, update failed, and restoration failed. In an optional embodiment, after obtaining the data synchronization request, the service status of the model in the service directory can be modified to model updating or model restoring according to the processing type of the data synchronization request, and step S402 further includes: in the case of successful loading, determining that the service status of the target model is update completed or restoration completed.

[0065] In the case of a loading failure, an optional embodiment may include: determining that the service status of the target model is an update failure or a recovery failure, and reporting the service status to an alarm system to indicate that the data synchronization request processing has failed. Through abnormal alarm processing, when an abnormal situation occurs, the cause of the failure can be obtained as soon as possible and the model that failed to be processed can be manually processed.

[0066] According to the data synchronization method of the embodiment of the present invention, by setting a local backup directory, the model files stored in the remote network disk are pre-pull to the local. When the service directory needs to be used for model loading, there is no need to repeatedly pull the model files. It is only necessary to modify the number of index nodes of the first index node code corresponding to the target model and the second index node code corresponding to the current application model in the service directory. This avoids the problem of incomplete files caused by copying failure, saves data synchronization time, and realizes rapid processing of the model.

[0067] Figure 5 4 is a schematic diagram of main modules of a data synchronization device according to an embodiment of the present invention.

[0068] like Figure 5 As shown, the data synchronization device 500 of the embodiment of the present invention includes:

[0069] An acquisition module 501 is used to acquire a data synchronization request;

[0070] A first determination module 502 is used to determine a first index node code corresponding to the target model to be synchronized indicated by the data synchronization request from a local backup directory; wherein the local backup directory includes index node codes corresponding to one or more pre-created model files;

[0071] The second determination module 503 is used to determine a second index node code corresponding to the current application model from the service directory, wherein the service directory includes one or more index node codes received in advance from the local backup directory, and the number of index nodes corresponding to each index node code;

[0072] The processing module 504 is used to process the number of index nodes corresponding to the first index node code and the second index node code respectively, so as to use the target model as a new current application model according to the number of index nodes after the processing.

[0073] In an optional embodiment of the present invention, the data synchronization device further includes: a node module, which is used to create an index node corresponding to the target model in the service directory and delete the index node corresponding to the current application model.

[0074] In an optional embodiment of the present invention, the processing module 504 is also used to determine the number of first nodes corresponding to the first index node code and the number of second nodes corresponding to the second index node code based on the number of index nodes in the local backup directory and the service directory; increase the number of first nodes and decrease the number of second nodes to process the number of index nodes corresponding to the first index node code and the second index node code, respectively.

[0075] In an optional embodiment of the present invention, the acquisition module 501 is also used to, before obtaining the data synchronization request, also include: using the local backup directory to obtain one or more model files, and creating index nodes corresponding to each of the model files and index node codes corresponding to the index nodes.

[0076] In an optional embodiment of the present invention, the acquisition module 501 is also used to, when the first index node code does not exist in the local backup directory, use the local backup directory to obtain the target model file corresponding to the target model, and create a corresponding first index node code for the target model file.

[0077] In an optional embodiment of the present invention, the data synchronization device also includes: a loading module, used to verify the version code and model file corresponding to the model, and if the verification passes, load the target model using the loading machine learning model; and determine the service status of the target model based on the loading result.

[0078] In an optional embodiment of the present invention, the loading module is also used to, after obtaining the data synchronization request, also include: modifying the service status of the model in the service directory to model updating or model recovery; if the loading is successful, determining the service status of the target model to update completion or recovery completion.

[0079] In an optional embodiment of the present invention, the loading module is also used to, in the event of a loading failure, determine that the service status of the target model is an update failure or a recovery failure, and report the service status to an alarm system to indicate that the data synchronization request processing has failed.

[0080] According to the data synchronization device of the embodiment of the present invention, by setting up a local backup directory, the model files stored in the remote network disk are pre-pull to the local. When the service directory needs to be used for model loading, there is no need to repeatedly pull the model files. It is only necessary to modify the number of index nodes of the first index node code corresponding to the target model and the second index node code corresponding to the current application model in the service directory. This avoids the problem of incomplete files caused by copying failures, saves data synchronization time, and realizes rapid processing of models.

[0081] Figure 6 An exemplary system architecture 600 is shown to which the method or apparatus for data synchronization according to an embodiment of the present invention may be applied.

[0082] like Figure 6 As shown, the system architecture 600 may include a network disk directory 601, a local backup directory 602, a service directory 603, and a network 604. The local backup directory 602 and the service directory 603 are both set on a local server, and the network 604 is used to provide a medium for a communication link between the network disk directory 601 and the local server. The network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0083] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0084] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0085] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) first interface 705 is also connected to the bus 704.

[0086] The following components are connected to the I / O first interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network first interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O first interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0087] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0088] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0089] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0090] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an acquisition module, a first determination module, a second determination module and a processing module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the acquisition module may also be described as a "module for acquiring data synchronization requests".

[0091] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining a data synchronization request; determining a first index node code corresponding to the target model from a local backup directory according to the target model indicated by the data synchronization request; wherein the local backup directory includes index node codes corresponding to one or more model files created in advance; determining a second index node code corresponding to the current application model from a service directory, wherein the service directory includes one or more index node codes received in advance from the local backup directory, and the number of index nodes corresponding to each index node code; processing the number of index nodes corresponding to the first index node code and the second index node code, so as to use the target model as a new current application model according to the number of processed index nodes.

[0092] According to the technical solution of the embodiment of the present invention, by setting a local backup directory, the model files stored in the remote network disk are pre-pulled to the local computer. When the service directory is needed to load the model, there is no need to repeatedly pull the model files. It is only necessary to modify the number of index nodes of the first index node code corresponding to the target model and the second index node code corresponding to the current application model in the service directory. This avoids the problem of incomplete files caused by copying failures, saves data synchronization time, and realizes rapid processing of the model.

[0093] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for data synchronization, characterized in that: include: Get data synchronization request; According to the target model to be synchronized indicated by the data synchronization request, determining a first index node code corresponding to the target model from the local backup directory; wherein the local backup directory includes index node codes corresponding to one or more pre-created model files respectively; Determine a second index node code corresponding to the current application model from the service directory, wherein the service directory includes one or more index node codes received in advance from the local backup directory, and the number of index nodes corresponding to each index node code; The number of index nodes corresponding to the first index node code and the second index node code are processed respectively, so as to synchronize the target model to a new current application model according to the number of index nodes after the processing.

2. The method according to claim 1, characterized in that Also includes: An index node corresponding to the target model is created in the service directory, and the index node corresponding to the current application model is deleted.

3. The method according to claim 1, characterized in that The processing of the number of index nodes corresponding to the first index node code and the second index node code respectively includes: Determine, according to the number of index nodes in the local backup directory and the service directory, the number of first nodes corresponding to the first index node code and the number of second nodes corresponding to the second index node code; The first node quantity is incremented and the second node quantity is decremented to process the number of index nodes corresponding to the first index node code and the second index node code respectively.

4. The method according to claim 1, characterized in that: Before obtaining the data synchronization request, the method further includes: One or more model files are obtained by using a local backup directory, and index nodes corresponding to the model files and index node codes corresponding to the index nodes are created.

5. The method according to claim 4, characterized in that The determining the first index node code corresponding to the target model from the local backup directory includes: In the case that the first index node code does not exist in the local backup directory, the target model file corresponding to the target model is obtained by using the local backup directory, and the corresponding first index node code is created for the target model file.

6. The method according to claim 1, characterized in that Also includes: Verify the version code and model file corresponding to the model, and if the verification passes, load the target model by loading the machine learning model; According to the loading result, the service status of the target model is determined.

7. The method according to claim 1, characterized in that After obtaining the data synchronization request, the method further includes: modifying the service status of the model in the service catalog to be in the process of model updating or model restoring; Determining the service status of the target model according to the loading result includes: In the case of successful loading, the service status of the target model is determined to be update completed or recovery completed.

8. The method according to claim 7, characterized in that Also includes: In the case of a loading failure, the service status of the target model is determined to be an update failure or a recovery failure, and the service status is reported to an alarm system to indicate that the data synchronization request processing has failed.

9. A data synchronization device, characterized in that: include: An acquisition module, used to obtain data synchronization requests; A first determination module is used to determine, from a local backup directory, a first index node code corresponding to a target model to be synchronized indicated by the data synchronization request; wherein the local backup directory includes index node codes corresponding to one or more pre-created model files; A second determination module is used to determine a second index node code corresponding to the current application model from the service directory, wherein the service directory includes one or more index node codes received in advance from the local backup directory, and the number of index nodes corresponding to each index node code; The processing module is used to process the number of index nodes corresponding to the first index node code and the second index node code respectively, so as to use the target model as a new current application model according to the number of index nodes after the processing.

10. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.