Product synchronization method and device and storage medium

By receiving the product synchronization request from the client, the candidate node is determined based on identity information and permission information, the target score value of the candidate node is calculated, and the node with the highest score is selected as the target node for synchronization, which solves the problem of difficulty in selecting the optimal node during the product synchronization process in the prior art, and improves the product synchronization efficiency.

CN119938346APending Publication Date: 2025-05-06THE PEOPLES INSURANCE CO (GRP) OF CHINA LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411855814.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, it is difficult to select the optimal node during the product synchronization process, resulting in the product that may be lost or cannot be synchronized in time.

Method used

By receiving the client's product synchronization request, the candidate node is determined based on the identity information and permission information, the target score value of the candidate node is calculated, and the node with the highest score is selected as the target node for synchronization.

Benefits of technology

It effectively avoids the loss of products during the synchronization process or the inability to synchronize in time, and improves the efficiency of product synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938346A_ABST
    Figure CN119938346A_ABST
Patent Text Reader

Abstract

The invention discloses a product synchronization method and device, and the method comprises the steps: receiving a product synchronization request sent by a client, and the product synchronization request comprises the identity information and authority information of the client, and a to-be-synchronized product; based on identity information and authority information in the product synchronization request, at least one candidate node corresponding to the client is determined, and the node is used for synchronously distributing any product; determining a target node based on the target score value corresponding to the at least one candidate node; and pushing the product to be synchronized to the target node, and sending a synchronization completion message to the client. Therefore, the target node suitable for the client is determined based on the target score value corresponding to the at least one candidate node, multiple indexes corresponding to the node are considered, the situation that the product is lost or cannot be synchronized in time in the synchronization process is avoided, and the product synchronization efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of product synchronization, and in particular to a product synchronization method, device and storage medium. Background Art

[0002] At present, with the development of modern information system infrastructure, users will deploy corresponding server nodes in different regions to reduce the transmission pressure of the group backbone ring network. Among them, after the work-in-progress is completed, it is necessary to upload the work-in-progress to the node and distribute it synchronously. Based on this, it is necessary to determine the target node for the work-in-progress synchronization to avoid the loss of the work-in-progress during the synchronization process or the inability to synchronize in time.

[0003] In the prior art, the product can be uploaded to the nearest node, but the nearest node may have a high network usage rate at this time and cannot synchronize the product in time. Based on this, multiple factors need to be considered in the process of synchronizing the product to select the optimal node for product synchronization. Therefore, how to select the optimal node for product synchronization is an urgent problem to be solved. Summary of the invention

[0004] The present invention provides a product synchronization method and device for solving the technical problems in the above-mentioned related technologies. To this end, the present invention proposes a product synchronization method, which can determine a target node suitable for a client based on a target score value corresponding to at least one candidate node, taking into account multiple indicators corresponding to the node, avoiding the loss of products during the synchronization process or failure to synchronize in time, and improving the product synchronization efficiency.

[0005] Another object of the present invention is to provide a product synchronization device.

[0006] To achieve the above object, the present invention provides a product synchronization method, which includes:

[0007] Receive a product synchronization request sent by a client, wherein the product synchronization request includes the identity information, permission information and the product to be synchronized of the client;

[0008] Determine at least one candidate node corresponding to the client based on the identity information and permission information in the product synchronization request, wherein the node is used to synchronously distribute any product;

[0009] Determining a target node based on a target score value corresponding to the at least one candidate node;

[0010] The product to be synchronized is pushed to the target node, and a synchronization completion message is sent to the client.

[0011] The product synchronization method of the embodiment of the present invention may also have the following additional technical features:

[0012] In one embodiment of the present invention, determining at least one candidate node corresponding to the client based on the identity information and permission information in the product synchronization request includes:

[0013] Verifying the identity information;

[0014] If the verification is successful, at least one candidate node corresponding to the client is determined according to the authority information.

[0015] In one embodiment of the present invention, determining the target node based on the at least one candidate node includes:

[0016] determining a target area where the client is located,

[0017] Obtaining a first indicator corresponding to a candidate node in the target area;

[0018] Based on the first indicator, calculating a target score value corresponding to a node in the target area among the at least one candidate node;

[0019] Obtaining a second indicator corresponding to a candidate node that is not in the target area;

[0020] Based on the second indicator, calculating a target score value corresponding to a node in the at least one candidate node that is not in the target area;

[0021] A target node is determined based on a target score value corresponding to each node in the at least one candidate node.

[0022] In one embodiment of the present invention, the first indicator includes:

[0023] Memory usage;

[0024] CPU usage;

[0025] Network usage rate;

[0026] Disk usage;

[0027] distance.

[0028] In one embodiment of the present invention, the calculating, based on the first indicator, a target score value corresponding to a node in the target area among the at least one candidate node includes:

[0029] Based on the first indicator, obtaining a parameter value corresponding to the current first indicator of the candidate node;

[0030] Based on the parameter value, determining a scoring function corresponding to the first indicator;

[0031] Based on the scoring function and the parameter value, determining a scoring value corresponding to the first indicator;

[0032] The score values ​​corresponding to all the first indicators are added together to obtain a target score value corresponding to the node in the target area.

[0033] In one embodiment of the present invention, determining the target node based on the score value corresponding to each node in the at least one candidate node includes: sorting the target score value corresponding to each node in the at least one candidate node in ascending order, and determining the candidate node ranked first as the target node.

[0034] In one embodiment of the present invention, the method further comprises:

[0035] According to the synchronization strategy between the nodes, the artifacts between the nodes are synchronized.

[0036] To achieve the above object, the present invention provides a product synchronization device on the other hand, the device comprising:

[0037] A receiving module, configured to receive a product synchronization request sent by a client, wherein the product synchronization request includes the identity information, permission information and the product to be synchronized of the client;

[0038] A first determination module, configured to determine at least one candidate node corresponding to the client based on the identity information and permission information in the product synchronization request, wherein the node is used to synchronously distribute any product;

[0039] A second determination module, configured to determine a target node based on a target score value corresponding to the at least one candidate node;

[0040] The push module is used to push the product to be synchronized to the target node and send a synchronization completion message to the client.

[0041] Another object of the present invention is to provide an electronic device, comprising:

[0042] at least one processor; and

[0043] a memory communicatively connected to the at least one processor; wherein,

[0044] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the methods described in the above aspect.

[0045] Another object of the present invention is to provide a computer storage medium, wherein the computer storage medium stores computer executable instructions; after the computer executable instructions are executed by a processor, the computer executes any one of the methods described in the above aspect.

[0046] The product synchronization method and device of the embodiment of the present invention receive a product synchronization request sent by a client, wherein the product synchronization request includes the client's identity information, permission information, and the product to be synchronized; based on the identity information and permission information in the product synchronization request, determine at least one candidate node corresponding to the client, wherein the node is used to synchronize and distribute any product; based on the target score value corresponding to at least one candidate node, determine the target node; push the product to be synchronized to the target node, and send a synchronization completion message to the client. Thus, based on the target score value corresponding to at least one candidate node, a target node suitable for the client can be determined, taking into account multiple indicators corresponding to the node, avoiding the situation where the product is lost or cannot be synchronized in time during the synchronization process, and improving the product synchronization efficiency.

[0047] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0049] Figure 1 is a flowchart of a product synchronization method according to an embodiment of the present invention;

[0050] Figure 2 4 is a structural diagram of a product synchronization device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0052] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0053] The following describes a product synchronization method and device according to an embodiment of the present invention with reference to the accompanying drawings.

[0054] Figure 1 It is a flowchart of the product synchronization method according to an embodiment of the present invention.

[0055] like Figure 1 As shown, the method includes:

[0056] S1, receiving a product synchronization request sent by a client, wherein the product synchronization request includes the client's identity information, permission information and the product to be synchronized;

[0057] In one embodiment of the present invention, the above-mentioned identity information may include the client's account name and password.

[0058] Furthermore, in one embodiment of the present invention, the permission information may include nodes that the client can access.

[0059] In one embodiment of the present invention, the above-mentioned nodes may include edge nodes and central nodes, and corresponding central nodes and edge nodes are deployed in different regions. Among them, edge nodes and central nodes can be used to synchronously distribute any product, and edge nodes can synchronize products to central nodes, and central nodes in different regions synchronize products across regions.

[0060] S2, determining at least one candidate node corresponding to the client based on the identity information and permission information in the product synchronization request;

[0061] In one embodiment of the present invention, after receiving the product synchronization request sent by the client through the above steps, at least one candidate node corresponding to the client can be determined based on the identity information and permission information in the product synchronization request.

[0062] Specifically, in one embodiment of the present invention, the method for determining at least one candidate node corresponding to the client based on the identity information and permission information in the product synchronization request may include the following steps:

[0063] S21, verifying the identity information;

[0064] S22: If the verification is successful, at least one candidate node corresponding to the client is determined according to the authority information.

[0065] In one embodiment of the present invention, the account name and password in the identity information may be verified. If the account name exists and the account name and password are correct, the verification is successful; otherwise, a prompt message indicating that the account name / password is incorrect is sent to the client.

[0066] And, in one embodiment of the present invention, if the verification is successful, network detection is performed on all nodes in the permission information, and the node that is successfully detected is determined as at least one candidate node corresponding to the client; if all nodes fail to be detected, a prompt message indicating that synchronization cannot be achieved is sent to the client. In one embodiment of the present invention, the method for performing network detection can be to determine whether the network of the node can successfully communicate.

[0067] S3, determining a target node based on a target score value corresponding to at least one candidate node;

[0068] In one embodiment of the present invention, after obtaining at least one candidate node through the above steps, the target node may be determined based on the target score value corresponding to the at least one candidate node.

[0069] Specifically, in one embodiment of the present invention, based on the target score value corresponding to at least one candidate node, the method for determining the target node may include the following steps:

[0070] S31, determining the target area where the client is located;

[0071] S32, obtaining a first index corresponding to the candidate node in the target area;

[0072] S33, calculating a target score value corresponding to a node in the target area among at least one candidate node based on the first indicator;

[0073] S34, obtaining a second index corresponding to the candidate node that is not in the target area;

[0074] S35, calculating a target score value corresponding to a node that is not in the target area among at least one candidate node based on the second indicator;

[0075] S36: Determine a target node based on the target score value corresponding to each node in at least one candidate node.

[0076] In one embodiment of the present invention, the target area where the client is located can be determined according to the beginning value of the client IP.

[0077] And, in one embodiment of the present invention, the first indicator may include:

[0078] Memory usage;

[0079] CPU usage;

[0080] Network usage rate;

[0081] Disk usage;

[0082] distance.

[0083] Further, in one embodiment of the present invention, the method for calculating the target score value corresponding to the node in the target area among at least one candidate node based on the first indicator may include the following steps:

[0084] S331, based on the first indicator, obtaining a parameter value corresponding to the current first indicator of the candidate node;

[0085] S332, determining a scoring function corresponding to the first indicator based on the parameter value;

[0086] S333, determining a scoring value corresponding to the first indicator based on the scoring function and the parameter value;

[0087] S334: Add the score values ​​corresponding to all the first indicators to obtain the target score value corresponding to the node in the target area.

[0088] Among them, in one embodiment of the present invention, different parameter values ​​correspond to different scoring functions. Specifically, in one embodiment of the present invention, based on the parameter value, the method for determining the scoring function corresponding to the first indicator may include: if the parameter value is in a first interval, determining that the scoring function corresponding to the first indicator is the first function; if the parameter value is in a second interval, determining that the scoring function corresponding to the first indicator is the second function.

[0089] And, in one embodiment of the present invention, the first interval is [0, K), and the corresponding first function is: f(x) = a(xq) b +p; the second interval is [K, 1], and the corresponding second function is: f(x) = c(d×xm) f + n. The above parameters K, a, b, c, d, m, f, n, p and q can be determined based on experiments.

[0090] For example, the first interval is [0, 0.5), and the corresponding first function is: f(x) = (x-0.1) 5 +0.001; the second interval is [0.5, 1], and the corresponding second function is: f(x) = 1.2×x 2 -0.2.

[0091] Furthermore, in one embodiment of the present invention, the value ranges of the CPU usage rate, network usage rate and disk usage rate in the above-mentioned first indicator are all within [0, 1]. Based on this, the corresponding scoring function can be directly determined by the interval in which the parameter value is located. Also, the distance in the above-mentioned first indicator is an integer greater than 1. When determining the scoring function corresponding to the distance indicator, it is necessary to convert the distance indicator into a value in [0, 1]. Specifically, in one embodiment of the present invention, the distances from the candidate nodes in the target area to the client are sorted from far to near, the corresponding value of the nearest candidate node is 0, the corresponding distance value of the farthest candidate node is 1, and the other candidate nodes are respectively 1 / n, 2 / n, ..., n-1 / n according to the distance from far to near. Based on this, the values ​​corresponding to the above distances are all [0, 1], and the corresponding scoring function can be determined by the above method, and the corresponding scoring value is determined based on the scoring function.

[0092] Furthermore, in one embodiment of the present invention, in the process of pushing products through candidate nodes that are not in the target area, cross-city node transmission is required, and at this time, the use calculation of the backbone ring network also needs to be considered.

[0093] Based on this, in one embodiment of the present invention, the second indicator may include:

[0094] Memory usage;

[0095] CPU usage;

[0096] Network usage rate;

[0097] Disk usage;

[0098] Backbone ring network utilization rate;

[0099] distance.

[0100] Among them, in one embodiment of the present invention, the distances of the candidate nodes not in the target area are all 1. And, in one embodiment of the present invention, the method for calculating the target score value corresponding to at least one candidate node not in the target area based on the second indicator is the same as the above method, and the embodiment of the present disclosure will not be described in detail here.

[0101] Further, in one embodiment of the present invention, after obtaining the target score value corresponding to each node in at least one candidate node through the above steps, the target node can be determined based on the target score value corresponding to each node in at least one candidate node.

[0102] Among them, in one embodiment of the present invention, the method for determining the target node based on the score value corresponding to each node in at least one candidate node may include: sorting the target score value corresponding to each node in at least one candidate node in ascending order, and determining the candidate node ranked first as the target node.

[0103] S4: Push the products to be synchronized to the target node and send a synchronization completion message to the client.

[0104] In one embodiment of the present invention, after the target node is determined through the above steps, the product to be synchronized can be pushed to the target node, and a synchronization completion message is sent to the client, thereby completing the push task.

[0105] Among them, in one embodiment of the present invention, after the product to be synchronized is pushed to the target node, the products between the nodes can also be synchronized according to the synchronization strategy between the nodes. Specifically, in one embodiment of the present invention, multiple synchronization strategies can be supported between central nodes in different regions. The synchronization strategy can include immediate execution, scheduled execution, and real-time execution. Based on this, the products between the nodes can be synchronized according to the preset synchronization strategy. Among them, if the above-mentioned target node is an edge node, the edge node is required to synchronize the product to the corresponding central node, and then synchronize the products between the nodes according to the synchronization strategy between the nodes.

[0106] And, in one embodiment of the present invention, the above method may also include: receiving a product pull request sent by a client, and after the client is authenticated, if the product to be pulled is stored in the node closest to the client, it will be returned directly; if the nearest node does not have it, it will be returned from the corresponding central node.

[0107] In the product synchronization method proposed in the present invention, a product synchronization request sent by a client is received, wherein the product synchronization request includes the client's identity information, permission information, and the product to be synchronized; based on the identity information and permission information in the product synchronization request, at least one candidate node corresponding to the client is determined, wherein the node is used to synchronize and distribute any product; based on the target score value corresponding to at least one candidate node, a target node is determined; the product to be synchronized is pushed to the target node, and a synchronization completion message is sent to the client. Thus, based on the target score value corresponding to at least one candidate node, a target node suitable for the client can be determined, taking into account a variety of indicators corresponding to the node, avoiding the situation where the product is lost or cannot be synchronized in time during the synchronization process, and improving the product synchronization efficiency.

[0108] In order to implement the above embodiment, Figure 2 As shown, in this embodiment, a product synchronization device 10 is also provided, and the device includes:

[0109] The receiving module 201 is used to receive a product synchronization request sent by a client, wherein the product synchronization request includes the client's identity information, permission information and the product to be synchronized;

[0110] A first determination module 202 is used to determine at least one candidate node corresponding to the client based on the identity information and permission information in the product synchronization request, wherein the node is used to synchronize and distribute any product;

[0111] A second determination module 203, configured to determine a target node based on a target score value corresponding to at least one candidate node;

[0112] The push module 204 is used to push the product to be synchronized to the target node and send a synchronization completion message to the client.

[0113] Furthermore, the first determining module 202 is specifically configured to:

[0114] Verify identity information;

[0115] If the verification is successful, at least one candidate node corresponding to the client is determined based on the authority information.

[0116] Furthermore, the second determining module 203 is specifically configured to:

[0117] Determine the target region where the client is located.

[0118] Obtaining a first indicator corresponding to a candidate node in a target area;

[0119] Based on the first indicator, calculating a target score value corresponding to a node in the target area among at least one candidate node;

[0120] Obtain a second indicator corresponding to the candidate node that is not in the target area;

[0121] Based on the second indicator, calculating a target score value corresponding to at least one candidate node that is not in the target area;

[0122] A target node is determined based on a target score value corresponding to each node in at least one candidate node.

[0123] Furthermore, the above first indicator includes:

[0124] Memory usage;

[0125] CPU usage;

[0126] Network usage rate;

[0127] Disk usage;

[0128] distance.

[0129] Furthermore, the second determining module 203 is further configured to:

[0130] Based on the first indicator, obtain the parameter value corresponding to the current first indicator of the candidate node;

[0131] Based on the parameter value, determining a scoring function corresponding to the first indicator;

[0132] Determine a scoring value corresponding to the first indicator based on the scoring function and the parameter value;

[0133] The score values ​​corresponding to all the first indicators are added together to obtain the target score value corresponding to the node in the target area.

[0134] Furthermore, the second determining module 203 is further configured to:

[0135] The target score value corresponding to each node in at least one candidate node is sorted in ascending order, and the candidate node ranked first is determined as the target node.

[0136] Furthermore, the above device is also used for:

[0137] Synchronize artifacts between nodes according to the synchronization strategy between nodes.

[0138] In the product synchronization device proposed in the present invention, a product synchronization request sent by a client is received, wherein the product synchronization request includes the client's identity information, permission information, and the product to be synchronized; based on the identity information and permission information in the product synchronization request, at least one candidate node corresponding to the client is determined, wherein the node is used to synchronize and distribute any product; based on the target score value corresponding to at least one candidate node, a target node is determined; the product to be synchronized is pushed to the target node, and a synchronization completion message is sent to the client. Thus, based on the target score value corresponding to at least one candidate node, a target node suitable for the client can be determined, taking into account a variety of indicators corresponding to the node, avoiding the situation where the product is lost or cannot be synchronized in time during the synchronization process, and improving the product synchronization efficiency.

[0139] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0140] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

Claims

1. A product synchronization method, characterized in that: The method comprises: Receive a product synchronization request sent by a client, wherein the product synchronization request includes the identity information, permission information and the product to be synchronized of the client; Determine at least one candidate node corresponding to the client based on the identity information and permission information in the product synchronization request, wherein the node is used to synchronously distribute any product; Determining a target node based on a target score value corresponding to the at least one candidate node; The product to be synchronized is pushed to the target node, and a synchronization completion message is sent to the client.

2. The method according to claim 1, characterized in that The determining, based on the identity information and the permission information in the product synchronization request, at least one candidate node corresponding to the client includes: Verifying the identity information; If the verification is successful, at least one candidate node corresponding to the client is determined according to the authority information.

3. The method according to claim 1, characterized in that The determining of the target node based on the at least one candidate node includes: Determine the target area where the client is located; Obtaining a first indicator corresponding to a candidate node in the target area; Based on the first indicator, calculating a target score value corresponding to a node in the target area among the at least one candidate node; Obtaining a second indicator corresponding to a candidate node that is not in the target area; Based on the second indicator, calculating a target score value corresponding to a node in the at least one candidate node that is not in the target area; A target node is determined based on a target score value corresponding to each node in the at least one candidate node.

4. The method according to claim 3, characterized in that The first indicator includes: Memory usage; CPU usage; Network usage rate; Disk usage; distance.

5. The method according to claim 3, characterized in that: The calculating, based on the first indicator, a target score value corresponding to a node in the target area among the at least one candidate node includes: Based on the first indicator, obtaining a parameter value corresponding to the current first indicator of the candidate node; Based on the parameter value, determining a scoring function corresponding to the first indicator; Based on the scoring function and the parameter value, determining a scoring value corresponding to the first indicator; The score values ​​corresponding to all the first indicators are added together to obtain a target score value corresponding to the node in the target area.

6. The method according to claim 3, characterized in that The determining the target node based on the score value corresponding to each node in the at least one candidate node includes: sorting the target score value corresponding to each node in the at least one candidate node in ascending order, and determining the candidate node ranked first as the target node.

7. The method according to claim 1, characterized in that The method further comprises: According to the synchronization strategy between the nodes, the artifacts between the nodes are synchronized.

8. A product synchronization device, characterized in that: The device comprises: A receiving module, configured to receive a product synchronization request sent by a client, wherein the product synchronization request includes the identity information, permission information and the product to be synchronized of the client; A first determination module, configured to determine at least one candidate node corresponding to the client based on the identity information and permission information in the product synchronization request, wherein the node is used to synchronously distribute any product; A second determination module, configured to determine a target node based on a target score value corresponding to the at least one candidate node; The push module is used to push the product to be synchronized to the target node and send a synchronization completion message to the client.

9. An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A computer storage medium, wherein: The computer storage medium stores computer executable instructions; after the computer executable instructions are executed by the processor, the method according to any one of claims 1 to 7 can be implemented.