Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a service updating method, a device and a system, based on the fact that service updating data used for service nodes to perform service updating is divided into a plurality of sub updating data in advance, a plurality of service nodes to be subjected to service updating share the diffusion of each sub updating data, and data used for service updating of any service node are obtained by collecting all sub updating data from other associated service nodes and then combining the sub updating data.
Fig. 1 is a schematic view of an application scenario of service update provided in an embodiment of the present application, as shown in fig. 1, a plurality of service nodes to be updated for service are involved, where the service nodes are hosts of an internet service or a cloud computing service, and may be physical machines, virtual containers, or server software, and in a stage of primary distribution of sub-update data, that is, a process of distributing a plurality of sub-update data obtained by splitting the service update data to a plurality of service nodes for the first time, each sub-update data is distributed to at least one service node; and then entering a diffusion stage of the sub-update data, with the continuous diffusion of the sub-update data, the number of service nodes where each sub-update data is located is increased, the number of the sub-update data stored in each service node is also increased, and after any service node collects all the sub-update data, the service nodes are combined to obtain complete service update data, and local service update is completed by using the service update data. When the product functions and services need to be updated and deployed, related software or configuration on all service nodes to be updated by the services is updated, and the method has the characteristics of cross-machine room, distributed decentralization, fault-tolerant mechanism, system independence and hardware independence in the service updating process, fully utilizes network resources and computing resources among service nodes and machine rooms, and ensures that sub-update data is rapidly, efficiently, safely and reliably diffused in the multi-service nodes. Finally, each service node to be updated is merged to obtain a complete service update data, thereby realizing the service update of multiple service nodes.
Fig. 2 is a first flowchart of a service update method provided in an embodiment of the present application, where the method in fig. 2 can be executed by the service node 100 in fig. 1, and is suitable for service update deployment of internet services and cloud computing services, as shown in fig. 2, where the method at least includes the following steps:
s201, in a plurality of service nodes to be updated, acquiring a plurality of sub-update data from a plurality of service nodes other than a first service node, where the plurality of sub-update data are obtained by dividing the service update data in advance, the first service node is any one of the plurality of service nodes to be updated, and since any one service node not only participates in the diffusion of the sub-update data, but also needs to perform service update, in the process that the sub-update data is diffused from one service node to another service node, the transmitted sub-update data is a data copy of a data sub-block obtained by dividing the service update data. The plurality of sub-update data acquired by the first service node may be from a part of service nodes other than the first service node, or may be from all service nodes other than the first service node.
S202, merging the obtained multiple sub-update data to obtain service update data for service update, specifically, after all the sub-update data are obtained, restoring the multiple sub-update data to the service update data before being split.
And S203, updating the service of the first service node according to the service updating data obtained by merging, specifically, after the complete service updating data is obtained by merging a plurality of sub-updating data, if the current service is updated to the upgrade of the original application service, replacing the original service data related to the service to be upgraded with the service updating data, if the current service is updated to a newly added application service, adding the service updating data to the original service data, and restarting the service of the service node.
For example, for a newly added "earning and reward for parcel and parcel" function in a pay for treasure application, the service update data for implementing the "earning and reward for parcel and parcel" application service needs to be divided into a plurality of sub update data, then steps S201 to S203 are adopted so that each service node providing the application service acquires all the sub update data and merges the sub update data into service update data, and each service node updates the local application service by using the service update data, thereby providing a corresponding application service to the client.
In the embodiment of the application, the service updating data used for the service node to update the service is divided into the plurality of sub updating data in advance, the plurality of service nodes to be updated share the diffusion of the sub updating data, and the data used for updating the service by any service node is obtained by collecting all the sub updating data from other associated service nodes and then combining the sub updating data, so that the computing resources and the network resources of the plurality of service nodes are effectively utilized, the service updating efficiency of the multi-service node is improved, and the service updating of each service node is quickly, efficiently and safely realized.
As shown in fig. 3, before obtaining a plurality of sub-update data from a plurality of service nodes other than the first service node in a plurality of service nodes to be updated by the service S201, the method further includes:
s204, receiving a service updating request, wherein the service updating request carries data identifiers of all sub-updating data obtained by dividing service updating data; specifically, each sub-update data corresponds to a data identifier, for example, a data sequence number may be used as the data identifier of the sub-update data, taking the example that the service update data is divided into m sub-update data, the data identifier of the first sub-update data is 1, and the data identifier of the last self-update data is m.
Correspondingly, in the step S201, obtaining a plurality of sub-update data from a plurality of service nodes other than the first service node among the plurality of service nodes to be updated by service specifically includes:
s2011, in a plurality of service nodes to be updated, according to the received service update request, respectively obtaining sub-update data corresponding to each data identifier from a plurality of service nodes other than the first service node.
In specific implementation, as shown in fig. 4a, in N service nodes to be serviced and updated, service update data is uploaded to any service node (e.g., service node k), and after the service node receives the service update data, the service update data is divided into a plurality of sub update data (e.g., m sub update data); in a plurality of service nodes to be served and updated, as shown in fig. 4b, selecting a target number of service nodes as initial service nodes (e.g., the number of the initial service nodes is x, x is less than or equal to N), and distributing a plurality of sub-update data to the plurality of initial service nodes (e.g., distributing m sub-update data to x initial service nodes), at this time, for each initial service node, the initial service node receives at least one sub-update data, and for each sub-update data, the sub-update data exists at least on one initial service node, which is a primary distribution stage of the sub-update data, wherein if a first service node belongs to the initial service node, a service update request of a service node k is received; and if the first service node does not belong to the first service node, receiving a service update request of the service node k or any first service node. Then, a diffusion stage of the sub update data is entered, as shown in fig. 4c, each sub update data is diffused among a plurality of service nodes, and finally, each service node acquires all the sub update data, as shown in fig. 4d, the acquired plurality of sub update data are merged, and the service update data for service update is obtained.
Specifically, for the case that the first service node belongs to the originating service node, the receiving, by the S204, the service update request specifically includes:
receiving at least one child update data and update data division information that are distributed for the first time, wherein the update data division information includes: and the data identification of all the sub-updating data obtained by dividing the service updating data, and each sub-updating data is distributed to at least one service node.
If the first service node participates in the initial distribution stage of the sub-update data, the service update request received by the first service node can simultaneously carry at least one piece of sub-update data and update data segmentation information, after the first service node receives the at least one piece of sub-update data distributed for the first time, the first service node participates in the subsequent diffusion stage of the sub-update data, transmits the sub-update data stored locally to the service node needing the sub-update data, and acquires the sub-update data which does not exist locally from other service nodes.
Aiming at the condition that the first service node does not belong to the first service node, the first service node directly enters the diffusion stage of the sub-update data, the service update request received by the first service node can only carry the update data segmentation information, the sub-update data which does not exist locally is obtained from other service nodes according to the update data segmentation information, and after the sub-update data is obtained, if the sub-update data obtaining request is received, the sub-update data which is stored locally is transmitted to the service node which needs the sub-update data.
Further, considering that the sub-update data cannot be normally diffused to all the service nodes due to the fact that data packet loss may exist during initial distribution or an abnormality occurs when the service node does not diffuse the received sub-update data to other service nodes, in order to ensure that each service node to be updated by service can acquire all the sub-update data, each sub-update data obtained by dividing the service update data is distributed to at least two service nodes, that is, the same sub-update data is distributed to two initial service nodes.
Specifically, in the initial distribution stage of the sub-update data, in the process of distributing the plurality of sub-update data to the plurality of initial service nodes, the same sub-update data is distributed to at least two initial service nodes, at this time, in the plurality of service nodes to be updated, each sub-update data is stored in at least two service nodes, so that even if a certain service node is abnormal, the sub-update data can be obtained from another service node, it is ensured that each sub-update data can be normally spread to all service nodes, and further, it is ensured that each service node to be updated can obtain all sub-update data, and the success rate of distributing the service update data is improved.
As shown in fig. 5, the step S2011 of obtaining, from a plurality of service nodes to be updated by the service, sub-update data corresponding to each data identifier according to the received service update request, includes:
s20111, respectively obtaining sub-update data storage information of a plurality of service nodes other than the first service node, where the sub-update data storage information includes: and the data identification of the sub-updating data stored on the service node.
S20112, for each data identifier in the service update request, determining whether the first service node has sub-update data corresponding to the data identifier; specifically, according to a preset sequence, whether sub-update data corresponding to each data identifier exists locally or not is inquired one by one, and if not, the sub-update data is acquired from a service node which stores the sub-update data.
If not, executing S20113, selecting a service node as a target service node according to the storage information of each sub-update data and the target data identifier corresponding to the sub-update data which does not exist locally, and acquiring the sub-update data corresponding to the target data identifier from the target service node.
After the first service node acquires the sub-update data storage information of each service node except the first service node, the first service node can determine in which service nodes each sub-update data is distributed, and further can acquire the sub-update data which does not exist locally from the target service node in a targeted manner until the sub-update data corresponding to all the data identifiers is stored locally, specifically, the first service node can acquire the sub-update data corresponding to different data identifiers from at least two different service nodes simultaneously, and all the service nodes can acquire the sub-update data required by the first service node simultaneously, and distribute the data processing load and the data transmission load to all the service nodes, so that the service update data acquisition time is greatly saved, and the service update efficiency and the success rate of the multi-service node are improved.
Further, considering that in the process of determining the target service node, if the number of service nodes to be serviced and updated is large, the number of the obtained sub-update data storage information is also large, and to improve the efficiency of determining the target service node, based on this, the step S20113 selects one service node as the target service node according to each sub-update data storage information and the target data identifier corresponding to the sub-update data that does not exist locally, and specifically includes:
determining sub-update data distribution information according to each sub-update data storage information, wherein the sub-update data distribution information comprises: and each data mark in the service updating request is the information of the service node where the corresponding sub updating data is located.
And selecting one service node as a target service node according to the sub-update data distribution information and the target data identifier corresponding to the locally nonexistent sub-update data.
Specifically, after receiving the sub-update data storage information of a plurality of service nodes except for the sub-update data storage information, the received sub-update data storage information is summarized to obtain sub-update data distribution information, in the sub-update data distribution information, the corresponding relationship between each data identifier and the information of the service node storing the sub-update data corresponding to the data identifier is directly inquired, for example, data identifier 1-service node a \ B \ C, namely, the sub-update data corresponding to data identifier 1 is stored in service node a, service node B and service node C, if the sub-update data corresponding to data identifier 1 needs to be acquired, at this time, one of the service node a, service node B and service node C can be selected as the target service node, so that the sub-update data corresponding to the target data identifier is distributed in which service nodes, and quickly positioning to the target service node.
Further, in order to more fully utilize the computing resources and network resources of each service node, avoid the situation that the load rate of a certain service node is very high and the load rates of other service nodes are very low, and achieve the effect of load balancing of multiple service nodes, based on this, according to the sub-update data distribution information and the target data identifier corresponding to the sub-update data which does not exist locally, one service node is selected as a target service node, which specifically includes:
and taking a plurality of service nodes which have stored sub-update data corresponding to target data identification as alternative service nodes based on the sub-update data distribution information, wherein the target data identification is the data identification corresponding to the sub-update data which does not exist locally.
And determining the candidate service node with the lowest load rate as the target service node according to the load rate of each candidate service node.
Specifically, in the process of selecting the target service node, the load condition of the alternative service node is referred to, and the alternative service node with the lowest load rate is determined as the target service node under the condition that the plurality of service nodes have sub-update data corresponding to the target data identifier, so that the computing resources and the network resources of each service node can be more fully utilized, the effect of load balancing of the plurality of service nodes is achieved, and the service update efficiency of the plurality of service nodes is further improved.
Specifically, after obtaining the sub-update data corresponding to the target data identifier from the target service node, the method further includes:
and if the sub-updating data fails to be obtained, reselecting the next target service node according to the sequence of the load rate from low to high, and obtaining the sub-updating data corresponding to the target data identifier from the reselected target service node.
In the case that only one service node stores the sub-update data corresponding to the target data identifier, the required sub-update data is continuously acquired from the target service node after the target service node is recovered. In order to avoid the situation, in specific implementation, in the initial distribution stage of the sub-update data, the same sub-update data is distributed to at least two first-sending service nodes, so that the at least two service nodes can be ensured to store the sub-update data corresponding to the target data identifier; in addition, even if the same sub-update data is distributed to only one initial service node in the initial distribution stage of the sub-update data, the sub-update data corresponding to the target data identifier can be stored in at least two service nodes along with the continuous diffusion of the sub-update data, a data acquisition failure redundancy mechanism is provided, and the service update data distribution success rate is improved.
Specifically, in the service updating process, if the sub-update data acquisition fails, it is indicated that the target service node is abnormal, and at this time, the first service node reselects the next target service node.
In addition, when the abnormal target service node returns to normal, the target service node continues to execute the following steps: respectively acquiring sub-update data storage information of a plurality of service nodes except the service node; aiming at each data identifier in the service updating request, judging whether sub-updating data corresponding to the data identifier exists locally; if not, selecting a service node as a target service node according to the latest version of each sub-update data storage information and the data identifier, and acquiring the sub-update data corresponding to the data identifier from the target service node until all the sub-update data are acquired.
The process for acquiring the sub-update data storage information can be obtained in two ways, specifically:
the first mode is as follows: when the sub-update data of each service node is updated, actively broadcasting the updated sub-update data storage information to other service nodes, specifically, in step S20111, acquiring the sub-update data storage information of a plurality of service nodes other than the first service node respectively specifically includes:
receiving sub-update data storage information broadcasted by a plurality of service nodes except the first service node, wherein the sub-update data storage information is obtained after the plurality of service nodes except the first service node acquire new sub-update data and update local sub-update data storage information.
The second mode is as follows: after each service node receives the sub-data storage information acquisition request of another service node, it sends the sub-update data storage information of the latest version to the corresponding service node, specifically, in step S20111, the acquiring the sub-update data storage information of multiple service nodes other than the first service node respectively specifically includes:
sending a subdata storage information acquisition request to each service node except the first service node;
and receiving local latest version sub-update data storage information sent by service nodes except the first service node, wherein the sub-update data storage information is sent by the service nodes except the first service node in response to the sub-data storage information acquisition request.
Specifically, for the process of merging sub-update data, in step S202, merging the obtained plurality of sub-update data to obtain service update data for service update, the method specifically includes:
sequencing the obtained plurality of sub-updating data according to the sequence of the data identification from small to large;
and combining the sub-updating data according to the sequencing result to obtain the service updating data for service updating.
For each service node, the service node not only acquires the sub-update data from other service nodes, but also needs to send the sub-update data to the corresponding service node based on the sub-update data acquisition requests of other service nodes, and based on this, the method further includes:
receiving a sub-update data acquisition request sent by each service node except the first service node;
and sending the sub-update data corresponding to the received acquisition request to a corresponding service node, so that the service node receiving the sub-update data judges whether all the sub-update data are stored locally, and if so, performing local service update, namely the first service node also participates in the diffusion of the sub-update data.
For each service node, the service node not only acquires the sub-update data storage information from other service nodes, but also needs to send the local latest version of the sub-update data storage information to other service nodes, and based on this, the method further includes:
and sending the local latest version of the sub-update data storage information to the corresponding service node, so that the service node receiving the sub-update data storage information determines a target service node, and acquires the sub-update data from the target service node.
Specifically, the process for sending the sub-update data storage information may be implemented in two ways, specifically:
the first mode is as follows: when the sub-update data of the first service node is updated, actively broadcasting the updated sub-update data storage information to other service nodes, specifically, sending the local latest version of the sub-update data storage information to the corresponding service node specifically includes:
after new sub-update data are obtained, local sub-update data storage information is updated;
and broadcasting the updated sub-update data storage information to a plurality of service nodes except the first service node.
The second mode is as follows: the method for sending the local latest version of the sub-update data storage information to the corresponding service node includes that the first service node sends the latest version of the sub-update data storage information to the service node after receiving the sub-data storage information acquisition request of the other service nodes, and specifically includes:
receiving a request for acquiring subdata storage information sent by any service node except the first service node;
and transmitting the sub-update data storage information of the local latest version to the service node sending the sub-update data storage information acquisition request.
In the service updating method in the embodiment of the application, in a plurality of service nodes to be updated by service, a plurality of sub-updating data are acquired from a plurality of service nodes except a first service node; merging the obtained plurality of sub-updating data to obtain service updating data; and according to the service updating data obtained by combination, performing service updating on the first service node. The service updating data used for the service node to update the service is divided into a plurality of sub updating data in advance, a plurality of service nodes to be updated participate in the diffusion of the sub updating data, and the data used for updating the service by any service node is obtained by collecting all the sub updating data from other related service nodes and then combining the sub updating data, so that the computing resources and the network resources of the service nodes are effectively utilized, the service updating efficiency of the service nodes is improved, and the service updating of the service nodes is quickly, efficiently and safely realized.
Based on the same technical concept, corresponding to the service updating method described in fig. 2 to 5, an embodiment of the present application further provides a service updating apparatus, and fig. 6 is a schematic diagram of a first module composition of the service updating apparatus provided in the embodiment of the present application, where the apparatus is configured to execute the service updating method described in fig. 2 to 5, and as shown in fig. 6, the apparatus includes:
the sub-data obtaining module 601 is configured to obtain, in a plurality of service nodes to be updated by service, a plurality of sub-update data from a plurality of service nodes other than a first service node, where the plurality of sub-update data are obtained by dividing service update data in advance;
an update data generation module 602, configured to merge the obtained multiple sub-update data to obtain the service update data;
a service update module 603, configured to perform service update on the first service node according to the service update data obtained through merging.
Optionally, as shown in fig. 7, the apparatus further includes:
an update request receiving module 604, configured to receive a service update request before obtaining a plurality of sub-update data from a plurality of service nodes other than a first service node, where the service update request carries data identifiers of all sub-update data obtained by splitting service update data;
the sub-data obtaining module 601 is specifically configured to:
and respectively acquiring sub-update data corresponding to each data identifier from a plurality of service nodes except the first service node according to the service update request.
Optionally, the update request receiving module 604 is specifically configured to:
receiving at least one sub-update data and update data division information that are primarily distributed, wherein the update data division information includes: and the data identification of all the sub-updating data obtained by dividing the service updating data, and each sub-updating data is distributed to at least one service node.
Optionally, each sub-update data resulting from the splitting of the service update data is distributed to at least two service nodes.
Optionally, the sub-data obtaining module 601 is further specifically configured to:
respectively obtaining sub-update data storage information of a plurality of service nodes except a first service node, wherein the sub-update data storage information comprises: the data identifier of the sub-updating data stored on the service node;
for each data identifier in the service updating request, judging whether the first service node has sub-updating data corresponding to the data identifier;
if not, selecting a service node as a target service node according to the sub-update data storage information and the data identification, and acquiring the sub-update data corresponding to the data identification from the target service node.
Optionally, the sub-data obtaining module 601 is further specifically configured to:
determining sub-update data distribution information according to each piece of sub-update data storage information, wherein the sub-update data distribution information includes: the service update request comprises information of a service node where each data identifier corresponding to the sub-update data is located;
and selecting one service node as a target service node according to the sub-update data distribution information and the data identifier.
Optionally, the sub-data obtaining module 601 is further specifically configured to:
based on the sub-update data distribution information, taking a plurality of service nodes which have stored the sub-update data corresponding to the data identification as alternative service nodes;
and determining the candidate service node with the lowest load rate as a target service node according to the load rate of each candidate service node.
Optionally, the sub-data obtaining module 601 is further specifically configured to:
after the sub-update data corresponding to the data identifier is acquired from the target service node, if the sub-update data acquisition fails, reselecting the next target service node according to the sequence of the load rate from low to high, and acquiring the sub-update data corresponding to the data identifier from the reselected target service node.
Optionally, the sub-data obtaining module 601 is further specifically configured to:
receiving sub-update data storage information broadcasted by a plurality of service nodes except the first service node, wherein the sub-update data storage information is obtained after the plurality of service nodes except the first service node acquire new sub-update data and update local sub-update data storage information.
Optionally, the sub-data obtaining module 601 is further specifically configured to:
sending a subdata storage information acquisition request to each service node except the first service node;
and receiving local latest version sub-update data storage information sent by service nodes except the first service node, wherein the sub-update data storage information is sent by the service nodes except the first service node in response to the sub-data storage information acquisition request.
Optionally, the update data generating module 602 is specifically configured to:
sequencing the plurality of sub-updating data according to the sequence of the data identification from small to large;
and combining the sub-updating data according to the sequencing result to obtain the service updating data.
Optionally, the apparatus further comprises:
a sub-update data sending module 605, configured to receive a sub-update data acquisition request sent by each service node other than the first service node; and sending the sub-update data corresponding to the acquisition request to a corresponding service node.
Optionally, the apparatus further comprises:
and a storage information sending module 606, configured to send the local latest version of sub-update data storage information to the corresponding service node.
In the service updating apparatus in the embodiment of the present application, in a plurality of service nodes to be updated by a service, a plurality of sub-update data are acquired from a plurality of service nodes other than a first service node; merging the obtained plurality of sub-updating data to obtain service updating data; and according to the service updating data obtained by combination, performing service updating on the first service node. The service updating data used for the service node to update the service is divided into a plurality of sub updating data in advance, a plurality of service nodes to be updated participate in the diffusion of the sub updating data, and the data used for updating the service by any service node is obtained by collecting all the sub updating data from other related service nodes and then combining the sub updating data, so that the computing resources and the network resources of the service nodes are effectively utilized, the service updating efficiency of the service nodes is improved, and the service updating of the service nodes is quickly, efficiently and safely realized.
The service updating device provided by the embodiment of the invention can realize each process in the embodiment corresponding to the service updating method, and is not described again for avoiding repetition.
Further, corresponding to the methods shown in fig. 2 to fig. 5, based on the same technical concept, an embodiment of the present application further provides a service update system, as shown in fig. 8, where the system includes: a plurality of service nodes 100 to be serviced and updated, wherein every two service nodes 100 are in communication connection, and each service node 100 is provided with the service updating device; among them, a plurality of sub update data (i.e., data sub-blocks 1 to m) obtained by dividing the service update data are spread among the service nodes 100, so that each service node 100 acquires all the sub update data.
Specifically, any first service node to be updated by service is configured to obtain, in a plurality of service nodes to be updated by service, a plurality of sub-update data from a plurality of service nodes other than the first service node, where the plurality of sub-update data are obtained by dividing service update data in advance; merging the obtained sub-updating data to obtain the service updating data; and performing service updating on the first service node according to the service updating data obtained by combination.
Further, the first service node is further configured to:
receiving a service updating request, wherein the service updating request carries data identifiers of all sub-updating data obtained by dividing service updating data;
and respectively acquiring sub-updating data corresponding to each data identifier according to the service updating request.
Further, any service node (i.e. the service node k) in the plurality of service nodes is configured to:
receiving service update data and a data partitioning indication;
segmenting the service update data into a plurality of sub-update data according to the data segmentation indication;
selecting a plurality of initial distribution nodes with target quantity from a plurality of service nodes to be served and updated, wherein the initial distribution nodes are equivalent to the initial service nodes;
and sending a service updating request to the plurality of initial distribution nodes, wherein the service updating request carries at least one piece of sub-updating data and updating data segmentation information which are distributed for the first time, and each piece of sub-updating data is distributed to at least one selected initial distribution node.
Further, each sub-update data is distributed to at least two selected initial distribution nodes.
In the service updating system in the embodiment of the application, for any service node, in a plurality of service nodes to be updated, a plurality of sub-updating data are acquired from a plurality of service nodes except the service node; merging the obtained plurality of sub-updating data to obtain service updating data; and according to the service updating data obtained by combination, performing service updating on the first service node. The service updating data used for the service node to update the service is divided into a plurality of sub updating data in advance, a plurality of service nodes to be updated participate in the diffusion of the sub updating data, and the data used for updating the service by any service node is obtained by collecting all the sub updating data from other related service nodes and then combining the sub updating data, so that the computing resources and the network resources of the service nodes are effectively utilized, the service updating efficiency of the service nodes is improved, and the service updating of the service nodes is quickly, efficiently and safely realized.
The service updating system provided by the embodiment of the invention can realize each process in the embodiment corresponding to the service updating method, and is not described again to avoid repetition.
Further, corresponding to the methods shown in fig. 2 to fig. 5, based on the same technical concept, embodiments of the present application further provide a service updating apparatus, which is configured to execute the service updating method described above, as shown in fig. 9.
Service update apparatus may vary widely in configuration or performance and may include one or more processors 901 and memory 902, where memory 902 may store one or more stored applications or data. Memory 902 may be, among other things, transient storage or persistent storage. The application program stored in memory 902 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for updating the device for services. Still further, the processor 901 may be configured to communicate with the memory 902 to execute a series of computer-executable instructions in the memory 902 on the service update apparatus. The service update apparatus may also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input-output interfaces 905, one or more keyboards 906, and the like.
In one particular embodiment, a service updating apparatus includes a memory, and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the service updating apparatus, and the one or more programs configured to be executed by one or more processors include computer-executable instructions for:
in a plurality of service nodes to be updated by service, acquiring a plurality of sub-update data from a plurality of service nodes except a first service node, wherein the plurality of sub-update data are obtained by dividing the service update data in advance;
merging the obtained sub-updating data to obtain the service updating data;
and performing service updating on the first service node according to the service updating data obtained by combination.
Optionally, the computer executable instructions, when executed, further comprise computer executable instructions for: before obtaining a plurality of sub-update data from a plurality of service nodes other than the first service node, the method further includes:
receiving a service updating request, wherein the service updating request carries data identifiers of all sub-updating data obtained by dividing service updating data;
the obtaining of the plurality of sub-update data from the plurality of service nodes other than the first service node includes:
and respectively acquiring sub-update data corresponding to each data identifier from a plurality of service nodes except the first service node according to the service update request.
Optionally, the computer executable instructions, when executed, receive a service update request, comprising:
receiving at least one sub-update data and update data division information that are primarily distributed, wherein the update data division information includes: and the data identification of all the sub-updating data obtained by dividing the service updating data, and each sub-updating data is distributed to at least one service node.
Optionally, the computer executable instructions, when executed, distribute each sub-update data split from the service update data to at least two service nodes.
Optionally, when executed, the obtaining, according to the service update request, sub-update data corresponding to each data identifier from a plurality of service nodes other than the first service node includes:
respectively obtaining sub-update data storage information of a plurality of service nodes except a first service node, wherein the sub-update data storage information comprises: the data identifier of the sub-updating data stored on the service node;
for each data identifier in the service updating request, judging whether the first service node has sub-updating data corresponding to the data identifier;
if not, selecting a service node as a target service node according to the sub-update data storage information and the data identification, and acquiring the sub-update data corresponding to the data identification from the target service node.
Optionally, when executed, the selecting, according to the sub-update data storage information and the data identifier, one service node as a target service node includes:
determining sub-update data distribution information according to each piece of sub-update data storage information, wherein the sub-update data distribution information includes: the service update request comprises information of a service node where each data identifier corresponding to the sub-update data is located;
and selecting one service node as a target service node according to the sub-update data distribution information and the data identifier.
Optionally, when executed, the computer-executable instructions select one service node as a target service node according to the sub-update data distribution information and the data identifier, where the selecting includes:
based on the sub-update data distribution information, taking a plurality of service nodes which have stored the sub-update data corresponding to the data identification as alternative service nodes;
and determining the candidate service node with the lowest load rate as a target service node according to the load rate of each candidate service node.
Optionally, the computer-executable instructions, when executed, further include, after obtaining the sub-update data corresponding to the data identifier from the target service node:
and if the sub-updating data fails to be obtained, reselecting the next target service node according to the sequence of the load rate from low to high, and obtaining the sub-updating data corresponding to the data identifier from the reselected target service node.
Optionally, when executed, the computer-executable instructions respectively obtain sub-update data storage information of a plurality of service nodes other than the first service node, including:
receiving sub-update data storage information broadcasted by a plurality of service nodes except the first service node, wherein the sub-update data storage information is obtained after the plurality of service nodes except the first service node acquire new sub-update data and update local sub-update data storage information.
Optionally, when executed, the computer-executable instructions respectively obtain sub-update data storage information of a plurality of service nodes other than the first service node, including:
sending a subdata storage information acquisition request to each service node except the first service node;
and receiving local latest version sub-update data storage information sent by service nodes except the first service node, wherein the sub-update data storage information is sent by the service nodes except the first service node in response to the sub-data storage information acquisition request.
Optionally, when executed, the merging the acquired sub-update data to obtain the service update data includes:
sequencing the plurality of sub-updating data according to the sequence of the data identification from small to large;
and combining the sub-updating data according to the sequencing result to obtain the service updating data.
Optionally, the computer executable instructions, when executed, further comprise computer executable instructions for:
receiving a sub-update data acquisition request sent by each service node except the first service node;
and sending the sub-update data corresponding to the acquisition request to a corresponding service node.
Optionally, the computer executable instructions, when executed, further comprise computer executable instructions for:
and sending the local latest version of the sub-update data storage information to the corresponding service node.
In the service updating device in the embodiment of the application, in a plurality of service nodes to be updated by service, a plurality of sub-updating data are acquired from a plurality of service nodes except a first service node; merging the obtained plurality of sub-updating data to obtain service updating data; and according to the service updating data obtained by combination, performing service updating on the first service node. It can be seen that, with the service update device in the embodiment of the present application, based on dividing the service update data for service update of the service node into multiple sub-update data in advance, multiple service nodes to be serviced and updated share the diffusion of each sub-update data, and the data for service update of any service node is obtained by collecting and combining all sub-update data from other associated service nodes, so that the computing resources and network resources of multiple service nodes are effectively utilized, the service update efficiency of multiple service nodes is improved, and the service update of each service node is quickly, efficiently and safely performed.
Further, based on the same technical concept, corresponding to the methods shown in fig. 2 to fig. 5, embodiments of the present application further provide a storage medium for storing computer-executable instructions, where in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, and the like, and the computer-executable instructions stored in the storage medium, when being executed by a processor, can implement the following processes:
in a plurality of service nodes to be updated by service, acquiring a plurality of sub-update data from a plurality of service nodes except a first service node, wherein the plurality of sub-update data are obtained by dividing the service update data in advance;
merging the obtained sub-updating data to obtain the service updating data;
and performing service updating on the first service node according to the service updating data obtained by combination.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, further implement the following process: before obtaining a plurality of sub-update data from a plurality of service nodes other than the first service node, the method further includes:
receiving a service updating request, wherein the service updating request carries data identifiers of all sub-updating data obtained by dividing service updating data;
the obtaining of the plurality of sub-update data from the plurality of service nodes other than the first service node includes:
and respectively acquiring sub-update data corresponding to each data identifier from a plurality of service nodes except the first service node according to the service update request.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, receive a service update request, comprising:
receiving at least one sub-update data and update data division information that are primarily distributed, wherein the update data division information includes: and the data identification of all the sub-updating data obtained by dividing the service updating data, and each sub-updating data is distributed to at least one service node.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, distribute each child update data split from the service update data to at least two service nodes.
Optionally, when executed by a processor, the computer-executable instructions stored in the storage medium respectively obtain sub-update data corresponding to each data identifier from a plurality of service nodes other than the first service node according to the service update request, and include:
respectively obtaining sub-update data storage information of a plurality of service nodes except a first service node, wherein the sub-update data storage information comprises: the data identifier of the sub-updating data stored on the service node;
for each data identifier in the service updating request, judging whether the first service node has sub-updating data corresponding to the data identifier;
if not, selecting a service node as a target service node according to the sub-update data storage information and the data identification, and acquiring the sub-update data corresponding to the data identification from the target service node.
Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, selecting one service node as a target service node according to the sub-update data storage information and the data identifier includes:
determining sub-update data distribution information according to each piece of sub-update data storage information, wherein the sub-update data distribution information includes: the service update request comprises information of a service node where each data identifier corresponding to the sub-update data is located;
and selecting one service node as a target service node according to the sub-update data distribution information and the data identifier.
Optionally, when executed by a processor, the selecting a service node as a target service node according to the sub-update data distribution information and the data identifier includes:
based on the sub-update data distribution information, taking a plurality of service nodes which have stored the sub-update data corresponding to the data identification as alternative service nodes;
and determining the candidate service node with the lowest load rate as a target service node according to the load rate of each candidate service node.
Optionally, the storage medium stores computer-executable instructions, which when executed by the processor, further includes, after obtaining the sub-update data corresponding to the data identifier from the target service node:
and if the sub-updating data fails to be obtained, reselecting the next target service node according to the sequence of the load rate from low to high, and obtaining the sub-updating data corresponding to the data identifier from the reselected target service node.
Optionally, the computer-executable instructions stored in the storage medium, when executed by the processor, respectively obtain sub-update data storage information of a plurality of service nodes other than the first service node, including:
receiving sub-update data storage information broadcasted by a plurality of service nodes except the first service node, wherein the sub-update data storage information is obtained after the plurality of service nodes except the first service node acquire new sub-update data and update local sub-update data storage information.
Optionally, the computer-executable instructions stored in the storage medium, when executed by the processor, respectively obtain sub-update data storage information of a plurality of service nodes other than the first service node, including:
sending a subdata storage information acquisition request to each service node except the first service node;
and receiving local latest version sub-update data storage information sent by service nodes except the first service node, wherein the sub-update data storage information is sent by the service nodes except the first service node in response to the sub-data storage information acquisition request.
Optionally, when executed by a processor, the merging the obtained plurality of sub-update data to obtain the service update data includes:
sequencing the plurality of sub-updating data according to the sequence of the data identification from small to large;
and combining the sub-updating data according to the sequencing result to obtain the service updating data.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, further implement the following process:
receiving a sub-update data acquisition request sent by each service node except the first service node;
and sending the sub-update data corresponding to the acquisition request to a corresponding service node.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, further implement the following process:
and sending the local latest version of the sub-update data storage information to the corresponding service node.
When executed by a processor, the computer-executable instructions stored in the storage medium in the embodiment of the application obtain a plurality of sub-update data from a plurality of service nodes except a first service node in a plurality of service nodes to be updated by service; merging the obtained plurality of sub-updating data to obtain service updating data; and according to the service updating data obtained by combination, performing service updating on the first service node. It can be seen that, with the storage medium in the embodiment of the present application, based on dividing service update data used for service update by service nodes into multiple sub-update data in advance, multiple service nodes to be serviced and updated share diffusion of each sub-update data, and data used for service update by any service node is obtained by collecting and merging all sub-update data from other associated service nodes, so that computing resources and network resources of multiple service nodes are effectively utilized, the service update efficiency of multiple service nodes is improved, and service update of each service node is rapidly, efficiently and safely performed.
In the 90 th generation of 20 th century, it is obvious that improvements in Hardware (for example, improvements in Circuit structures such as diodes, transistors and switches) or software (for improvement in method flow) can be distinguished for a technical improvement, however, as technology develops, many of the improvements in method flow today can be regarded as direct improvements in Hardware Circuit structures, designers almost all obtain corresponding Hardware Circuit structures by Programming the improved method flow into Hardware circuits, and therefore, it cannot be said that an improvement in method flow cannot be realized by Hardware entity modules, for example, Programmable logic devices (Programmable logic devices L organic devices, P L D) (for example, Field Programmable Gate Arrays (FPGAs) are integrated circuits whose logic functions are determined by user Programming of devices), and a digital system is "integrated" on a P L D "by self Programming of designers without requiring many kinds of integrated circuits manufactured and manufactured by special chip manufacturers to design and manufacture, and only a Hardware software is written in Hardware programs such as Hardware programs, software programs, such as Hardware programs, software, Hardware programs, software programs, Hardware programs, software, Hardware programs, software, Hardware programs, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software.
A controller may be implemented in any suitable manner, e.g., in the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, Application Specific Integrated Circuits (ASICs), programmable logic controllers (PLC's) and embedded microcontrollers, examples of which include, but are not limited to, microcontrollers 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone L abs C8051F320, which may also be implemented as part of the control logic of a memory.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.