Resource synchronization method, device and equipment and readable storage medium
By combining resource synchronization methods with microservice technology, we can listen to resource change events, filter, generate verification marks and synchronize them to off-site nodes, solving the problem of excessive CPU occupation in the existing technology, real-time monitoring of resource status and off-site resources are realized efficient synchronization.
Patent Information
- Application Number
- CN202411646825.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-15
AI Technical Summary
In the existing resource synchronization technology, the server needs to regularly query the status of the resource node to identify data updates, resulting in excessive CPU usage.
Using a resource synchronization method combined with microservice technology, we listen to resource change events of the target node, evaluate whether synchronization is needed through regular filtering, generate a verification mark and write it to the lock queue, and synchronize to a remote node.
It reduces CPU usage, improves CPU utilization, avoids unnecessary resource information synchronization, and saves the processing burden of network transmission and off-site nodes.
Smart Images

Figure CN119449827A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a resource synchronization method, device, equipment and readable storage medium. Background Art
[0002] From the perspective of basic operation and maintenance security, the data on the website not only needs to be backed up regularly, but also needs to be backed up off-site.
[0003] In the prior art, in order to perform off-site backup, a resource synchronization system is deployed on the server, and after confirming that the local website data is updated, the new website data is synchronized to the off-site. However, in order to identify whether the website data is updated, the server will regularly query the status of each resource node, resulting in a high consumption of the server's CPU. Summary of the invention
[0004] In view of this, the present application provides a resource synchronization method, apparatus, device and readable storage medium, which are used to solve the shortcoming of excessive CPU occupancy in existing resource synchronization technologies.
[0005] In order to achieve the above objectives, the proposed solution is as follows:
[0006] A resource synchronization method is applied to a target node of a distributed management system, and the resource synchronization method comprises:
[0007] In combination with microservice technology, the resource change event of the corresponding target node is monitored, and after the resource change event is monitored, the resource change information of the target node is determined;
[0008] Perform regular filtering on the resource change information to evaluate whether the resource change information needs to be synchronized with a remote node;
[0009] If yes, generating a verification mark of the resource change information;
[0010] Writing the verification identifier and the resource change information into a lock queue;
[0011] The lock queue is used to synchronize the verification identifier and the resource change information to the remote node, so that the remote node can perform resource synchronization based on the received resource change information after confirming through the verification identifier that the received resource change information is correctly transmitted.
[0012] Optionally, the combining of microservice technology to monitor resource change events of corresponding target nodes includes:
[0013] In response to the user's resource change operation, combined with microservice technology, the resource change information corresponding to the resource change operation is determined, and the resource change information is written into the message queue;
[0014] The message queue is monitored to determine whether there is a resource change event.
[0015] Optionally, after monitoring the resource change event, determining the resource change information of the target node includes:
[0016] After monitoring the resource change event, in combination with microservice technology, resource change information including object identification and path information corresponding to the resource change event is obtained from the message queue.
[0017] Optionally, regular filtering is performed on the resource change information to evaluate whether the resource change information needs to be synchronized with a remote node, including:
[0018] Constructing a regular expression based on the local resources of the target node;
[0019] The resource change information is filtered using the regular expression to evaluate whether the resource change information needs to be synchronized with a remote node.
[0020] Optionally, generating a verification mark of the resource change information includes:
[0021] The summary value of the resource change information is used as the verification identifier.
[0022] Optionally, using the lock queue to synchronize the verification identifier and the resource change information to the remote node includes:
[0023] Send a heartbeat detection of a long connection to the remote node, and receive a confirmation message replied by the remote node;
[0024] When the received confirmation information indicates that the connection is normal, the verification identifier and the resource change information are sent to the remote node using the lock queue.
[0025] Optionally, after sending a heartbeat detection of a long connection to the remote node and receiving confirmation information replied by the remote node, the method further includes:
[0026] When the received confirmation information indicates that the connection is abnormal, performing a password verification on the remote node;
[0027] After the remote node passes the password verification, a transmission channel is established;
[0028] In combination with the transmission channel and based on the lock queue, the verification identifier and the resource change information are sent to the remote node.
[0029] A resource synchronization device, comprising a target node of a distributed management system to which the resource synchronization device is applied, the resource synchronization device comprising:
[0030] A monitoring module is used to monitor resource change events of the corresponding target node in combination with microservice technology, and after monitoring the resource change events, determine the resource change information of the target node;
[0031] A filter is used to perform regular filtering on the resource change information and evaluate whether the resource change information needs to be synchronized with a remote node; if so, calling a write module and a lock queue;
[0032] A writing module, used to generate a verification mark of the resource change information, and write the verification mark and the resource change information into a lock queue;
[0033] The lock queue is used to synchronize the verification identifier and the resource change information to the remote node, so that the remote node can perform resource synchronization based on the received resource change information after confirming through the verification identifier that the received resource change information is transmitted correctly.
[0034] A resource synchronization device comprises a memory and a processor;
[0035] The memory is used to store programs;
[0036] The processor is used to execute the program to implement each step of the above-mentioned resource synchronization method.
[0037] A readable storage medium stores a computer program thereon, characterized in that when the computer program is executed by a processor, each step of the above-mentioned resource synchronization method is implemented.
[0038] It can be seen from the above technical scheme that the resource synchronization method provided by the present application can be applied to the target node of the distributed management system. The method can be combined with microservice technology to monitor the resource change events of the corresponding target node, and after monitoring the resource change events, determine the resource change information of the target node; based on this, the present application can use microservice technology to realize real-time monitoring of resource status and real-time acquisition of resource change information; at the same time, resource isolation can be achieved through microservice technology to avoid affecting the normal use of the CPU by other processes, improve CPU utilization, and reduce CPU occupancy; thus, by combining microservice technology to monitor resource change events, the present application can complete the determination of resource status changes while reducing CPU occupancy; subsequently, the present application can perform regular filtering on the resource change information to evaluate whether the resource change information needs to be synchronized with remote nodes; based on this, the present application Regular filtering can be used to evaluate whether the resource change information meets the synchronization conditions of the remote node, avoid unnecessary resource information synchronization, reduce network transmission and the processing burden of the remote node, and save CPU occupancy; then, if synchronization with the remote node is required, a verification mark of the resource change information can be generated; the verification mark and the resource change information are written into the lock queue; the lock queue is used to synchronize the verification mark and the resource change information to the remote node, so that the remote node can perform resource synchronization based on the received resource change information after confirming that the received resource change information is correctly transmitted through the verification mark; based on this, the present application can use the lock queue to synchronize the verification mark and resource change information to the remote node, and use the data transmission system coordination ability of the lock queue and the role of ensuring data consistency to reduce concurrent conflicts, thereby reducing CPU occupancy; the verification mark ensures the reliability and integrity of the resource change information. It can be seen that the present application can achieve remote resource synchronization while reducing CPU occupancy. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0040] Figure 1 A flow chart of a resource synchronization method disclosed in an embodiment of the present application;
[0041] Figure 2 A structural block diagram of a resource synchronization device disclosed in an embodiment of the present application;
[0042] Figure 3This is a hardware structure block diagram of a resource synchronization device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0044] An embodiment of the present application provides a resource synchronization method, which can be applied to target nodes of various distributed management systems, and its execution subject can be a processor or server of a computer terminal or an intelligent terminal.
[0045] Among them, any node of the distributed management system can be used as the target node.
[0046] The target node can be deployed on the network side.
[0047] Next, combine Figure 1 The resource synchronization method of the present application is described in detail, including the following steps:
[0048] Step S1: In combination with microservice technology, monitor the resource change event of the corresponding target node, and after monitoring the resource change event, determine the resource change information of the target node.
[0049] Specifically, different tools can be generated based on microservice technology;
[0050] One of the tools is used to monitor resource change events of the corresponding target node, and the other tool is used to determine resource change information of the target node after monitoring the resource change events.
[0051] The resource change event may be a static resource addition event, a static resource deletion event, a static resource modification event, or a static resource check event.
[0052] Static resources can include any one or more of the following: text, images, html, css, js, fonts.
[0053] Resource change information can be used to locate static resources that have changed and the type of change.
[0054] The resource change information may include the object identifier and path information of the corresponding static resource.
[0055] Step S2: Regularization filtering is performed on the resource change information to evaluate whether the resource change information needs to be synchronized with a remote node. If yes, step S3 is executed.
[0056] Specifically, the resource change information can be regularized and filtered using the path information in the resource change information to obtain the filtering result;
[0057] Based on the filtering results, evaluate whether resource change information needs to be synchronized with remote nodes.
[0058] If the resource change information needs to be synchronized with the remote node, step S3 is executed.
[0059] If the resource change information does not need to be synchronized with the remote nodes, stop.
[0060] The remote node may be any one or more nodes in the distributed management system except the target node.
[0061] Step S3: Generate a verification mark for the resource change information.
[0062] Specifically, the verification mark of the resource change information can be generated in a variety of ways.
[0063] For example, a message digest algorithm can be used to generate a verification mark for resource change information;
[0064] The signature algorithm can also be used to generate a verification mark for resource change information;
[0065] A cyclic redundancy check (CRC) algorithm may also be used to generate a check mark for resource change information.
[0066] Step S4: writing the verification identifier and the resource change information into a lock queue.
[0067] Specifically, the verification identifier and the resource change information may be written into the lock queue of the target node accordingly.
[0068] Print lock information through logs to lock resource change information such as file name, path, timestamp, text length, etc.
[0069] Step S5: Utilize the lock queue to synchronize the verification identifier and the resource change information to the remote node.
[0070] Specifically, the lock queue can be used to transmit the verification identifier and resource change information to the remote node, so that the remote node can perform reliability verification on the received resource change information based on the verification identifier. After the resource change information passes the reliability verification, resource synchronization is performed based on the received resource change information.
[0071] During the transmission process, the lock queue can be used to monitor the transmission status of the verification identifier and resource change information, and when the transmission fails, the retransmission mechanism of the lock queue can be used to retransmit the verification identifier and resource change information.
[0072] After the retransmission fails, the verification identifier and resource change information may be recorded accordingly, and the recorded verification identifier and resource change information may be transmitted to the terminal of the administrator.
[0073] It is also possible to periodically trigger a thread for scanning and retransmitting failed resource change information, and implement a transmission retry mechanism for the resource change information.
[0074] This application supports execution on Windows and Linux systems, and can transmit resource change information in real time across systems.
[0075] It can be seen from the above technical scheme that the resource synchronization method provided by the present application can be applied to the target node of the distributed management system. The method can be combined with microservice technology to monitor the resource change events of the corresponding target node, and after monitoring the resource change events, determine the resource change information of the target node; based on this, the present application can use microservice technology to realize real-time monitoring of resource status and real-time acquisition of resource change information; at the same time, resource isolation can be achieved through microservice technology to avoid affecting the normal use of the CPU by other processes, improve CPU utilization, and reduce CPU occupancy; thus, by combining microservice technology to monitor resource change events, the present application can complete the determination of resource status changes while reducing CPU occupancy; subsequently, the present application can perform regular filtering on the resource change information to evaluate whether the resource change information needs to be synchronized with remote nodes; based on this, the present application Regular filtering can be used to evaluate whether the resource change information meets the synchronization conditions of the remote node, avoid unnecessary resource information synchronization, reduce network transmission and the processing burden of the remote node, and save CPU occupancy; then, if synchronization with the remote node is required, a verification mark of the resource change information can be generated; the verification mark and the resource change information are written into the lock queue; the lock queue is used to synchronize the verification mark and the resource change information to the remote node, so that the remote node can perform resource synchronization based on the received resource change information after confirming that the received resource change information is correctly transmitted through the verification mark; based on this, the present application can use the lock queue to synchronize the verification mark and resource change information to the remote node, and use the data transmission system coordination ability of the lock queue and the role of ensuring data consistency to reduce concurrent conflicts, thereby reducing CPU occupancy; the verification mark ensures the reliability and integrity of the resource change information. It can be seen that the present application can achieve remote resource synchronization while reducing CPU occupancy.
[0076] In some embodiments of the present application, the process of monitoring resource change events of the corresponding target node in step S1 in combination with microservice technology is described in detail, and the steps are as follows:
[0077] S10. Respond to the user's resource change operation, combine microservice technology, determine the resource change information corresponding to the resource change operation, and write the resource change information into a message queue.
[0078] Specifically, it can respond to the user's static resource change operation, obtain the file service system and drift tool created based on microservice technology, and determine the resource change information corresponding to the resource change operation through the file service system.
[0079] Subsequently, resource change information can be written into the message queue through the file service system.
[0080] S11. Monitor the message queue to determine whether there is a resource change event.
[0081] Specifically, the drift tool can be used to monitor the message queue and determine whether there is a resource change event based on the data written in the message queue.
[0082] It can be seen from the above technical solution that this embodiment provides an optional method of combining microservice technology to monitor resource change events of the corresponding target node. Through the above method, real-time monitoring and real-time perception of resource change events can be achieved by monitoring the message queue, further improving the real-time performance of resource synchronization in this application.
[0083] In some embodiments of the present application, the process of determining the resource change information of the target node after monitoring the resource change event in step S1 is described in detail, and the steps are as follows:
[0084] S12. After monitoring the resource change event, in combination with microservice technology, obtain resource change information including object identification and path information corresponding to the resource change event from the message queue.
[0085] Specifically, you can get the Drift tool built on microservices technology;
[0086] The Drift tool can be used to obtain resource change information corresponding to resource change events from the message queue of the target node.
[0087] The resource change information may include a generation timestamp, an object identifier, and path information of a corresponding resource change event.
[0088] The object identifier can be used to determine the static resource subject corresponding to the resource change event;
[0089] The path information can be used to locate the static resource corresponding to the resource change event.
[0090] It can be seen from the above technical solution that this embodiment provides an optional way to determine the resource change information of the target node after monitoring the resource change event. Through the above method, the present application can achieve the acquisition of resource change information through the message queue, better complete the acquisition of resource change information, and simplify the difficulty of obtaining resource change information. At the same time, the resource change information obtained by the present application contains object identification and path information, which is convenient for determining and locating the static resources that have been changed in the target node, and better realizing resource synchronization.
[0091] In some embodiments of the present application, step S2, the process of regular filtering the resource change information and evaluating whether the resource change information needs to be synchronized with the remote node is described in detail, and the steps are as follows:
[0092] S20: Construct a regular expression based on the local resources of the target node.
[0093] Specifically, a regular expression for filtering may be generated based on the path information of the local static resource in the target node.
[0094] Among them, the local static resources are static resources in the target node that do not need to be synchronized.
[0095] S21. Filter the resource change information using the regular expression to evaluate whether the resource change information needs to be synchronized with a remote node.
[0096] Specifically, based on the regular expression and the path information in the resource change information, it can be evaluated whether the resource change information belongs to a static resource inside the target node that does not need to be synchronized with other nodes.
[0097] It can be seen from the above technical solution that this embodiment provides an optional method for performing regular filtering on the resource change information and evaluating whether the resource change information needs to be synchronized with remote nodes. The above method can be used to construct a regular expression and use the regular expression to filter the resource change information to determine whether the resource change information needs to be synchronized with resource change events of other nodes in the distributed management system except the target node, thereby improving the reliability of resource synchronization.
[0098] In some embodiments of the present application, the process of step S3, generating a verification mark of the resource change information, is described in detail, and the steps are as follows:
[0099] S30: Use the summary value of the resource change information as the verification identifier.
[0100] Specifically, a summary value of the resource change information may be generated in a variety of ways, and the summary value may be used as a verification identifier of the resource change information.
[0101] The Message-Digest Algorithm 5 algorithm may be used to generate an MD5 value of the resource change information, and the MD5 value may be used as a verification identifier of the resource change information.
[0102] A text summary algorithm such as the TextRank algorithm may be used to generate a text summary value of the resource change information, and the text summary value may be used as a verification identifier of the resource change information.
[0103] It can be seen from the above technical solution that this embodiment provides an optional method for generating a verification identifier for the resource change information. Through the above method, a summary value of the resource change information can be generated through a text summary algorithm or a hash algorithm, and the generated summary value can be used as a verification identifier; based on this, the present application can use different algorithms to generate a verification identifier according to actual scenario requirements.
[0104] In some embodiments of the present application, the process of step S5, using the lock queue to synchronize the verification identifier and the resource change information to the remote node is described in detail, and the steps are as follows:
[0105] S50, sending a heartbeat detection of a long connection to the remote node, and receiving confirmation information replied by the remote node.
[0106] Specifically, a heartbeat detection of a long connection can be sent to a remote node, and a response to the heartbeat detection from the remote node can be received to determine whether the connection between the target node and the remote node is normal.
[0107] S51. When the received confirmation information indicates that the connection is normal, use the lock queue to send the verification identifier and the resource change information to the remote node.
[0108] Specifically, after receiving the confirmation message replied by the remote node, the confirmation information can be parsed, and when the confirmation information indicates that the connection between the target node and the remote node is still normal, a health check can be performed on the socket of the remote node.
[0109] After the remote node passes the health check, the lock queue can be used to transmit the verification flag to the remote node;
[0110] After receiving the reply data from the remote node indicating that the verification identifier has been received correctly, the lock queue can be used to transmit the resource change information to the remote node.
[0111] At the same time, in order to ensure the security of data, the SM2 symmetric encryption method can be used to encrypt and transmit the verification identifier and resource change information.
[0112] Can receive json objects returned by remote nodes;
[0113] Determine whether the verification mark and resource change information are transmitted successfully based on the JSON object;
[0114] If successful, it is recorded in the success log and the corresponding resource change information is released in the lock queue;
[0115] If it fails, it will be recorded in the failure log and wait for the timer thread to retry.
[0116] The retry thread is triggered every 3 minutes. This thread is responsible for scanning and processing static files that have failed to be transmitted, and retrying the file transmission. If the synchronization fails again, the file information will be recorded in the specified text and notified to the operation and maintenance personnel by triggering an alarm.
[0117] When receiving resource synchronization information sent by other nodes, locating local static resources based on the resource object identifier in the resource synchronization information;
[0118] Compare the latest change timestamp of the local static resource with the generation timestamp in the resource synchronization information to determine whether the local static resource is the latest resource;
[0119] If so, the static resources corresponding to the resource synchronization information sent by other nodes are rejected.
[0120] If not, the static resources corresponding to the resource synchronization information sent by other nodes are received.
[0121] It can be seen from the above technical solution that this embodiment provides an optional method of using the lock queue to synchronize the verification identifier and the resource change information to the remote node. Through the above method, the verification identifier and resource change information can be synchronized after the remote node passes the heartbeat detection.
[0122] In some embodiments of the present application, considering that the connection between the remote node and the target node may be abnormal, a transmission process when the connection is abnormal can be added. Next, the transmission process will be described in detail, and the steps are as follows:
[0123] S52: When the received confirmation information indicates that the connection is abnormal, a password verification is performed on the remote node.
[0124] Specifically, a password may be generated and sent to a remote node with an abnormal connection.
[0125] S53: after the remote node passes the password verification, a transmission channel is established.
[0126] Specifically, after the reply information returned by the remote node passes the password verification, the transmission channel between the target node and the remote node can be re-established.
[0127] S54. In combination with the transmission channel and based on the lock queue, the verification identifier and the resource change information are sent to the remote node.
[0128] Specifically, the verification identifier and resource change information can be synchronized to the remote node based on the lock queue and the transmission.
[0129] It can be seen from the above technical solution that this embodiment provides a method for synchronizing resource change information when the connection between the target node and the remote node is abnormal. Through the above method, the reliability of the remote node can be determined through password verification, further ensuring the data security of this application.
[0130] Next, we will combine Figure 2 The resource synchronization device provided in the present application is introduced in detail. The resource synchronization device provided below can be compared with the resource synchronization method provided above.
[0131] See also Figure 2 It can be found that the resource synchronization device may include:
[0132] The monitoring module 10 is used to monitor the resource change event of the corresponding target node in combination with the microservice technology, and determine the resource change information of the target node after monitoring the resource change event;
[0133] The filter 20 is used to perform regular filtering on the resource change information and evaluate whether the resource change information needs to be synchronized with the remote node; if so, the write module and the lock queue are called;
[0134] A writing module 30, used to generate a verification mark of the resource change information, and write the verification mark and the resource change information into a lock queue;
[0135] The lock queue 40 is used to synchronize the verification identifier and the resource change information to the remote node, so that the remote node can perform resource synchronization based on the received resource change information after confirming through the verification identifier that the received resource change information is transmitted correctly.
[0136] Furthermore, the monitoring module may include:
[0137] The resource change operation response unit is used to respond to the user's resource change operation, determine the resource change information corresponding to the resource change operation in combination with microservice technology, and write the resource change information into the message queue;
[0138] The message queue monitoring unit is used to monitor the message queue to determine whether there is a resource change event.
[0139] Furthermore, the monitoring module may also include:
[0140] The resource change information acquisition unit is used to acquire the resource change information including the object identifier and path information corresponding to the resource change event from the message queue in combination with the microservice technology after monitoring the resource change event.
[0141] Further, filters may include:
[0142] A regular expression building unit, used to build a regular expression based on the local resources of the target node;
[0143] The regular expression utilizing unit is used to utilize the regular expression to filter the resource change information and evaluate whether the resource change information needs to be synchronized with a remote node.
[0144] Further, the writing module may include:
[0145] A summary value generating unit is used to use the summary value of the resource change information as the verification identifier.
[0146] Furthermore, the lock queue may include:
[0147] A heartbeat detection sending unit, used to send a long-connected heartbeat detection to the remote node, and receive confirmation information replied by the remote node;
[0148] The resource change information sending unit is used to send the verification identifier and the resource change information to the remote node when the received confirmation information indicates that the connection is normal.
[0149] Further, the resource change information sending unit may include:
[0150] A password verification component, used to perform password verification on the remote node when the received confirmation information indicates that the connection is abnormal;
[0151] A transmission channel establishment component, used to establish a transmission channel after the remote node passes the password verification;
[0152] The transmission channel utilizes a component for combining with the transmission channel to send the verification identifier and the resource change information to the remote node.
[0153] The resource synchronization device provided in the embodiment of the present application can be applied to resource synchronization devices, such as PC terminals, cloud platforms, servers and server clusters. Figure 3The hardware structure diagram of the resource synchronization device is shown in FIG. Figure 3 ,The hardware structure of the resource synchronization device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;
[0154] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0155] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0156] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;
[0157] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:
[0158] In combination with microservice technology, the resource change event of the corresponding target node is monitored, and after the resource change event is monitored, the resource change information of the target node is determined;
[0159] Perform regular filtering on the resource change information to evaluate whether the resource change information needs to be synchronized with a remote node;
[0160] If yes, generating a verification mark of the resource change information;
[0161] Writing the verification identifier and the resource change information into a lock queue;
[0162] The lock queue is used to synchronize the verification identifier and the resource change information to the remote node, so that the remote node can perform resource synchronization based on the received resource change information after confirming through the verification identifier that the received resource change information is correctly transmitted.
[0163] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0164] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:
[0165] In combination with microservice technology, the resource change event of the corresponding target node is monitored, and after the resource change event is monitored, the resource change information of the target node is determined;
[0166] Perform regular filtering on the resource change information to evaluate whether the resource change information needs to be synchronized with a remote node;
[0167] If yes, generating a verification mark of the resource change information;
[0168] Writing the verification identifier and the resource change information into a lock queue;
[0169] The lock queue is used to synchronize the verification identifier and the resource change information to the remote node, so that the remote node can perform resource synchronization based on the received resource change information after confirming through the verification identifier that the received resource change information is correctly transmitted.
[0170] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0171] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0172] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0173] The above description of the disclosed embodiments enables professionals and technicians in the field to implement or use the present application. Various modifications to these embodiments will be apparent to professionals and technicians in the field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. The various embodiments of the present application can be combined with each other. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A resource synchronization method, characterized in that: Applied to a target node of a distributed management system, the resource synchronization method comprises: In combination with microservice technology, the resource change event of the corresponding target node is monitored, and after the resource change event is monitored, the resource change information of the target node is determined; Perform regular filtering on the resource change information to evaluate whether the resource change information needs to be synchronized with a remote node; If yes, generating a verification mark of the resource change information; Writing the verification identifier and the resource change information into a lock queue; The lock queue is used to synchronize the verification identifier and the resource change information to the remote node, so that the remote node can perform resource synchronization based on the received resource change information after confirming through the verification identifier that the received resource change information is correctly transmitted.
2. The resource synchronization method according to claim 1, characterized in that: The combined microservice technology monitors resource change events of the corresponding target node, including: In response to the user's resource change operation, combined with microservice technology, the resource change information corresponding to the resource change operation is determined, and the resource change information is written into the message queue; The message queue is monitored to determine whether there is a resource change event.
3. The resource synchronization method according to claim 2, characterized in that: After monitoring the resource change event, determining the resource change information of the target node includes: After monitoring the resource change event, in combination with microservice technology, resource change information including object identification and path information corresponding to the resource change event is obtained from the message queue.
4. The resource synchronization method according to claim 1, characterized in that: Regular filtering is performed on the resource change information to evaluate whether the resource change information needs to be synchronized with a remote node, including: Constructing a regular expression based on the local resources of the target node; The resource change information is filtered using the regular expression to evaluate whether the resource change information needs to be synchronized with a remote node.
5. The resource synchronization method according to claim 1, characterized in that: Generating a verification mark of the resource change information includes: The summary value of the resource change information is used as the verification identifier.
6. The resource synchronization method according to claim 1, characterized in that: Using the lock queue, synchronizing the verification identifier and the resource change information to the remote node, including: Send a heartbeat detection of a long connection to the remote node, and receive a confirmation message replied by the remote node; When the received confirmation information indicates that the connection is normal, the verification identifier and the resource change information are sent to the remote node using the lock queue.
7. The resource synchronization method according to claim 6, characterized in that: After sending a heartbeat detection of a long connection to the remote node and receiving confirmation information replied by the remote node, the method further includes: When the received confirmation information indicates that the connection is abnormal, performing a password verification on the remote node; After the remote node passes the password verification, a transmission channel is established; In combination with the transmission channel and based on the lock queue, the verification identifier and the resource change information are sent to the remote node.
8. A resource synchronization device, characterized in that: The resource synchronization device is applied to a target node of a distributed management system, and the resource synchronization device comprises: A monitoring module is used to monitor resource change events of the corresponding target node in combination with microservice technology, and after monitoring the resource change events, determine the resource change information of the target node; A filter is used to perform regular filtering on the resource change information and evaluate whether the resource change information needs to be synchronized with a remote node; if so, calling a write module and a lock queue; A writing module, used to generate a verification mark of the resource change information, and write the verification mark and the resource change information into a lock queue; The lock queue is used to synchronize the verification identifier and the resource change information to the remote node, so that the remote node can perform resource synchronization based on the received resource change information after confirming through the verification identifier that the received resource change information is transmitted correctly.
9. A resource synchronization device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the resource synchronization method as described in any one of claims 1-7.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the resource synchronization method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
A method and system data buffering and synchronization under cluster environment
CN101188566A
Consistency maintenance system and methods for distributed-type data
CN103036717A
Multi-thread remote sensing satellite baseband data processing method and device based on message queue
CN112104403A
Micro-service deployment method, equipment and medium
CN113760311A
Resource information management method, system and device
CN114900449A