Data updating method and device and electronic equipment
By calling multiple update tools in the system, determining the target update tool, and performing parallel updates based on the data type, the problems of long update time and poor stability of multi-node data are solved, and online updates and efficient resource utilization are achieved.
Patent Information
- Application Number
- CN202510379173.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-06-27
AI Technical Summary
When the prior art updates data to multiple nodes, the upgrade time period is long, the system stability is poor, and there is a risk of compatibility problems and data migration failure.
By responding to the acquired data to be updated, multiple update tools are called to determine the target update tool from it. Based on the data type and corresponding update policies, the data of multiple nodes are updated in real time in parallel, supporting distributed execution, and isolating node update tasks of different data types.
Online update of multi-node data is realized, business interruptions and resource competition caused by downtime updates are avoided, system stability and resource utilization efficiency are improved, and dynamic adaptation is met.
Smart Images

Figure CN120215987A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a data update method, apparatus, and electronic device. Background Art
[0002] Outdated or redundant data may affect the performance of the system (such as processing speed, storage capacity, and management efficiency). Regularly upgrading data can optimize these performance metrics. In the related art, the real-time upgrade of the system is mainly achieved by selecting a downtime window and rolling. However, by upgrading multiple nodes one by one through the downtime window, the upgrade time period is long, and the stability of the system is poor. Summary of the Invention
[0003] In view of the above problems, this application provides a data update method, apparatus, electronic device, storage medium, and program product.
[0004] According to the first aspect of this application, a data update method is provided, including: in response to obtaining data to be updated for at least one node in the system, calling multiple update tools; determining a target update tool corresponding to the data to be updated from the multiple update tools; and based on the type of the data to be updated and the update strategy corresponding to the type, using the target update tool to update the data to be updated to obtain updated data.
[0005] The second aspect of this application provides a data update apparatus, including: a calling module, configured to call multiple update tools in response to obtaining data to be updated for at least one node in the system; a determining module, configured to determine a target update tool corresponding to the data to be updated from the multiple update tools; and an updating module, configured to update the data to be updated using the target update tool based on the type of the data to be updated and the update strategy corresponding to the type to obtain updated data.
[0006] The third aspect of this application provides an electronic device, including: one or more processors; a memory, configured to store one or more computer programs, wherein the above one or more processors execute the above one or more computer programs to implement the steps of the above method.
[0007] The fourth aspect of this application further provides a computer-readable storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented.
[0008] The fifth aspect of this application further provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented. Brief Description of the Drawings
[0009] Through the following description of the embodiments of the present application with reference to the accompanying drawings, the above content and other objectives, features, and advantages of the present application will become clearer. In the drawings:
[0010] Figure 1 Schematically shows an application scenario diagram of a data update method, device, electronic device, storage medium, and program product according to an embodiment of the present application;
[0011] Figure 2 Schematically shows a flowchart of a data update method according to an embodiment of the present application;
[0012] Figure 3A Schematically shows an example diagram of a multi-node update process according to an embodiment of the present application;
[0013] Figure 3B Schematically shows an example diagram of a process for implementing node rollback using a rollback mechanism according to an embodiment of the present application;
[0014] Figure 3C Schematically shows a flowchart of another data update method according to an embodiment of the present application;
[0015] Figure 4 Schematically shows a structural block diagram of a data update device according to an embodiment of the present application;
[0016] Figure 5 Schematically shows a block diagram of an electronic device suitable for implementing a data update method according to an embodiment of the present application. Detailed Embodiments
[0017] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present application. In the following detailed description, for the sake of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.
[0018] The terms used herein are merely for describing specific embodiments and are not intended to limit the present application. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0019] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0020] In cases where expressions similar to "at least one of A, B, and C, etc." are used, generally, it should be interpreted according to the meaning commonly understood by those of ordinary skill in the art (for example, "a system having at least one of A, B, and C" should include, but not be limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).
[0021] In the technical solution of this application, the user information involved (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties. And the processing of relevant data, such as collection, storage, use, processing, transmission, provision, disclosure, and application, all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0022] In some examples, real-time upgrading of data is achieved through methods such as downtime window upgrading, rolling upgrading, and online upgrading.
[0023] For example, multiple nodes in the system are upgraded one by one during the downtime window from 2 am to 4 am. This method may require a long downtime and affect the continuity of system services. At the same time, there may be related technical problems during the upgrade process (such as compatibility problems, data migration failures), and these problems require additional time and resources to solve. If the upgrade fails, it may have a greater impact on the business.
[0024] For example, by upgrading each node during the operation of the system, the downtime and business impact can be reduced to a certain extent. However, rolling upgrading may have problems of system service interruption and data inconsistency because services and data need to be switched during the upgrade process, increasing the load on the system.
[0025] Based on the above problems, this application provides a data update method, including: in response to obtaining data to be updated for at least one node in the system, calling multiple update tools; determining a target update tool corresponding to the data to be updated from the multiple update tools; and based on the type of the data to be updated and the update strategy corresponding to the type, using the target update tool to update the data to be updated to obtain updated data.
[0026] According to an embodiment of the present invention, by based on the type of data to be updated and the update strategy corresponding to the data type, the target update tool is used in real time to update the data to be updated of multiple nodes in parallel, supporting distributed execution, realizing the isolation of node update tasks of different data types and the online update requirements of multiple nodes, avoiding service interruption and resource contention caused by downtime updates, meeting the updates matching the data type and dynamically adapting to complex requirements, and further improving the stability of the system and the utilization efficiency of resources.
[0027] Figure 1 Schematically shows an application scenario diagram of a data update method, device, electronic device, storage medium, and program product according to an embodiment of the present application.
[0028] As Figure 1 shown, the application scenario according to this embodiment may include a terminal device 101, a network 102, and a server 103. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0029] A user can use the terminal device 101 to interact with the server 103 through the network 102 to receive messages, send messages, and instructions. The terminal device 101 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.
[0030] The server 103 may be a server or a server cluster providing various services, such as providing storage and management of files for users, and a server for providing storage, retrieval, and sharing of files for users.
[0031] For example, the server 103 may provide computing resources for users to perform various computing tasks, including but not limited to scientific computing, data processing, etc. tasks. For example, the server 103 may also be a server providing centralized management of network resources for users, including but not limited to user accounts, devices, etc.
[0032] For example, a user can use the terminal device 101 to send a data update instruction to the storage management system in the server 103 through the network 102, so that the control module in the storage management system can perform data update according to the received update instruction.
[0033] For example, after receiving an update request from the terminal device 101, the server 103 can start processing this request, and the server 103 can also verify the user's permissions to ensure that the user has the permission to perform data updates.
[0034] For example, the terminal device 101 may send a confirmation message indicating that the update is complete to the server 103, so that the server 103 can record the update status and perform subsequent management and maintenance tasks.
[0035] It should be noted that the data update method provided by the embodiments of the present application can generally be executed by the server 103. Correspondingly, the data update device provided by the embodiments of the present application can generally be set in the server 103. The data update method provided by the embodiments of the present application can also be executed by a server or a server cluster different from the server 103 and capable of communicating with the terminal device 101 and / or the server 103. Correspondingly, the data update device provided by the embodiments of the present application can also be set in a server or a server cluster different from the server 103 and capable of communicating with the terminal device 101 and / or the server 103.
[0036] It can be understood that Figure 1 the numbers of the terminal devices, networks, and servers in
[0037] Figure 2 FIG. schematically shows a flowchart of the data update method according to the embodiments of the present application.
[0038] As Figure 2 shown, the data update method of this embodiment may include operation S210 to operation S230.
[0039] In operation S210, in response to obtaining the data to be updated for at least one node in the system, multiple update tools are called.
[0040] In the embodiments of the present application, the system may be a system for providing different services, including but not limited to a storage system, a computing system, and a management system. The node may represent multiple control nodes in the system. The data to be updated may represent the data to be upgraded corresponding to the system obtained by listening or an update policy. The data to be updated may be stored in a local file system, or a storage device or cloud storage connected to the system. The specific storage method of the data to be updated is not limited herein. The update tools may include an inspection tool, a tool to be loaded, a startup tool, and a rollback tool based on different types and functions.
[0041] For example, after obtaining the data to be updated corresponding to multiple nodes in the storage system from a cloud storage service, at least one of the tool to be loaded, the inspection tool, the startup tool, and the rollback tool is called using the interface provided by the storage system.
[0042] In operation S220, a target update tool corresponding to the data to be updated is determined from the multiple update tools.
[0043] In an embodiment of the present application, the target update tool may be an update tool determined according to a verification policy and the matching degree between different verification results. The verification policy may include any one of a version information verification policy, a verification value matching policy, and a protocol detection policy. The target update tool may include multiple types based on different types and functions.
[0044] For example, when the system obtains the update tool, it may obtain the initial verification code at the same time. After multiple nodes receive the update tool, the verification code to be matched is calculated, so that by comparing the matching degree between the initial verification code and the verification code to be matched, the target update tool can be confirmed.
[0045] For example, after obtaining the version number information of the update tool in the system, according to the version information verification policy, when the obtained version information is the same as the version information determined by different nodes, the obtained update tool is determined as the target update tool.
[0046] In operation S230, based on the type of the data to be updated and the update policy corresponding to the type, the target update tool is used to update the data to be updated, and the updated data is obtained.
[0047] In an embodiment of the present application, the type of the data to be updated includes at least one of a read-write type and a non-read-write type, and the update policies corresponding to the read-write type data and the non-read-write type data are different from each other.
[0048] For example, when the type of the data to be updated is of the read-write type, the first update policy can be used to update the data to be updated by using the target update tool to obtain the updated data. When the type of the data to be updated is of the non-read-write type, the second update policy can be used to update the data to be updated by using the target update tool to obtain the updated data.
[0049] According to the embodiment of the present application, by based on the type of the data to be updated and the update policy corresponding to the data type, the target update tool is used to perform parallel updates on the data to be updated of multiple nodes in real time, supporting distributed execution, realizing isolation of the node update tasks of different data types and the online update requirements of multiple nodes, avoiding the service interruption and resource contention caused by downtime updates, meeting the updates matching the data type and dynamically adapting to complex requirements, and further improving the stability of the system and the utilization efficiency of resources.
[0050] It can be understood that how to obtain the updated data has been described above, and below will describe how to update the data to be updated according to the type of the data to be updated.
[0051] According to an embodiment of the present application, based on the type of data to be updated and the update policy corresponding to the type, a target update tool is used to update the data to be updated, including: in the case where the type is a read-write type, the target update tool is used to update the data to be updated based on the load data of the system.
[0052] In an embodiment of the present application, the load data may represent the total load data of the computing system, storage system, or management system at the current moment. The total system load data is obtained based on the load data received from different nodes, and then the update window is adjusted according to the total load data. The load data of a node includes, but is not limited to, processor load data, memory load data, and network bandwidth load data. The load data can be obtained through the monitoring tool of the system or the built-in system call tool, and the specific method for obtaining the load data is not limited herein.
[0053] For example, for different nodes in the system, the load data of each node is obtained, and the load data of different nodes is summarized and calculated to obtain the total load data of the system; thus, according to the design and requirements of the system, a load threshold is set, and then the update policy of the data is dynamically adjusted according to the comparison result between the load data and the load threshold.
[0054] In a feasible embodiment, when calculating the total load data of the system, a load balancing policy may be considered, and the weight value corresponding to the load data of different nodes is determined based on the priority information corresponding to each node.
[0055] For example, a static weight (such as the number of cores of a processor and the memory capacity) is combined with a dynamic weight (such as adjusting the weight according to the real-time load) to implement the weight calculation of the load data of different nodes; thus, a load balancing algorithm (such as dynamic weight adjustment based on response time or weighted round-robin) is selected to obtain the weight value corresponding to the load data of different nodes.
[0056] According to an embodiment of the present application, in the case where the type is a read-write type, using the target update tool to update the data to be updated based on the load data of the system includes: in the case where the load data is less than the load threshold, the target update tool is used to update multiple nodes in the system in parallel; in the case where the load data is greater than or equal to the load threshold, the target update tool is used to update multiple nodes sequentially based on the priority information of the multiple nodes.
[0057] In an embodiment of the present application, the load threshold can be determined according to the actual situation. For example, according to the total load data of the system obtained at the current moment, when the load data is less than the load threshold (e.g., 50%), 50% of the total number of nodes can be started for parallel upgrade. When the load data is greater than or equal to the load threshold (50%), multiple nodes can be updated sequentially. Through the above method, during the system update process, the read and write performance fluctuation can be less than 5% in a 50% load scenario.
[0058] In a feasible embodiment, when updating multiple nodes, the read and write tasks can be distributed to other non-updating nodes through the system and multi-path technology, so that the system can continue to provide external services without affecting the current business.
[0059] For example, based on the cluster formed by multiple nodes, using the cluster multi-thread separation technology, the system can include read and write threads, supervision threads, and service threads according to different functions. Through the collaborative work between different threads, the safe and stable operation of the system can be ensured. The system can use the management component to uniformly manage multiple nodes, and the data update method can be an update at the management component level. For the threads affected during the update, the threads can be restarted. During the update process, if the threads involved in the update component are non-read and write threads, the overall system performance is not affected during the upgrade process; if the threads involved in the upgrade component are read and write threads, the read and write threads of the updated nodes will be paused.
[0060] According to the embodiments of the present application, by real-time monitoring the total load data of the system and dynamically adjusting the size of the update window and the update strategy (such as parallel update or point-by-point update), the system performance can be optimized. Parallel update can be performed at low load to quickly complete the update task; point-by-point update can be performed at high load to avoid excessive impact on the system performance. At the same time, the update resources can be reasonably allocated based on the load data to avoid large-scale updates during high system load, thereby reducing the competition for system resources and improving resource utilization.
[0061] Figure 3A Schematically shows an example schematic diagram of the multi-node update process according to an embodiment of the present application.
[0062] As Figure 3A shown, taking the update of the storage system as an example, all the nodes to be updated in the storage system are added to the update cluster, and the total control node of the update cluster conducts unified command and scheduling for all the nodes. The update process includes operation S31 to operation S37.
[0063] In operation S31, in response to obtaining the data to be updated for multiple nodes, when the master control node detects that the environmental information of the storage system meets the preset environmental conditions by using the inspection tool in the target update tool, it sends an update instruction to the management nodes corresponding to different functions in the storage system.
[0064] In operation S32, after receiving the update instruction, the management node notifies the nodes to be updated to prepare for the update, and uses the startup tool to start the update process to prepare for parallel updates of multiple nodes. The management node can also check whether the target update tool is pushed by the master control node and verify the target update tool.
[0065] In operation S33, multiple nodes perform communication connection confirmation with the management node through a handshake mechanism. After confirmation, the multiple nodes perform data update operations, such as software update and configuration information update.
[0066] In operation S34, the management node monitors the update progress of multiple nodes in real time to ensure the smooth progress of the update process, and determines whether the nodes have successfully completed the update by checking the update results of each node.
[0067] In operation S35, when the management node detects that the node update is successful, it ends the update process, updates the status of the node to updated, records the relevant information of the update, and enters subsequent other processing processes.
[0068] In operation S36, in the case of node update failure, the update is performed again. In the case of repeated update failure, the rollback mechanism is used to roll back to the state before the node update in S32.
[0069] In operation S37, the management node detects whether all nodes have completed the update. If there are still nodes that have not completed the update, it returns to continue monitoring the update progress. After all nodes have completed the update, it enters subsequent other processes.
[0070] According to the embodiments of the present application, by updating multiple nodes in parallel, the update efficiency of the entire system can be significantly improved, the time required for the update can be reduced, so that all nodes of the same management node are in the same state after the update, maintaining the overall consistency and stability of the system. Through real-time monitoring and error handling mechanisms, problems occurring during the update process can be discovered and solved in a timely manner, further improving the reliability of data update and the stability of the system.
[0071] According to the embodiments of the present application, the target update tool includes a file to be loaded corresponding to the data to be updated; updating the data to be updated by using the target update tool includes: storing the file to be loaded obtained from the target update tool in the target file of the system; calling the file to be loaded from the target file and updating the data to be updated to obtain the updated data.
[0072] In an embodiment of the present application, the file to be loaded may be a dynamic link library file, which contains reusable code and data for sharing by multiple application programs or system components. The target file may be a file for storing a target update tool in the system or in cloud storage, so that a node loads and uses the file to be loaded during an update.
[0073] For example, an association relationship may be established between the target file and the file to be loaded in the system, so that the system can call and access the data in the file to be loaded through the target file to update the data to be updated, and then obtain the updated data.
[0074] For example, mount the file to be loaded to the corresponding directory. After mounting the file, the file content can be directly accessed through the file path, so as to call and update the file to be loaded and obtain the updated data.
[0075] According to an embodiment of the present application, the target update tool further includes a rollback tool; the method further includes: in the case where the update of the data to be updated using the file to be loaded fails, using the rollback tool to roll back at least one node to the state before the update; in the case where the rollback of at least one node fails, loading the initial loading file of at least one node before the update to reload at least one node.
[0076] In an embodiment of the present application, the rollback tool may be a tool for rolling back the state of a node to the state before the update in the case of data update failure. The initial loading file may represent the loading file used by the node before data update. Considering the failure situation during the data update process, to avoid system security or stability problems, after the node update fails, an update retry can be performed. After the retry fails, the rollback tool can be used to roll back the node state, that is, roll back the node to the previous version.
[0077] It can be understood that the node rollback is similar to the multi-node update process, which is specifically as follows Figure 3B As shown, the rollback of multiple nodes can be performed one by one.
[0078] Figure 3B Schematically shows a flow example diagram of implementing node rollback using a rollback mechanism according to an embodiment of the present application.
[0079] As Figure 3B shown, the process of implementing node rollback using a rollback mechanism includes operations S311 to S314.
[0080] In operation S311, the management node monitors the update progress of multiple nodes in real time and determines whether the nodes have successfully completed the update.
[0081] In operation S112, in the case where it is detected that the node update fails, the node is updated again.
[0082] In operation S113, in the case where the node update fails again, the fallback tool is used to fallback the node with the update failure to the state before the node update.
[0083] In operation S114, in the case where the node fallback fails, the management node can perform first aid using the initial loading file corresponding to the node, push the initial loading file to the node with the update failure again, and reload and run it.
[0084] According to an embodiment of the present application, the method further includes: in response to obtaining the updated data to generate a target data file, using a compilation tool to convert the target data file to obtain a target loading file; storing the encrypted file obtained by encrypting the target loading file in the system.
[0085] In an embodiment of the present application, the target data file may be a file that provides relevant data service functions for the system based on the updated data. For example, it is a file that has fixed vulnerabilities, added new functions, or optimized computing performance. The target loading file may be an executable dynamic loading file generated by compiling the code corresponding to the target data file.
[0086] In an embodiment of the present application, considering that the modified file is updated to the system in a safe and trustworthy manner, the target loading file can be encrypted to obtain an encrypted file and stored in the system, so as to be shared by other application programs or components in the system, improving the code reusability.
[0087] For example, a signature tool can be used to connect to the corresponding directory file through an encryption command prompt to implement the encryption of the target loading file. Or, an open-source library can be used to implement the signature and encryption of the target loading file by writing scripts or using programming languages.
[0088] It can be understood that the target loading file in the present application can be an independent functional module, which can be updated separately without recompiling or deploying the entire system. The system can dynamically load the target loading file during operation, improving the stability of the system.
[0089] According to an embodiment of the present application, determining a target update tool corresponding to the data to be updated from multiple update tools includes: in response to the invocation of multiple update tools, obtaining first check values corresponding to the multiple update tools; sending the multiple update tools and the first check values to at least one node, so that at least one node determines second check values corresponding to the multiple update tools based on a preset check policy; and determining the target update tool from the multiple update tools when the first check values match the second check values.
[0090] In an embodiment of the present application, the first verification value may represent the initial verification value corresponding to the update tool obtained by the system when acquiring the update tool. The second verification value may represent the verification value calculated by the node after acquiring the update tool and corresponding to the update basis. By matching the first verification value with the second verification value, when the matching degree is greater than or equal to the matching threshold, it is determined that the currently acquired update tool is the target update tool.
[0091] For example, taking the sending end as the computing system, the first verification values of multiple target update tools can be calculated using a predefined generating polynomial, and then the calculated first verification values are stored in the target file or the relevant database in the system. Furthermore, the multiple target update tools and the first verification values are sent to multiple nodes to be updated.
[0092] For example, taking the receiving end as multiple nodes, after the multiple nodes receive the target update tool and the first verification value corresponding to the target update tool, the nodes calculate the second verification value of the received target update tool and calculate the target update tool using the same generating polynomial. Then, the calculated second verification value is matched with the first verification value received from the system control. If the match is successful, it indicates that the target update tool is intact; otherwise, it means that the target update tool may have been damaged or tampered with during the transmission process.
[0093] According to the embodiment of the present application, by calculating the verification value of the target update tool and comparing it with the previously acquired verification value, it can be ensured that the update tool has not been damaged or tampered with during the transmission or storage process, which is crucial in the online update of the system and provides the reliability and stability of the system update.
[0094] According to the embodiment of the present application, the method further includes: during the process of updating the data to be updated using the target update tool, at least one node and the non-update node send the information to be sent to the message queue, so that communication is carried out between different nodes, between the node and the non-update node based on the message queue.
[0095] In the embodiment of the present application, when multiple nodes are updated simultaneously, the node message queue mode can be introduced. The message queue stores the status information sent by different nodes, such as the "ready" status event and the "completed" status event. After receiving the message, the management node can uniformly send the update instruction to each node for data update. During the update process, if there are related problems, they can also be fed back to the management node in the form of events for unified management. It can be understood that message transmission can be carried out in the form of a message queue between different nodes to be updated and between the nodes to be updated and the non-updated nodes.
[0096] For example, according to system requirements and characteristics, a suitable message queue technology can be selected to ensure its high availability, high throughput, low latency and other characteristics to meet the message passing requirements during multi-node updates; a message queue dedicated to system updates is established on the control node to receive and temporarily store update request messages from each node. Connection parameters of the message queue of the control node, including queue address, port number, authentication information, etc., are configured on each node to ensure that the node can be normally connected to the message queue.
[0097] For example, the control node can run a message listening service to continuously listen for new messages in the message queue. In the case of receiving a data update request message, it can be captured and processed in a timely manner; thus, after receiving the message, the message content is parsed to extract the node identification information, current status, update-related parameters, etc., for subsequent unified update instruction sending; furthermore, the parsed message information is stored in a data structure or database for subsequent update process management and status tracking. For example, a dictionary or list can be used to record the update request information of each node.
[0098] For example, the control node can judge whether the conditions for unified sending of update instructions are met according to the received messages and the system update policy, such as a certain number of nodes requesting updates, the system resources meeting the update requirements, etc. When the update conditions are met, the control node generates specific update instructions for each node according to the update request information of each node. The instructions contain detailed information such as the update version number, update steps, relevant configuration parameters, etc. Further, the generated update instructions can be sent to each node that needs to be updated respectively so that the instructions can be accurately transmitted to the target node.
[0099] According to the embodiments of the present application, by introducing the node message queue mode in the multi-node system, the function of the control node for unified management and sending of upgrade instructions can be realized, and the efficiency and reliability of system updates can be improved.
[0100] Figure 3C The flowchart of another data update method according to the embodiments of the present application is schematically shown.
[0101] As Figure 3C shown, the data update process may include operations S321 to S324.
[0102] In operation S321, update tools are made. The update check tool, the file to be loaded, the update start tool, the update rollback tool, etc. are made into a unified image file.
[0103] In operation S322, update the environment check. Before the update, check the environmental status and node status of the cluster, including: whether all nodes in the cluster are in the running state, whether there are any abnormal situations such as alarms and error reports in the system, whether the update path of the data version is legal (for example, the version update path of x.y is legal, and the version update path of x.z will prohibit the update). Only after all check items pass can the update be performed. At this time, the check can be carried out through an automated script, and the update script is packaged in the image file as a whole.
[0104] In operation S323, execute the update process. Operation S323 may include operations S3231 to S3236.
[0105] In operation S3231, decompress the image file. Extract the files to be updated from the decompressed image file to obtain the target update tool.
[0106] In operation S3232, mount the decompressed files to the corresponding directories in the system. To make the updated files in the correct positions in the system, facilitating subsequent replacement and update operations.
[0107] In operation S3233, stop the services of the nodes to be updated. To avoid files being locked or services having abnormalities.
[0108] In operation S3234, the decompressed update files can replace the original component files. At the same time, to prevent problems during the update process, the original files are usually backed up so that they can be restored when needed.
[0109] In operation S3235, restart the services of the updated components. To make the new files and configurations take effect and complete the update of the components.
[0110] In operation S3236, after the update is completed, update the version number of the system. Record the current version of the system for subsequent management and maintenance.
[0111] In operation S324, perform a system security check. After the system upgrade is completed, the system will perform a security check to ensure that the system has been successfully upgraded and the business is running smoothly. At this time, the whole process ends.
[0112] Based on the above data update method, the present application also provides a data update device. The following will be combined with Figure 4 to describe this device in detail.
[0113] Figure 4 Schematically shows a structural block diagram of the data update device according to an embodiment of the present application.
[0114] As Figure 4As shown, the data update device in this embodiment includes a call module 410, a determination module 420, and an update module 430.
[0115] The call module 410 is configured to call a plurality of update tools in response to obtaining data to be updated for at least one node in the system. In one embodiment, the call module 410 may be configured to perform the operation S210 described above, which will not be elaborated here.
[0116] The determination module 420 is configured to determine a target update tool corresponding to the data to be updated from the plurality of update tools. In one embodiment, the determination module 420 may be configured to perform the operation S220 described above, which will not be elaborated here.
[0117] The update module 430 is configured to update the data to be updated by using the target update tool based on the type of the data to be updated and the update policy corresponding to the type, so as to obtain updated data. In one embodiment, the update module 430 may be configured to perform the operation S230 described above, which will not be elaborated here.
[0118] According to an embodiment of the present application, based on the call module 410, the determination module 420, and the update module 430 in the data update device, by based on the type of the data to be updated and the update policy corresponding to the data type, the data to be updated of multiple nodes is updated in parallel in real time by using the target update tool, supporting distributed execution, realizing isolation of the node update tasks of different data types and the online update requirements of multiple nodes, avoiding the service interruption and resource contention caused by downtime update, realizing the update matching the data type and dynamically adapting to complex requirements, and further improving the stability of the system and the utilization efficiency of resources.
[0119] According to an embodiment of the present application, the update module 430 includes: a data update sub-module, configured to update the data to be updated by using the target update tool based on the load data of the system when the type is a read-write type.
[0120] According to an embodiment of the present application, the data update sub-module includes: a first node update unit and a second node update unit. The first node update unit is configured to update multiple nodes in the system in parallel by using the target update tool when the load data is less than the load threshold; the second node update unit is configured to update multiple nodes sequentially by using the target update tool based on the priority information of multiple nodes when the load data is greater than or equal to the load threshold.
[0121] According to an embodiment of the present application, the target update tool includes a file to be loaded corresponding to the data to be updated; the data update sub-module includes: a file storage unit and a file calling unit. The file storage unit is used to store the file to be loaded obtained from the target update tool into the target file of the system; the file calling unit is used to call the file to be loaded from the target file and update the data to be updated to obtain updated data.
[0122] According to an embodiment of the present application, the target update tool further includes a rollback tool; the device further includes: a rollback module and a loading module. The rollback module is used to roll back at least one node to the state before update by using the rollback tool when the update of the data to be updated using the file to be loaded fails; the loading module is used to load the initial loading file before the update of at least one node to reload at least one node when the rollback of at least one node fails.
[0123] According to an embodiment of the present application, the device further includes: a conversion module and an encryption module. The conversion module is used to generate a target data file in response to obtaining the updated data, and convert the target data file by using a compilation tool to obtain a target loading file; the encryption module is used to store the encrypted file obtained by encrypting the target loading file into the system.
[0124] According to an embodiment of the present application, the determination module 420 includes: a check value acquisition sub-module, which is used to acquire a first check value corresponding to a plurality of update tools in response to the call of the plurality of update tools; a node sending sub-module, which is used to send the plurality of update tools and the first check value to at least one node, so that at least one node determines a second check value corresponding to the plurality of update tools based on a preset check policy; an update tool determination sub-module, which is used to determine a target update tool from the plurality of update tools when the first check value matches the second check value.
[0125] According to an embodiment of the present application, the device further includes: a message sending module, which is used to send the information to be sent to the message queue by at least one node and a non-update node during the process of updating the data to be updated by using the target update tool, so that different nodes, between a node and a non-update node communicate based on the message queue.
[0126] According to an embodiment of the present application, any plurality of the calling module 410, the determining module 420, and the updating module 430 may be combined and implemented in one module, or any one of them may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present application, at least one of the calling module 410, the determining module 420, and the updating module 430 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging circuits, etc., implemented by hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in any appropriate combination of several of them. Alternatively, at least one of the calling module 410, the determining module 420, and the updating module 430 may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions may be executed.
[0127] Figure 5 A block diagram of an electronic device suitable for implementing a data update method according to an embodiment of the present application is schematically shown.
[0128] As Figure 5 shown, the electronic device according to an embodiment of the present application includes a processor 501, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage section 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related processor group, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), etc. The processor 501 may also include on-board memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.
[0129] In the RAM 503, various programs and data required for the operation of the electronic device are stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. The processor 501 performs various operations of the method flow according to an embodiment of the present application by executing the programs in the ROM 502 and / or the RAM 503. It should be noted that the program may also be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 may also perform various operations of the method flow according to an embodiment of the present application by executing the programs stored in the one or more memories.
[0130] According to an embodiment of the present application, the electronic device may further include an input / output (I / O) interface 505, and the input / output (I / O) interface 505 is also connected to the bus 504. The electronic device may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. The drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom can be installed into the storage portion 508 as needed.
[0131] The present application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiments of the present application is implemented.
[0132] According to an embodiment of the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: 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), 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 application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present application, the computer-readable storage medium may include the above-described ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503.
[0133] An embodiment of the present application further includes a computer program product, which includes a computer program, and the computer program includes program codes for executing the method shown in the flowchart. When the computer program product runs in a computer system, the program codes are used to cause the computer system to implement the method provided by the embodiments of the present application.
[0134] When the computer program is executed by the processor 501, the above functions defined in the system / apparatus of the embodiments of the present application are executed. According to the embodiments of the present application, the above-described systems, apparatuses, modules, units, etc. can be implemented by computer program modules.
[0135] In one embodiment, the computer program can rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program can also be transmitted and distributed in the form of signals on a network medium, and be downloaded and installed through the communication part 509, and / or be installed from the removable medium 511. The program code included in the computer program can be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0136] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or be installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiments of the present application are executed. According to the embodiments of the present application, the above-described systems, devices, apparatuses, modules, units, etc. can be implemented by computer program modules.
[0137] According to the embodiments of the present application, the program code for executing the computer program provided by the embodiments of the present application can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedures and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include but are not limited to, such as Java, C++, python, the "C" language, or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, by using an Internet service provider to connect through the Internet).
[0138] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, and the above-mentioned module, segment of a program, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0139] Those skilled in the art can understand that the features described in the various embodiments of the present application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments of the present application can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present application.
[0140] The embodiments of the present application have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although the embodiments have been described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. Without departing from the scope of the present application, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present application.
Claims
1. A data updating method, characterized in that: The method comprises: In response to obtaining data to be updated for at least one node in the system, calling a plurality of update tools; determining a target update tool corresponding to the to-be-updated data from the plurality of update tools; Based on the type of the data to be updated and the update strategy corresponding to the type, the data to be updated is updated using the target update tool to obtain updated data.
2. The method according to claim 1, characterized in that Based on the type of the data to be updated and the update strategy corresponding to the type, updating the data to be updated by using the target update tool includes: In the case where the type is a read-write type, the data to be updated is updated using the target update tool based on the load data of the system.
3. The method according to claim 2, characterized in that When the type is a read-write type, updating the to-be-updated data by using the target update tool based on the load data of the system includes: When the load data is less than a load threshold, using the target update tool to update multiple nodes in the system in parallel; In a case where the load data is greater than or equal to the load threshold, the target update tool is used to sequentially update the multiple nodes based on priority information of the multiple nodes.
4. The method according to claim 1, characterized in that: The target update tool includes a file to be loaded corresponding to the data to be updated; The updating of the to-be-updated data by using the target update tool comprises: storing the to-be-loaded file obtained from the target update tool into a target file of the system; The file to be loaded is called from the target file and the data to be updated is updated to obtain the updated data.
5. The method according to claim 4, characterized in that The target update tool also includes a rollback tool; The method further comprises: In the case where updating the data to be updated by using the file to be loaded fails, rolling back the at least one node to a state before the update by using the rollback tool; In the case where the rollback of the at least one node fails, an initial loading file before the at least one node is updated is loaded to reload the at least one node.
6. The method according to claim 4, characterized in that The method further comprises: In response to obtaining the updated data, a target data file is generated, and the target data file is converted using a compilation tool to obtain a target load file; The encrypted file obtained by encrypting the target loading file is stored in the system.
7. The method according to any one of claims 1 to 6, characterized in that Determining a target update tool corresponding to the to-be-updated data from the plurality of update tools comprises: In response to the plurality of update tools being called, obtaining first verification values corresponding to the plurality of update tools; sending the plurality of update tools and the first check value to the at least one node, so that the at least one node determines a second check value corresponding to the plurality of update tools based on a preset check strategy; In a case where the first check value matches the second check value, the target update tool is determined from among the plurality of update tools.
8. The method according to claim 1, characterized in that The method further comprises: In the process of updating the data to be updated by using the target update tool, the at least one node and the non-updated node send the information to be sent to the message queue, so that different nodes and the node and the non-updated node communicate based on the message queue.
9. A data updating device, characterized in that: The device comprises: A calling module, configured to call a plurality of update tools in response to acquiring data to be updated for at least one node in the system; A determination module, configured to determine a target update tool corresponding to the data to be updated from the plurality of update tools; The updating module is used to update the data to be updated by using the target updating tool based on the type of the data to be updated and the updating strategy corresponding to the type to obtain updated data.
10. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.