Disclosure of Invention
The present invention is directed to overcome the above-mentioned shortcomings in the prior art, and provides a method and a system for determining the consistency of distributed software program data, which can quickly determine where the consistency and difference of data between programs are located without mutual calculation between programs.
The invention provides a method for judging the consistency of distributed software program data, which comprises the following steps:
s1, numbering the data acquired from the outside, and when the distributed software program processes the data, associating all the modified data associated with the data with the number of the data, and determining a starting point program, a middle point program and an end point program for processing the data;
s2, judging the relevance and integrity of the data among the distributed software programs by checking whether the processing chain of the data related to a certain number from the starting point program, the intermediate point program to the end point program is complete or not;
step S1 specifically includes the following steps:
when the distributed software program processes data acquired from the outside, numbering the data; when all programs transmit modified data associated with the data to other services, the modified data carry the serial number of the data, and the programs are marked as starting programs of the data;
when the other programs receive the modified data which is sent by the starting program and is associated with the data, the serial numbers of the data are used; the other programs finish processing the modified data associated with the data, and if the data associated with the data is continuously transmitted to the other programs, the program is marked as a middle point program of the data; if the data associated with the data is no longer being passed to other programs, the program is marked as the end program for the data.
In addition to the above-described technical means, when the data acquired from the outside is numbered in step S1, the number is incremented without overlapping each other between the start point programs in the system.
Based on the above technical solution, in step S1, when the data obtained from the outside is numbered, the new number is used only when the external data is directly received.
On the basis of the above technical solution, step S2 specifically includes the following steps:
if the data associated with a certain number has a corresponding starting point program, all intermediate point programs and ending point programs in a processing chain in the system, the data associated with the certain number is considered to be completely processed, the data is complete, and otherwise, the data is considered to be incomplete.
The invention also provides a system for judging the data consistency of the distributed software program, which comprises an association marking unit and a data integrity judging unit, wherein:
the association flag unit is used for: numbering data acquired from the outside, associating all modified data associated with the data with the number of the data when the distributed software program processes the data, and determining a starting point program, an intermediate point program and an end point program for processing the data;
the data integrity judgment unit is used for: judging the relevance and integrity of data among distributed software programs by verifying whether a processing chain of data related to a certain number from a starting point program, an intermediate point program to a terminal point program is complete or not;
the association flag unit is specifically configured to:
when the distributed software program processes data acquired from the outside, numbering the data; when all programs transmit modified data associated with the data to other services, the modified data carry the serial number of the data, and the programs are marked as starting programs of the data;
when the other programs receive the modified data which is sent by the starting program and is associated with the data, the serial numbers of the data are used; the other programs finish processing the modified data associated with the data, and if the data associated with the data is continuously transmitted to the other programs, the program is marked as a middle point program of the data; if the data associated with the data is no longer being passed to other programs, the program is marked as the end program for the data.
In the above-described aspect, when the association flag unit numbers data acquired from the outside, the numbers are not overlapped with each other and are incremented between starting point programs in the system.
On the basis of the technical scheme, when the association marking unit numbers the data acquired from the outside, the new number is used only when the external data is directly received.
On the basis of the above technical solution, the data integrity determination unit is specifically configured to:
if the data associated with a certain number has a corresponding starting point program, all intermediate point programs and ending point programs in a processing chain in the system, the data associated with the certain number is considered to be completely processed, the data is complete, and otherwise, the data is considered to be incomplete.
Compared with the prior art, the invention has the following advantages:
the method comprises the steps of numbering data acquired from the outside, associating all modified data associated with the data with the number of the data when a distributed software program processes the data, and determining a starting point program, an intermediate point program and an end point program for processing the data; and judging the relevance and integrity of the data among the distributed software programs by verifying whether the processing chain of the data related to a certain number from the starting point program, the intermediate point program to the end point program is complete. The invention can easily judge the integrity of the data among the programs in a certain system by judging the number of the external data and the starting point program, the intermediate point program and the end point program corresponding to the number. When determining whether the data between the programs is complete, the mutual calculation between the programs is not needed, and the data difference between the programs can be quickly calculated.
Detailed Description
The invention is described in further detail below with reference to the figures and the embodiments.
Example 1
Referring to fig. 1, embodiment 1 of the present invention provides a method for determining data consistency of a distributed software program, including the following steps:
s1, numbering the data acquired from the outside, and when the distributed software program processes the data, associating all the modified data associated with the data with the number of the data, and determining a starting point program, a middle point program and an end point program for processing the data;
and S2, judging the relevance and integrity of the data among the distributed software programs by verifying whether the processing chain of the data related to a certain number from the starting point program, the intermediate point program to the end point program is complete.
In step S1, when the data acquired from the outside is numbered, the number is incremented without overlapping each other between the start point programs in the system. Only when external data is directly received, the new number is used.
Example 2
The embodiment 2 of the invention provides a method for judging the consistency of distributed software program data, which comprises the following steps:
when the distributed software program processes data acquired from the outside, numbering the data; when all programs transmit modified data associated with the data to other services, the modified data carry the serial number of the data, and the programs are marked as starting programs of the data;
when the other programs receive the modified data which is sent by the starting program and is associated with the data, the serial numbers of the data are used; the other programs finish processing the modified data associated with the data, and if the data associated with the data is continuously transmitted to the other programs, the program is marked as a middle point program of the data; if the data associated with the data is no longer being passed to other programs, the program is marked as the end program for the data.
If the data associated with a certain number has a corresponding starting point program, all intermediate point programs and ending point programs in a processing chain in the system, the data associated with the certain number is considered to be completely processed, the data is complete, and otherwise, the data is considered to be incomplete.
Example 3
Embodiment 3 of the present invention provides a method for determining consistency of distributed software program data, including the following steps:
when processing first data acquired from the outside, a first program numbers the first data acquired from the outside, and the number 1001 of the first data is assumed to be 1001, and is called as a first number; all programs carry the first number 1001 when they transmit the first data to other services, and the first program is called the start program. This number does not overlap with each other and increments between starting programs in the system, and the first program is referred to as the starting program of the first number 1001.
When the second program receives the first data sent by the first program, the first serial number 1001 of the first data is used, and only when the external data is directly received, the new serial number is used; if the second program is processing the first data with the first number 1001, the second program continues to transmit the first data with the first number 1001 to other programs, and the second program is called a middle point program with the first number 1001. Since the number of the second process is the same as the number 1001 of the start process in step S1, it can be considered that the second process and the start process in step S1 are processing the same service together.
When the third program processes the first data with the first number 1001 and does not transfer the first data with the number 1001 to another program, the third program is referred to as an end point program with the first number 1001. For the first number 1001, there are both the start point procedure and the end point procedure, and as long as the related procedures have processed the first data of the number 1001, the service is considered to have been completely ended.
If the data of a number has a starting point program corresponding to the number, all intermediate point programs and a corresponding end point program in the system, the data processing of the number is considered to be completely finished, and the data is complete, for example, if the data modified by the first data of the number 1001 in the starting point program and the end point program are marked with 1001 numbers, the association and the integrity between the data can be judged only by comparing the numbers.
Example 4
Embodiment 4 of the present invention provides a system for determining data consistency of a distributed software program, including an association marking unit and a data integrity determining unit, where:
the association flag unit is used for: numbering data acquired from the outside, associating all modified data associated with the data with the number of the data when the distributed software program processes the data, and determining a starting point program, an intermediate point program and an end point program for processing the data;
the data integrity judgment unit is used for: and judging the relevance and integrity of the data among the distributed software programs by verifying whether the processing chain of the data related to a certain number from the starting point program, the intermediate point program to the end point program is complete.
When the association flag unit numbers data acquired from the outside, the numbers are not overlapped with each other and are incremented between starting point programs in the system. Only when external data is directly received, the new number is used.
Example 5
Embodiment 5 of the present invention provides a system for determining data consistency of a distributed software program, including an association marking unit and a data integrity determining unit, where:
the association flag unit is used for:
when the distributed software program processes data acquired from the outside, numbering the data; when all programs transmit modified data associated with the data to other services, the modified data carry the serial number of the data, and the programs are marked as starting programs of the data;
when the other programs receive the modified data which is sent by the starting program and is associated with the data, the serial numbers of the data are used; the other programs finish processing the modified data associated with the data, and if the data associated with the data is continuously transmitted to the other programs, the program is marked as a middle point program of the data; if the data associated with the data is no longer being passed to other programs, the program is marked as the end program for the data.
The data integrity judgment unit is used for:
if the data associated with a certain number has a corresponding starting point program, all intermediate point programs and ending point programs in a processing chain in the system, the data associated with the certain number is considered to be completely processed, the data is complete, and otherwise, the data is considered to be incomplete.
Example 6
The system is system-bound, and a distributed system is considered as a whole, and also system-bound, data entering the system from the bound can be defined, and after external data enters the system range, processing may be completed through cooperation of a plurality of programs, and fig. 2 shows solid lines 1, 2, 3 and a dotted line A, B respectively represent execution paths of two kinds of external service data.
Referring to fig. 2, program 1 receives external data numbered 100, program 1 is the starting program numbered 100, then any data modification when program 1 processes data numbered 100 is associated with number 100, including interactive data with other programs, and when program 1 processes data numbered 100, program 1 sends data numbered 100 to program 2.
Program 2 is a middle point program, program 2 will continue to use number 100, with the data modifications made associated with number 100, and then program 2 will also interact with program 4, program 3 with data numbered 100.
Program 4 again continues to use number 100, with data modifications made that are all associated with number 100, and then program 4 does not have data interactions with other programs, i.e., program 4 is an endpoint program.
Program 3 also continues to use number 100, with data modifications made that are all associated with number 100, and then program 3 does not have data interactions with other programs, i.e., program 3 is an endpoint program.
The programs 1, 2, 3, and 4 all send information that they have processed the number 100 to the MGR (Manager), i.e., the dotted lines between the programs and the MGR in fig. 2, and the Manager MGR determines whether the data processing of the number 100 has been completely finished.
Program 1 sends {100, starting point program, out to program 2 } to hypervisor MGR;
program 2 sends {100, midpoint program, from program 1 in, to program 4 out, to program 3 } to hypervisor MGR;
program 4 sends {100, end program, from program 2 in } to hypervisor MGR;
program 3 sends 100, end program, from program 2 in to hypervisor MGR.
The management program MGR determines each piece of numbering information sent by the respective program: if there is a starting point, there are intermediate points, and each intermediate point is also associated with an ending point, such as the 100 numbered data above, then the 100 numbered data is all processed in the system and the involved programs are consistent with each other at 100.
If a program is processing data of number 100 and is also processing another external service data, for example, the flow identified by the dashed line A, B in fig. 2, the processing procedure is as follows:
program 4 receives the external data and sets the external data number to 200, program 4 is the starting program number 200, and any data modification of program 4 while processing the data number 200 is associated with number 200.
Program 4 sends 200, the starting program, to program 5 to hypervisor MGR.
Program 4 also performs data interaction with program 5 when processing data numbered 200, program 5 is an intermediate point program, program 5 continues to use number 200, the data modifications it makes are all associated with number 200, program 5 also performs data interaction with program 3, program 5 sends {200, the intermediate point program, from program 4 in, to program 3 } to hypervisor MGR.
If the program 3 is damaged before the processing flow of the number 200 is started, the management program MGR may not receive the flow information identified by the program 3, and may only receive the data of the program 4 and the program 5, and then the management program MGR determines that the flow from the program 5 to the program 3 has no end program and has the exception information of the program 3, and if the program 3 is damaged and no other data is lost, the management program MGR determines that the data of the number 200 in the current system is incomplete.
By judging the number of the external data and the starting point program, the intermediate point program and the end point program corresponding to the number, the integrity of the data among the programs in a system at a certain moment can be easily judged.
Various modifications and variations of the embodiments of the present invention may be made by those skilled in the art, and they are also within the scope of the present invention, provided they are within the scope of the claims of the present invention and their equivalents.
What is not described in detail in the specification is prior art that is well known to those skilled in the art.