Disclosure of Invention
To solve or at least partially solve the above technical problems, the present application provides a loose coupling federal system alignment method, apparatus, device, and storage medium.
In a first aspect, the present application provides a loosely coupled federal system alignment method, the loosely coupled federal system alignment method comprising:
in each state transition process of the federation system, carrying out state alignment according to a preselected federation member reference state, wherein the federation system is composed of a plurality of federation members;
when the reference states are aligned, determining a state section of each attribute state of each federal member in the federal system according to a pre-constructed federal system state space model.
Optionally, the loosely coupled federal system alignment method further comprises:
Constructing a connection matrix A according to the data interaction relation among federate members in the federate system;
constructing a federation member state space model for reflecting each federation member state information according to the connection matrix A, wherein the federation member state information is composed of a plurality of attribute states;
Constructing a federal system state space model according to each federal member state space model;
the data interaction relationship is as follows:
Where m represents the number of federal members in the federal system.
Optionally, constructing a federation membership status space model for reflecting status information of each federation membership according to the connection matrix a, including:
for each federate member, determining a plurality of attribute states that the federate member has;
Determining self state variables corresponding to the attribute states and input state data of associated members according to the connection matrix A;
Constructing a first state equation only related to the attribute state of the federate member according to the self state variable;
And constructing a second state equation controlled by the attribute state of the federate member and the input state data according to the input state data, wherein the first state equation and the second state equation form a federate member state space model.
Optionally, according to each federal member state space model, constructing the federal system state space model using the following formula:
Wherein, Represents the state of the federal system (k+1), k represents the state transition iteration number index,A federal system state transition matrix representing a first state equation,The federal system state transition matrix representing the second state equation, the symbol ≡indicates the hadamard product of the two matrices, and W (k) indicates the state space error.
Optionally, the loosely coupled federal system alignment method further comprises:
And selecting the same attribute state in the federal member as a reference state according to federal member data interaction conditions and/or data interaction frequency.
Optionally, the state alignment is performed according to a preselected federal member reference state in the following manner:
when the value of the federal member reference state is a determined value, mapping and aligning the federal member reference state;
And when the value of the federal member reference state is an uncertain value, aligning the parameter polynomials of the federal member reference state.
In a second aspect, the present application provides a loosely coupled federal system alignment apparatus, the loosely coupled federal system alignment apparatus comprising:
the state space module is used for constructing a state space model of the federation system according to the state space model of each federation member;
the state alignment module is used for carrying out state alignment according to a preselected federal member reference state in each state transition process of the federal system, wherein the federal system is composed of a plurality of federal members;
when the reference states are aligned, determining a state section of each attribute state of each federal member in the federal system according to a pre-constructed federal system state space model.
Optionally, the state space module is specifically configured to construct a connection matrix a according to a data interaction relationship among federates in the federate system, construct a federate member state space model for reflecting state information of each federate member according to the connection matrix a, and construct the federate system state space model according to each federate member state space model;
the data interaction relationship is as follows:
Where m represents the number of federal members in the federal system.
In a third aspect, the present application provides a loosely coupled federal system alignment appliance comprising a memory, a processor, and a computer program stored on the memory and executable on the processor;
The computer program, when executed by the processor, performs the steps of a loosely coupled federal system alignment method, as in any of the above.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a loosely coupled federal system alignment program which, when executed by a processor, implements the steps of a loosely coupled federal system alignment method as in any of the above.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
According to the embodiment of the application, the state alignment is carried out according to the preselected reference state of the federal member in each state transition process of the federal system, the federal system is composed of a plurality of federal members, when the reference state is aligned, the state section of each attribute state of each federal member in the federal system is determined according to the pre-constructed federal system state space model, so that a certain state of the federal member is selected as a comparison reference, and under the state alignment, the other attribute states of the federal member are calculated and compared to approximate to the continuous system behavior. Compared with a clock alignment mode, the method selects the reference state with actual physical meaning for alignment, and is more suitable for actual engineering application. In addition, for the dynamic variable structure, the reference state can be flexibly selected. Meanwhile, the defect that the existing clock alignment method based on single time variable cannot completely explain a loose coupling federal system behavior evolution mechanism and lacks flexibility for a dynamic real-time variable structure is overcome.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
Example 1
An embodiment of the present invention provides a loose coupling federal system alignment method, as shown in fig. 1, including:
S101, performing state alignment according to a preselected federation member reference state in each state transition process of a federation system, wherein the federation system is composed of a plurality of federation members;
s102, when the reference states are aligned, determining a state section of each attribute state of each federal member in the federal system according to a pre-constructed federal system state space model.
Wherein, the federal system is a distributed system which defines different federations according to different purposes and is used for achieving specific purposes. The federation consists of a plurality of federal members. Federal members, which may be devices, systems, tools, models, algorithms, software, etc., make up a federal system. Loose coupling, namely loosely connecting federal members, wherein the members have data flow relation, but are not directly connected, and have no mutual limitation, and any federal member uncoupling relation has no influence on other members. And (3) system behavior evolution, namely federal member state transition and a process of effectively operating a federal system.
According to the embodiment of the invention, the state alignment is carried out according to the preselected reference state of the federal member in each state transition process of the federal system, the federal system is composed of a plurality of federal members, when the reference state is aligned, the state section of each attribute state of each federal member in the federal system is determined according to the pre-constructed federal system state space model, so that a certain state of the federal member is selected as a comparison reference, and under the state alignment, the other attribute states of the federal member are calculated and compared to approximate to the continuous system behavior. Compared with a clock alignment mode, the method selects the reference state with actual physical meaning for alignment, and is more suitable for actual engineering application. In addition, for the dynamic variable structure, the reference state can be flexibly selected. Meanwhile, the defect that the existing clock alignment method based on single time variable cannot completely explain a loose coupling federal system behavior evolution mechanism and lacks flexibility for a dynamic real-time variable structure is overcome.
The embodiment of the invention can effectively solve the consistency characterization problem of federal member time-space data calculation, can better explain the behavior evolution of the loose coupling system, and flexibly cope with the dynamic variable structure of the loose coupling system.
The following describes a state alignment method and device of a loosely coupled federal system, taking CPS (information physical system, cyber-PHYSICAL SYSTEMS) application in which a virtual space and a physical space are linked as an example. The optional embodiment of the invention is a part of a production process of a complex product, and totally comprises 4 working procedures, wherein each working procedure establishes a corresponding virtual prototype to perform simulation calculation, and the material circulation among the working procedures is operated by adopting a transfer robot. As shown in fig. 2, the specific procedure is as follows:
1. First, a connection matrix A is constructed according to the data interaction relation among federate members in the federate system. For example, according to a loosely coupled federation system composition, data interactions among federate members are defined by a publish/subscribe schema, with the interactions among the members represented by a join matrix. In this embodiment, there are 5 federate members, and the connection matrix is represented by symbol a (R 5×5), and it is assumed that element a ij e a represents that federate member i has data interaction with j. When a member i sends data to j, a ij =1, otherwise, it is 0;
The data interaction between federal members is loosely coupled and the data transmission is directional, so matrix a is a5 x 5 square matrix. The coupling matrix varies with the federal system architecture. The data interaction among federal members is local and the data transmission is directional, so that the connection matrix A is a sparse matrix. When the loosely coupled federal system architecture changes, so does the coupling matrix a.
The process flow schematic of this example is shown in fig. 3. The work pieces are moved from the federal member 1 to the federal member 2 by the robots according to the processing sequence, then flow to the federal member 3 and the federal member 4, and finally are placed at the finished product by the robots, wherein the system state is mainly propelled and controlled by the action state of the federal member robot 5. Federal member publish/subscribe relationships are shown in figure 4. The connection matrix is as follows:
2. And constructing a federation member state space model for reflecting the state information of each federation member according to the connection matrix A, and constructing the federation system state space model according to each federation member state space model. The method comprises the steps of determining a plurality of attribute states of state information of each federate member, determining self state variables and input state data corresponding to the attribute states according to a connection matrix A, constructing a first state equation only related to the self attribute states of the federate member according to the self state variables, wherein the state model is only related to the self states of the federate member and is not influenced by state data of other members. And constructing a second state equation controlled by the attribute state of the federate member and the input state data of the associated member according to the input state data, wherein the second state equation is a state space model controlled by combining the state of the federate member and the subscribed state data.
For example, a state space model of each federal member is built, and then the state space model of a federal system is formed by the state space model of each federal member, wherein the state space model of the federal system is built according to the composition of the federal system.
The state equation of the federal member in this embodiment is calculated by assuming that the state variable of a federal member is x= [ X, y, u, v ], and the member subscription data is the data state variable X j,Xk of federal members j and k, and is used as the input of the state variable u, v. The state space equation for a single federal member is expressed as:
Wherein f i is the state equation of the ith state, and the value of i in this embodiment is 1-4. The state equation of the attribute states x, y is a function of the member's own state and is not affected by other federal member state data, while the state equation of the attribute states u, v is a function of the member's own state and the subscribed member's state as control variables, the states of u, v being affected by the input state variables (input state data). In detail, equation (3) is a four degree of freedom equation of the robot, where x represents a lateral distance, y represents a longitudinal distance, u represents a lateral speed, v represents a longitudinal speed, The expression takes the derivative of the variable x, the derivative of the distance is the velocity and the derivative of the velocity is the acceleration. X j represents the input state data for federal member j, namely X j=[xj,yj,uj,vj, member X k=[xk,yk,uk,vk.
The Union member state space model is now described in a unified format. The unified format description is to write the input states of different members together, such as X j,Xk is represented by the same X for X J=[xJ,yJ,uJ,vJ ] J=k, J, the federal member state information is represented by the symbol X i, X i∈Rn is an n-dimensional vector, the input vector is member state information X J, since each federal member has own clock, the time of the ith member is set to be T i, and the federal member state space model is represented as
T represents time, X i(Ti) represents the state X i=[xi,yi,ui,vi of the ith member at time T i, while X J(TJ) represents the state X j=[xj,yj,uj,vj of the jth member at time T j, and the state X k=[xk,yk,uk,vk of the kth member at time T k.
Wherein subscript i=1, 2,..m, represents a federal member. F is a state equation that may be either linear or non-linear depending on the actual federal membership. X J(TJ) is a control variable of the state equation of the ith federal member, which is a subject message set subscribed by the member, and the subscript j= { j|a ji=1,j=1,…,m,aji e a }, that is, a row subscript corresponding to the ith column value of the connection matrix being 1. After the expansion of the pair (4), the pair can be written as
Wherein the variables areAn approximation of X i is represented,As well as the same. Error is denoted by ω i and C i、Di is a state transition matrix.
Wherein the state transition matrixWherein each element in D i is a matrix. Omega i is the state space error.
When no other member state data is taken as input, which is only related to the own state, D i =0, when the state of other member is taken as a control variable, assuming j, k two members, the calculation of the state matrix D i∈Rn×(n×J) is
Converting the continuous state space model into a discrete state space, and respectively setting delta t i=tk-tk-1 according to the data precision requirement because each federal member has a clock mechanism, wherein the discrete state space is expressed as:
Xi(k+1)=Ci,kXi(k)+Di,kXJ(k)+ωi(k) (7)
wherein C is i,k=E+ΔtiCi,Di,k=ΔtiDi
Where k is the iteration number index of the state transition, k=1, 2, E represents an identity matrix, the diagonals are all 1, and the other positions are all 0.
The single membership state space model is extended to the federal system state space model as follows:
Wherein, Represents the state of the federal system (k+1), k represents the state transition iteration number index,A federal system state transition matrix representing a first state equation,The federal system state transition matrix representing the second state equation, W (k) represents the hadamard product (dot product) of the two matrices, i.e., (a ≡b) ij=aij×bij.
FIG. 5 is a federal membership status space diagram of an embodiment of the present invention. The horizontal axis is a time axis, and the state space model is discretized according to the time interval to obtain a federal member state tangent plane, and mass data form a state space.
3. And when the reference states are aligned, determining a state section of each attribute state of each federal member in the federal system according to a state space model of the federal system constructed in advance. For example, according to the federal member data interaction condition and the data interaction frequency, a certain attribute state in the federal member is determined as a reference state, and state alignment is performed. The method of state alignment is selected based on whether the reference state value is determined. And when the value of the federal member reference state is an uncertain value, carrying out parameter polynomial alignment on the federal member reference state. For example, when the value of the selected reference state is determined, a mapping alignment method is selected, mapping alignment is performed on the reference states of the binding members, a mapping function is constant, when the value of the selected reference state is uncertain, a parameter polynomial alignment method is selected according to the fluctuation of the condition within a certain range, and the parameter determination method comprises, but is not limited to, polynomial fitting, empirical estimation and interpolation calculation. At this time, the federal member state equation under state alignment is converted into
Xi(z+1)=Ci,kXi(z)+Di,kXJ(z)+ωi(z) (9)
Where z is the reference state.
In this embodiment, the same attribute state in the federal member is selected as the reference state according to the federal member data interaction condition and/or the data interaction frequency. For example, before production starts, each federal member uses the position and the motion condition of the federal member robot 5 (the robot is in a carrying position and is stationary) as an initial reference state, when processing operation starts, according to the processing process path, each federal member has mutual state information feedback, each federal member updates its own running state according to the interactive information, the motion condition and the processing condition of the reference robot, for example, when the state of the federal member 2 changes, the robot and other federal members can perform state update (self motion) according to the state of the device 2 (the position of the device 2, the workpiece position, the motion data of the device 2 and the like), and after each state transition, the reference state alignment of each federal member is ensured, namely, the state alignment function at this time is the relative position of the federal member robot and the federal member 2, which is a fixed value, is a constant, and after the state alignment, the state of the robot is returned to a zero position (the robot is in a zero position, each joint returns to a zero position). In the simulation process, the federate member keeps the state consistency of the federate member and the federate system, and the system state alignment is realized. Fig. 6 is a state alignment schematic diagram of the present embodiment.
Further, determining a state section where other attribute states of each federal member are located under the condition of reference state alignment, and obtaining state data discrete points under the condition of reference state alignment according to each state transition to perform system behavior evolution. That is, according to the federal member data interaction condition and the data interaction frequency, the state with the same attribute in the federal member is determined as the reference state, so that the data calculation and comparison are performed when the reference state is aligned. And determining a state section where other attribute states of each federal member are located under the condition of reference state alignment, and performing system behavior evolution according to the state data discrete points. When the loose coupling federal system structure is changed, returning to the step 1, recalculating the coupling matrix and reconstructing the system state space model. If the federal system structure is unchanged, the reference state is matched again, the next state alignment calculation is carried out, the state data section is obtained, and the circulation is carried out, so that the accurate and effective deduction of the federal system state is ensured.
According to the loose coupling federation system state alignment method provided by the invention, the federation system state space model is constructed according to the connection matrix, federation members with data circulation are analyzed, the reference state is determined, the state sections of all federation members are calculated and compared under the state alignment condition, the problem of consistency characterization of space-time data calculation of multidisciplinary federation members is solved, the federation members perform data calculation at correct positions, and the behavior evolution of the federation system can be well explained.
For dynamic variable structure, the reference state is flexibly selected. The state alignment method of the loosely coupled federal system is used for dynamically adding and dynamically exiting federal members, and the loosely coupled federal system with a dynamically variable structure has more flexibility under the condition that federal members are aligned in a reference state, and is more suitable for CPS with a loosely coupled structure.
Example two
The embodiment of the invention provides a loose coupling federal system alignment device, which comprises:
the state space module is used for constructing a state space model of the federation system according to the state space model of each federation member;
The state alignment module is used for carrying out state alignment according to a preselected federal member reference state in each state transition process of the federal system, wherein the federal system is composed of a plurality of federal members, and when the reference state is aligned, a state section of each attribute state of each federal member in the federal system is determined according to a pre-built federal system state space model.
Optionally, the state space module is specifically configured to construct a connection matrix a according to a data interaction relationship among federates in the federate system, construct a federate member state space model for reflecting state information of each federate member according to the connection matrix a, and construct the federate system state space model according to each federate member state space model;
the data interaction relationship is as follows:
Where m represents the number of federal members in the federal system.
According to the embodiment of the invention, a certain state of the federate member is selected as a comparison standard, and other attribute states of the federate member are calculated and compared under the alignment of the states, so that the behavior of the continuous system is approximated. Compared with a clock alignment mode, the method selects the reference state with actual physical meaning for alignment, and is more suitable for actual engineering application. In addition, for the dynamic variable structure, the reference state can be flexibly selected. Meanwhile, the defect that the existing clock alignment method based on single time variable cannot be completely explained and lacks flexibility for dynamic real-time variable structure is overcome.
The following describes embodiments of the present invention in detail using a specific example.
As shown in fig. 7 and 8, a loose coupling federal system state alignment method apparatus of this example includes:
The federation system composition module is used for forming a loosely coupled federation system, and obtaining a connection matrix among federation members according to the data interaction relationship among federation members in the federation system;
the state space module is used for constructing a state space model of the federal system according to the federal system composition and the motion mechanism of federal members to obtain a federal system state discrete data set;
The state alignment module is used for matching the reference states of the federal members for carrying out state data comparison calculation according to the federal system state space model, carrying out state alignment and obtaining the state section of each federal member when the states are aligned;
wherein, the federal system component module includes:
And the coupling matrix unit is used for obtaining a coupling matrix of the loosely coupled federal system based on the publish/subscribe relationship of the federal members. Since data distribution has directionality, the join matrix is an asymmetric sparse square matrix.
Optionally, the state space module includes:
The state space model unit is used for analyzing the motion mechanism of the federate member and constructing a federate member state space model based on the connection matrix according to the loosely coupled federate system structure;
and the state equation evolution unit is used for carrying out state space evolution of the federal system based on the state characteristics after the state alignment and the federal member states after the state alignment. The method is particularly used for carrying out federal system state space evolution after alignment of the reference state in each state transition.
Optionally, the state alignment module includes:
And the judging unit is used for judging whether the structure of the loosely coupled federation system is changed, if so, updating federation member definition to obtain a new connection matrix, and otherwise, carrying out federation member state alignment and carrying out state space equation evolution.
And the reference state matching unit is used for obtaining a certain reference state meeting the data calculation condition during federal member data interaction.
And the state alignment unit is used for carrying out reference state alignment after obtaining the reference state and determining a state section where other attribute states of each federal member are located.
Of course, in the specific implementation process of this embodiment, reference may also be made to the first embodiment.
Example III
The embodiment of the invention provides a loosely coupled federation system alignment device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor;
The computer program, when executed by the processor, performs the steps of a loosely coupled federal system alignment method according to any of embodiments one.
Example IV
An embodiment of the present invention provides a computer readable storage medium having stored thereon a loosely coupled federal system alignment program, which when executed by a processor, implements the steps of the loosely coupled federal system alignment method of any of the embodiments.
The implementation of the second embodiment to the fourth embodiment can refer to the first embodiment, and has corresponding technical effects.
It should be noted that, in this document, 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 one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention. It will be appreciated that the methods described in the various embodiments of the present invention may also be embodied in the form of program code that is executed by firmware (e.g., a chip) that solidifies the program code.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.