A heterogeneous system integration method based on intermediate program and heterogeneous system
By introducing intermediate programs between heterogeneous systems and using key queue linked lists to achieve information interaction, the problems of complex and poor reliability of data interaction between heterogeneous systems in the prior art are solved, efficient, real-time and reliable data interaction is achieved, and development and deployment costs are reduced.
Patent Information
- Application Number
- CN202210766226.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2042-06-30
AI Technical Summary
The prior art has problems such as complex interfaces, difficult development, poor reliability, and complex deployment structure in data interaction between heterogeneous systems, resulting in high development and deployment costs and low efficiency.
The heterogeneous system integration method based on intermediate programs is adopted, and the client's listening information and update information is received through intermediate programs, and the key queue link list is used to realize information interaction and lock and unlock processing threads, simplifying the communication process between systems.
It realizes efficient, real-time and reliable data interaction between heterogeneous systems, reduces development and deployment costs, simplifies the system structure, and improves the stability of the overall system.
Smart Images

Figure CN115033406B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to data integration technology, and in particular to a heterogeneous system integration method and a heterogeneous system based on an intermediate program. Background Art
[0002] In industrial automation and control software projects, the diversity of communication methods and protocols has become increasingly apparent, and engineers need to find a suitable way to solve the interconnection and communication problems between heterogeneous systems.
[0003] Existing software systems are developed in programming languages such as C#, C++, and Java. When data interaction is required between systems, it is usually necessary to customize the interactive interface. The existing interface communication methods are generally through real-time database virtual bit numbers, relational databases, custom APIs, etc. Its interface is complex, development is difficult, and reliability is poor. In other words, customizing a suitable communication method for each system requires repeated configuration, heavy workload, small data transmission volume, difficulty in development, poor reliability, and complex deployment and structure. Summary of the invention
[0004] 1. Technical issues to be resolved
[0005] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a heterogeneous system integration method and a heterogeneous system based on an intermediate program.
[0006] (II) Technical solution
[0007] In order to achieve the above object, the main technical solutions adopted by the present invention include:
[0008] In a first aspect, an embodiment of the present invention provides a heterogeneous system integration method based on an intermediate program, wherein the heterogeneous system includes multiple clients that need to interact with each other, and the information interaction between any two clients is implemented with the help of an intermediate program, wherein the intermediate program stores information interacted between the clients; the method includes:
[0009] S10, the intermediate program receives first monitoring information sent by at least one first client, where the first monitoring information includes a channel identifier to be monitored;
[0010] S20, the intermediate program locks the processing thread corresponding to the channel identifier based on the channel identifier, and;
[0011] Receive the update information of the channel identifier sent by the second client, and add the update information to the tail of the key queue linked list to which the channel identifier belongs, and the second client periodically sends the update information corresponding to the channel identifier;
[0012] S30: The intermediate program feeds back to the first client based on the updated key queue linked list of the channel identifier, and unlocks the processing thread corresponding to the channel identifier.
[0013] Optionally, after the intermediate program in S20 locks the processing thread corresponding to the channel identifier based on the channel identifier, the process further includes:
[0014] The intermediate program receives the pruning instruction sent by the second client, and prunes the key queue linked list to which the channel identifier belongs, so that the length of the key queue linked list is within a preset length.
[0015] Optionally, the first client and the second client are respectively one of the following systems:
[0016] PID loop health management and optimization system;
[0017] APC advanced process control system;
[0018] AAS advanced alarm management system;
[0019] Direct intelligent operation navigation system.
[0020] Optionally, before S10, the method further includes:
[0021] S00. The first client interacts with the second client to obtain a channel identifier under a bit number for monitoring.
[0022] Optionally, the intermediate program in S30 feeds back to the first client based on the updated key queue linked list of the channel identifier;
[0023] The intermediate program sends the first client from the header information of the key queue linked list based on the key queue linked list identified by the channel.
[0024] Optionally, the S30 further includes:
[0025] When the intermediate program receives the instruction monitoring release information sent by the first client, it releases the lock of the processing thread corresponding to the channel identifier.
[0026] Optionally, the intermediate procedure includes:
[0027] RabbitMQ middleware or Redis middleware.
[0028] In a second aspect, an embodiment of the present invention further provides an intermediate processing device, including:
[0029] A receiving unit, configured to receive first monitoring information sent by at least one first client, wherein the first monitoring information includes an identifier of a channel to be monitored;
[0030] a locking unit, configured to lock a processing thread corresponding to the channel identifier based on the channel identifier, and;
[0031] The receiving unit is further used to receive update information of the channel identifier sent by the second client, and add the update information to the tail of the key queue linked list to which the channel identifier belongs, and the second client periodically sends the update information corresponding to the channel identifier;
[0032] A sending unit, configured to feed back to the first client based on the updated key queue linked list of the channel identifier;
[0033] The unlocking unit is used to unlock the processing thread corresponding to the channel identifier.
[0034] In a third aspect, an embodiment of the present invention further provides a heterogeneous system, which includes the intermediate processing device described in the second aspect above, and the intermediate processing device interacts with each client in the heterogeneous system.
[0035] (III) Beneficial effects
[0036] Compared with the prior art, the heterogeneous system integration method of the present invention has the following effects:
[0037] 1) Compared with the real-time database virtual number solution, the present invention is simple to develop and deploy, only requires the service of an intermediate program to meet the communication between all systems, does not require configuration, and reduces the communication pressure of the real-time database.
[0038] 2) Compared with the relational database solution in the prior art, the real-time performance of message transmission with the help of the intermediate program is high, and a single machine can support a reading speed of up to 110,000 times / s and a writing speed of up to 81,000 times / s.
[0039] 3) Compared with the custom API solution in the prior art, the protocol of the present invention is single, and this method can basically meet the communication between all systems, avoiding multiple developments. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is an architecture diagram of a heterogeneous system shown in an embodiment of the present invention;
[0041] Figures 2 to 4 All of them are flow charts of a heterogeneous system integration method based on an intermediate program provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0043] Redis is an intermediate software / program (hereinafter referred to as middleware) widely used in products in the industrial control field. It stores information / messages interacting between various systems / clients. It is a high-performance key-value database. It uses memory as the data storage medium and has extremely high efficiency in reading and writing data. Moreover, the data in Redis is persistent. The data will not be lost during power outages or restarts, which can meet the requirements of high-speed and stable data transmission scenarios in industrial sites.
[0044] The embodiment of the present invention proposes a convenient and efficient communication method that is universal in various programming languages, aiming to unify the message transmission technology between heterogeneous systems and reduce the coupling between systems, hoping to improve the stability of the overall system while reducing the development, deployment and operation and maintenance costs.
[0045] It should be noted that in this embodiment, the transmission of messages / instructions can be implemented by directional transmission or broadcast. Of course, one-way information transmission between systems can also be called broadcast. If multiple systems send the following XREAD block to monitor the same queue, one-to-many broadcast can be implemented.
[0046] In this embodiment, the heterogeneous system includes multiple clients that need to exchange information. The information exchange between any two clients is realized with the help of an intermediate program, and the intermediate program stores the information exchanged between the various clients. Specifically, Figure 1 The architecture diagram of the heterogeneous system of the present invention is shown in Figure 1 The PID loop health management and optimization system, APC advanced process control system, AAS advanced alarm management system, Direct intelligent operation navigation system and Redis intermediate program are shown in the figure. With the help of the Redis intermediate program, the communication method between various systems is unified. The whole structure is simple and does not require configuration, and there is no need to create a database and table structure. The data transmission has the advantages of high real-time and high reliability.
[0047] The middleware / middleware in the following method are all Redis middleware / middleware. Of course, in other embodiments, the middleware may also be a Rabbitmq middleware. This embodiment is only for illustration and is selected according to actual needs.
[0048] like Figure 2 As shown, this embodiment provides a heterogeneous system integration method based on an intermediate program. The method of this embodiment may include the following steps:
[0049] S10, the intermediate program receives first monitoring information sent by at least one first client, where the first monitoring information includes a channel identifier to be monitored;
[0050] S20, the intermediate program locks the processing thread corresponding to the channel identifier based on the channel identifier, and receives update information of the channel identifier sent by the second client, and adds the update information to the tail of the key queue linked list to which the channel identifier belongs, and the second client periodically sends the update information corresponding to the channel identifier;
[0051] At this time, the intermediate program also receives the pruning instruction sent by the second client, and prunes the key queue linked list to which the channel identifier belongs, so that the length of the key queue linked list is within a preset length.
[0052] S30: The intermediate program feeds back to the first client based on the updated key queue linked list of the channel identifier, and unlocks the processing thread corresponding to the channel identifier.
[0053] For example, the intermediate program sends the header information of the key queue linked list based on the channel identifier to the first client, and when the intermediate program receives the instruction monitoring release information sent by the first client, it unlocks the processing thread corresponding to the channel identifier.
[0054] In addition, the first client and the second client in each of the above steps are respectively one of the following systems: a PID loop health management and optimization system;
[0055] APC advanced process control system;
[0056] AAS advanced alarm management system;
[0057] Direct intelligent operation navigation system.
[0058] The intermediate program of this embodiment is simple to develop and deploy, can meet the communication between all systems, does not require configuration, and reduces the communication pressure of the real-time database. In addition, the message transmission real-time performance of this embodiment is high, and the above method can basically meet the communication between all systems, avoiding multiple development.
[0059] like Figure 3 As shown, this implementation shows a method for broadcasting the real-time value of the bit number from the PID system to the APC system, which is applicable to the scenario of broadcasting messages and is explained by taking the bit number name UIC1175.SV as an example.
[0060] 301. APC advanced process control system (APC system for short) sends XREAD block instruction to monitor the key message of UIC1175.SV. After the intermediate program receives the XREAD block instruction, it will block the corresponding processing thread until the relevant message arrives.
[0061] It is understandable that what is blocked in this step is the processing thread of the channel in the APC system until the Redis intermediate program sends a message to the APC system.
[0062] 302. The PID loop health management and optimization system (PID system for short) sends an XTRIM instruction to trim the key of UIC1175.SV and limit the length of the key in Redis.
[0063] In this embodiment, a pre-processing pruning instruction is sent before each actual message is sent. In addition, in order to avoid the message length being too long and occupying too much memory of the Redis intermediate program, it is necessary to prune the messages in the queue, that is, pruning can be understood as reducing the messages in the queue to a specified length each time.
[0064] Furthermore, limiting the length of the key in the Redis intermediate program can be understood as: limiting the message length of each channel and queue. The limit value is determined according to the server memory configuration and the number of message channels (queues) to avoid insufficient server memory.
[0065] 303. The PID system sends the message to the key named UIC1175.SV in the Redis intermediate program through the XADD instruction.
[0066] In this step, the PID system may periodically send an XADD instruction, for example, broadcasting and updating the bit value once every 3 seconds or one minute.
[0067] 304. The Redis middleware adds the message to the end of the key queue list of UIC1175.SV.
[0068] 305. Redis releases the monitoring of the XREAD block command sent by the APC advanced process control system (corresponding to the command blocked by the previous XREAD block), and returns a message to APC from the head of the linked list, completing a message broadcast process.
[0069] The method of this embodiment utilizes the message queue of the Redis intermediate program for industrial control software integration, which can solve the shortcomings of the existing system integration methods in the industrial software field. In this embodiment, the existing Redis basic components are used to unify the communication methods between various systems; the entire system structure is simple and does not require configuration, and there is no need to create a database and table structure; data transmission has the advantages of high real-time and high reliability.
[0070] Embodiment 2
[0071] like Figure 4As shown, this embodiment provides a heterogeneous system integration method based on an intermediate program, specifically a method in which an APC system sends a request to a PID system to obtain the bit number information of the PID system, which is suitable for scenarios where messages are actively pulled: for example, with the help of an intermediate program, the APC system first sends a bit number request (that is, sends a request message for which bit number information needs to be obtained, such as the following XREAD block instruction), and after receiving the request, the PID system sends the bit number information to the APC with the help of the intermediate program.
[0072] 401. The APC system sends an XREAD block command to monitor the key with the channel name of 2 (ie, the XREAD block command carries the channel name 2), and the PID system sends an XREAD block command to monitor the key with the channel name of 1. Both commands will be blocked until the message arrives.
[0073] 402. The APC system sends an XTRIM instruction to trim the key with channel name 1, limiting the length of the key in the Redis intermediate program.
[0074] It should be noted that after sending the XREAD block instruction, a trim instruction, namely the XTRIM instruction, needs to be sent.
[0075] 403. The APC system sends the message by using the XADD instruction to the key with the channel name 1 in the Redis intermediate program.
[0076] 404. The Redis intermediate program adds the message to the end of the key queue linked list with channel name 1.
[0077] 405. The Redis intermediate program releases the monitoring of the key instruction whose monitoring channel name is 1 and sends the XREAD block to the PID system, and returns a message to the PID system from the head of the key queue linked list.
[0078] 406. After receiving the reply message from the Redis intermediate program, the PID system processes and uses the relevant information.
[0079] 407. The PID system first sends an XTRIM instruction to trim the key with channel name 2, limiting the length of the key in the key queue linked list in the Redis intermediate program.
[0080] In this embodiment, each message is trimmed before being sent, and the purpose of trimming is to limit the length.
[0081] 408. The PID system sends the bit number (which may be a message carrying the bit number information) to the key of the Redis intermediate program channel name 2 through the XADD instruction.
[0082] 409. The Redis intermediate program adds the message to the end of the key queue linked list with the channel name 2.
[0083] 410. The Redis intermediate program releases the key instruction monitoring of the monitoring channel name 2 of the XREAD block sent by the APC system, and returns a message to the APC system from the head of the key queue linked list, completing this message return.
[0084] This embodiment uses the mature, stable, high-performance, and easy-to-deploy features of the Redis intermediate program to integrate various systems, and adopts the stream data structure as a unified message transmission channel, avoiding the difficulties of traditional real-time database virtual number, relational database, custom API and other solutions, such as the need for repeated configuration, the need to create database tables, and complex interface protocols.
[0085] In addition, an embodiment of the present invention further provides an intermediate processing device, which includes: a receiving unit, a locking unit, a sending unit and an unlocking unit;
[0086] The receiving unit is used to receive first monitoring information sent by at least one first client, where the first monitoring information includes a channel identifier to be monitored;
[0087] a locking unit, configured to lock a processing thread corresponding to the channel identifier based on the channel identifier, and;
[0088] The receiving unit is further used to receive update information of the channel identifier sent by the second client, and add the update information to the tail of the key queue linked list to which the channel identifier belongs, and the second client periodically sends the update information corresponding to the channel identifier;
[0089] A sending unit, configured to feed back to the first client based on the updated key queue linked list of the channel identifier;
[0090] The unlocking unit is used to unlock the processing thread corresponding to the channel identifier.
[0091] In addition, the above Figure 1 The heterogeneous system may include an intermediate processing device at the location, which interacts with each client in the heterogeneous system.
[0092] It should be noted that in the claims, any reference numerals placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In the claims enumerating several means, several of these means may be embodied by the same hardware. The use of the words first, second, third, etc., is for convenience of expression only and does not indicate any order. These words may be understood as part of the component name.
[0093] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0094] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments after knowing the basic creative concept. Therefore, the claims should be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
[0095] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention should also include these modifications and variations.
Claims
1. A heterogeneous system integration method based on an intermediate program, characterized in that, the heterogeneous system includes multiple clients that need to interact information, and the information interaction between any two clients is realized by means of an intermediate program, and the information interacted between each client is stored in the intermediate program; the method includes: S10. The intermediate program receives first monitoring information sent by at least one first client, and the first monitoring information includes a channel identifier to be monitored; S20. The intermediate program locks a processing thread corresponding to the channel identifier based on the channel identifier, and; receives update information of the channel identifier sent by a second client, and adds the update information to the tail of the key queue linked list to which the channel identifier belongs, and the second client periodically sends the update information corresponding to the channel identifier; S30. The intermediate program feeds back to the first client based on the updated key queue linked list of the channel identifier, and unlocks the processing thread corresponding to the channel identifier.
2. The heterogeneous system integration method according to claim 1, characterized in that, after the intermediate program in S20 locks the processing thread corresponding to the channel identifier based on the channel identifier, it further includes: the intermediate program receives a pruning instruction sent by the second client, and prunes the key queue linked list to which the channel identifier belongs, so that the length of the key queue linked list is within a preset length.
3. The heterogeneous system integration method according to claim 1, characterized in that, The first client and the second client are respectively one of the following systems: PID loop health management and optimization system; APC advanced process control system; AAS advanced alarm management system; Direct intelligent operation navigation system.
4. The heterogeneous system integration method according to claim 1, characterized in that, before S10, the method further includes: S00. The first client interacts with the second client to obtain a channel identifier under the tag number for monitoring.
5. The heterogeneous system integration method according to any one of claims 1 to 4, characterized in that, the intermediate program in S30 feeds back to the first client based on the updated key queue linked list of the channel identifier; the intermediate program sends to the first client from the header information of the key queue linked list based on the key queue linked list of the channel identifier.
6. The heterogeneous system integration method according to claim 1, characterized in that, S30 further includes: when the intermediate program receives instruction monitoring cancellation information sent by the first client, it unlocks the processing thread corresponding to the channel identifier.
7. The heterogeneous system integration method according to any one of claims 1 to 6, characterized in that, the intermediate program includes: rabbitmq intermediate program or Redis intermediate program.
8. An intermediate processing device, characterized in that, includes: a receiving unit, configured to receive first monitoring information sent by at least one first client, and the first monitoring information includes a channel identifier to be monitored; a locking unit, configured to lock a processing thread corresponding to the channel identifier based on the channel identifier, and; The receiving unit is further used to receive update information of the channel identifier sent by the second client, and add the update information to the tail of the key queue linked list to which the channel identifier belongs, and the second client periodically sends the update information corresponding to the channel identifier; A sending unit, configured to feed back to the first client based on the updated key queue linked list of the channel identifier; The unlocking unit is used to unlock the processing thread corresponding to the channel identifier.
9. A heterogeneous system, It is characterized in that It includes the intermediate processing device as described in claim 8 above, which interacts with each client in a heterogeneous system.
Citation Information
Patent Citations
Dynamic queue forwarding method and system based on RabbitMQ and ActiveMQ and storage medium
CN111770029A
Data storage method and system
CN113722390A