Detailed description of the invention
At present, under development environment, sometimes multiple projects are researched and developed parallel, if the plurality of project is required for the system that amendment is identical, for instance, each project is required for amendment system A and system B, if being transmit message by middleware between system A and system B, then when system A and system B is modified by multiple projects respectively, still adopt former middleware to carry out message transmission, can there is the problem that message mistake is thrown. Concrete scene is as follows:
As shown in fig. 1, system A distributed type assemblies (hereinafter referred to as system A) and system B distributed type assemblies (hereinafter referred to as system B) are modified by three parallel development projects respectively, wherein, the server that the first development project uses is: the server 1 of system A side and the server 4 of system B side; System A is modified by this first development project, as, system A original function basis increases function a and obtains system A#1, for making the server 4 of the system B side of same project be capable of identify that this function a, server 1 is needed to send message to server 4, to revise the system B run on server 4 so that it is increase the function a ' corresponding with function a, thus obtaining may identify which the system B#1 of system A#1. Or when system A#1 and system B#1 is tested, server 1 is also required to send message to server 4.
The server that second development project uses is: the server 2 of system A side and the server 5 of system B side; This second development project increases function b on system A original function basis and obtains system A#2, for making the server 5 of the system B side of same project be capable of identify that this function, server 2 is needed to send message to server 5, to revise the system B run on server 5, it is made to increase the function b ' corresponding with function b, thus obtaining may identify which the system B#2 of system A#2. Or when system A#2 and system B#2 is tested, server 2 is also required to send message to server 5.
The server that 3rd development project uses is: the server 3 of system A side and the server 6 of system B side; 3rd development project increases function c on system A original function basis and obtains system A#3, for making the server 6 of the system B side of same project be capable of identify that this function, server 3 is needed to send message to server 6, to revise the system B run on server 6, it is made to increase the function c ' corresponding with function c, thus obtaining may identify which the system B#3 of system A#3. Or when system A#3 and system B#3 is tested, server 3 is also required to send message to server 6.
Owing to above three project is researched and developed parallel, when the server 1 of the first development project sends message 1 to server 4, the server 2 of the second development project sends message 2 to server 5, and the 3rd the server 3 of development project send message 3 to server 6, this message 1, message 2 and message 3 arrive first at middleware, message 1 is likely delivered to server 5 according to the random release manner of existing message by middleware, message 2 is delivered to server 6, message 3 is delivered to server 4, therefore, occur that message mistake is thrown.
Above-mentioned middleware occurs that the reason that message mistake is thrown is in that, middleware be not aware that with sender's equipment (namely above-mentioned server 1, server 2, server 3) corresponding receiver equipment (namely above-mentioned server 4, server 5, server 6), namely do not know in two end systems, which equipment has association. Therefore, the embodiment of the present application is under this scene, set up the association between sender's equipment and corresponding receiver equipment, i.e. project of setting up packet described in example below, middleware can recognize the receiver equipment corresponding with sender's equipment by this association, therefore, the phenomenon generation that message mistake is thrown can be prevented effectively from.
For making the purpose of the application, technical scheme and advantage clearly, below in conjunction with the application specific embodiment and corresponding accompanying drawing, technical scheme is clearly and completely described. Obviously, described embodiment is only some embodiments of the present application, rather than whole embodiments. Based on the embodiment in the application, the every other embodiment that those of ordinary skill in the art obtain under not making creative work premise, broadly fall into the scope of the application protection.
Below in conjunction with accompanying drawing, describe the technical scheme that each embodiment of the application provides in detail.
The embodiment of the present application provides a kind of method for message transmission, is applied to research and develop parallel test environment, as shown in Figure 2, for described method for message transmission operational flowchart, specifically includes following steps:
The message that S200, reception sender's equipment send.
S210, the message sent according to reception sender's equipment, it is determined that the project packet belonging to sender's equipment, and receiver equipment corresponding with sender's equipment in project packet.
S220, the message of reception is sent to the receiver equipment determined.
For realizing the correct delivery of message, transmit the message to the recipient specified, the embodiment of the present application adopts sets up project packet, the sender's equipment and receiver equipment that belong to same project are divided in same project packet, then by identifying the project packet belonging to sender's equipment, the receiver equipment that sender's equipment is corresponding can be further determined that.
In one embodiment, the concrete methods of realizing of step S210 can as shown in Figure 3, including following sub-step 30��sub-step 32:
Sub-step 30, according to project grouping information table, it is determined that receive the project group character that unique mark of the equipment that sends comprised in the Messages Message that sender's equipment sends is corresponding;
Project grouping information preserved by the embodiment of the present application project grouping information table, this project grouping information comprises: project group character, unique mark of sender's equipment and uniquely identifying of receiver equipment.
Sub-step 31, from project grouping information table, it is determined that to pass through the memory module performing the project group character determined of sub-step 30 as query key.
Sub-step 32, determine unique mark of the receiver equipment preserved in memory module.
Project grouping information table comprises in the project grouping information of preservation: unique mark of sender's equipment and uniquely identifying of receiver equipment in the packet of project group names, project. Therefore, in sub-step 31, it is possible to according to the project group character memory module as query key. Wherein, described memory module is to utilize the form of key-value pair carries out storing and index, and shown in the example in sub-step 30, key is " network payment project ", and value is " 10.209.64.123,10.209.64.125 ". The embodiment of the present application is searched the purpose of the project packet belonging to sender's equipment and is in that: know this receiver equipment corresponding to sender's equipment, owing to project grouping information comprising unique mark of receiver equipment, therefore, find the packet of the project belonging to sender's equipment and namely know the receiver equipment of message simultaneously, specifically, namely sub-step 32 has known the IP address of receiver equipment, MAC Address or domain name.
It addition, the embodiment of the present application supports default packet, comprising one group of common equipment in this default packet, each system provides at least one common equipment, the common equipment that respectively mutual two systems of one group of common equipment comprising in this default packet provide. The project packet of correspondence is not had at sender's equipment, namely according to unique identifier lookup of sender's equipment less than in corresponding project packet situation, then it is believed that this sender's equipment belongs to default packet, the common equipment message that sender's equipment sends is sent in default packet peer-to-peer system providing.
In one embodiment, the acquisition methods of above-mentioned project grouping information table include following any one:
Method one: obtain the project grouping information table of local cache;
It is, have under described project grouping information expression condition at middleware local cache, preferentially obtain described project grouping information table from local cache. Wherein, the project grouping information table of this local cache can obtain from project system for managing in groups.
No matter it should be noted which kind of mode is middleware equipment adopt obtain project grouping information table from project system for managing in groups, all need to keep local cache Tong Bu with the project grouping information table preserved in project system for managing in groups. Keep synchronize method include following any one:
Middleware obtains project grouping information table buffer memory in real time to project system for managing in groups; In this kind of method, middleware adopts the mode of active obtaining, can obtain project grouping information report to project system for managing in groups in real time; Or
Middleware receives the dynamic-change information of the project grouping information table that project system for managing in groups sends in real time, and according to described dynamic-change information, updates the project grouping information table of local cache. In this kind of method, project system for managing in groups adopts the mode pushed, when project grouping information table occurrence dynamics changes, in real time by the dynamic-change information active push of project grouping information table to middleware, in order to middleware updates the project grouping information table of local cache according to this dynamic-change information.
It addition, the project system for managing in groups described in the embodiment of the present application, it is independently of the system of middleware, for preserving the project grouping information of projects. This project system for managing in groups can the invalid project grouping information of periodic cleaning, described invalid project grouping information such as, the project grouping information that corresponding project is over, or set up duration project grouping information exceeding regulation duration etc.
Method two: obtain project grouping information table from project system for managing in groups.
The method two is under the local uncached described project grouping information expression condition of middleware, obtains described project grouping information table from project system for managing in groups.
Project grouping information table described in the embodiment of the present application is used for preserving project grouping information, and each project can set up the project grouping information of correspondence in project system for managing in groups. Described project grouping information at least includes: unique mark of sender's equipment and uniquely identifying of the receiver equipment corresponding with described sender's equipment in the packet of project group names, project. Described unique mark includes but not limited to: IP (InternetProtocol, the Internet protocol) address of equipment, MAC (MediumMediaAccessControl, medium access control) address or equipment domain name.
In project grouping information table described in the embodiment of the present application, also include the information Expiration Date, in each project is grouped, set an Expiration Date. When according to the Expiration Date, it is determined that after going out project packet inefficacy, it is possible to delete corresponding project grouping information from project grouping information table.
Sender's equipment and receiver equipment described in the embodiment of the present application are comparatively speaking, namely, the at least two equipment in two systems involved by a project, its any appliance may act as sender's equipment of a piece of news, again can as the receiver equipment of another a piece of news. Therefore, the equipment that sender's equipment described herein or receiver equipment are not limited in project in a system.
The example that the embodiment of the present application sets up project packet is as follows:
For a network payment project, its two involved systems are system A and system B, set up a project packet for this project, and its project group names can be defined as " network payment project ", and project grouping information described in a kind of embodiment is as follows:
Project group names: network payment project
The IP address of sender's equipment: 10.209.64.123;
The IP address of receiver equipment: 10.209.64.125;
Project grouping information described in another kind of embodiment is as follows:
Project group names: network payment project;
Sender's equipment domain name and receiver equipment domain name.
In the embodiment of the present application, step S220, the described message received is sent to described receiver equipment, i.e. according to the IP address of the receiver equipment known in above-mentioned steps S210, MAC Address or domain name, the message of reception is sent to receiver equipment.
Method for message transmission described in the embodiment of the present application, by project packet, the sender's equipment involved by each project and receiver equipment are associated, in message transmitting procedure, may insure that message accurate delivery is to the receiver equipment specified according to this association, reach to develop between project the isolation effect of test, effectively prevent the phenomenon that message mistake is thrown.
It addition, the embodiment of the present application does not need the system (system A and system B) in above-mentioned scene involved by development project is modified, therefore, the enforcement of the embodiment of the present application, to operation system unaware, does not affect the properly functioning of operation system.
Meanwhile, the existing machine of the embodiment of the present application at utmost multiplexing, it is not necessary to for each project configuration middleware and project system for managing in groups.
The embodiment of the present application can be performed by the equipment as middleware, it is also possible to is performed by as the third party software installed on the equipment of middleware.
It should be noted that the executive agent of each step of the provided method of above-described embodiment may each be same equipment, or, the method also can by distinct device as executive agent.
For being further appreciated by the method for message transmission described in the embodiment of the present application, with instantiation, method for message transmission is described in detail below, in this example, system A is payment system paycore, system B is transaction system tradecore, for ensureing the reliable communication between payment system paycore and transaction system tradecore, middleware is adopted to carry out message dilivery between payment system paycore and transaction system tradecore. Project one is the project that Zhang San develops, and project two is the project that Li Si develops, and project three is the project of king five exploitation. These three project, is required for using paycore system and tradecore system, and three projects are all applied for corresponding server, and deploys oneself code on the server to prepare corresponding test. Such as, paycore system server 1 and tradecore system server 2 have been arrived in project one application of Zhang San, paycore system server 3 and tradecore system server 4 have been arrived in project two application of Li Si, and paycore system server 5 and tradecore system server 6 have been arrived in project three application of king five. Zhang San is after application to server, can in project system for managing in groups sofarouter, configure a project packet, name is called " XXX project ", in the packet of this project, the IP address of paycore system server 1 is that " the IP address of 10.209.64.123, tradecore system server 2 is 10.209.64.125. Zhang San is after finished item configures, and middleware can receive the project grouping information that this is up-to-date, same Li Si and king five in time can also set up the project grouping information of respective project at this project system for managing in groups. So, it follows that middleware is when delivering, concrete processing method is as follows:
Paycore system server 1 sends a piece of news, wish to send to the tradecore system server 2 on same project, message arrives first at middleware, now middleware transfers project grouping information table, travel through this project grouping information table, find that the IP address 10.209.64.123 of the paycore system server 1 of this message of transmission is belonging to " XXX project " project of Zhang San, opposite equip. in " XXX project " project of being somebody's turn to do is tradecore system server 2, its IP address is 10.209.64.125, then by this message dilivery to tradecore system server 2.
Assume, Li Si is not the packet of its item setup project, then when paycore system server 3 sends a piece of news, after message arrives middleware, after middleware has traveled through all items grouping information table, find that server 3 does not have the project packet of correspondence, then this middleware thinks that this server 3 belongs to default packet, the public server being sent in default packet by the message that this server 3 sends tradecore system and providing.
Based on the thinking that method for message transmission described in above example is same, the embodiment of the present application also provides for a kind of massage transmission device, it is applied to sender's equipment and message is transferred to the scene of intended receiver equipment, as shown in Figure 4, for described apparatus structure schematic diagram, this device specifically includes that reception unit 400, recognition unit 410 and transmitting element 420.
Wherein, receive unit 400, for receiving the message that sender's equipment sends;
Recognition unit 410, it is possible to for according to project grouping information table, it is determined that from the project group character that the unique mark receiving the equipment that sends comprised the message that unit 400 receives is corresponding; From project grouping information table, it is determined that using project group character as the memory module of query key; Determine unique mark of the receiver equipment preserved in memory module.
Described recognition unit 410 obtains the method for project grouping information table with described in above example, for instance including: obtain the project grouping information table of local cache; Or obtain project grouping information table from project system for managing in groups. Project grouping information table described in the embodiment of the present application is used for preserving project grouping information, and each project can set up the project grouping information of correspondence in project system for managing in groups. Described project grouping information at least includes: unique mark of sender's equipment and uniquely identifying of receiver equipment in the packet of project group names, project. Described unique mark includes but not limited to: the IP address of equipment, MAC Address or equipment domain name.
The method of described recognition unit 410 memory module is with described in above example.
Described recognition unit 410 can be also used for: according to the information Expiration Date, deletes the information of inefficacy from described project table.
Transmitting element 420 described in the embodiment of the present application, are mainly used in the described message received is sent to described receiver equipment.
Described in the embodiment of the present application, device may also include that
Lock unit 430, for project grouping information table and the project grouping information table of preservation in project system for managing in groups of real-time synchronization local cache. Described lock unit 430 specifically for:
Project grouping information table buffer memory is obtained in real time to project system for managing in groups; Or
The dynamic-change information of the project grouping information table that reception project system for managing in groups sends in real time, and according to described dynamic-change information, update the project grouping information table of local cache.
In sum, the method for message transmission of the embodiment of the present application offer and device, receiving the message that sender's equipment sends, identify the project packet belonging to described sender's equipment, and in the packet of described project after the receiver equipment corresponding with described sender's equipment, the described message received is sent to described receiver equipment. In said method, by project packet, the sender's equipment involved by each project and receiver equipment are associated, in message transmitting procedure, may insure that message accurate delivery is to the receiver equipment specified according to this association, reach to develop between project the isolation effect of test, effectively prevent the phenomenon that message mistake is thrown.
It addition, the existing equipment of the embodiment of the present application at utmost multiplexing, it is not necessary to middleware and project system for managing in groups is individually configured for each project. And the embodiment of the present application for the system involved by project and devices in system without changing, accomplish operation system unaware, it is ensured that avoid message mistake to throw under changing less situation.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program. Therefore, the present invention can adopt the form of complete hardware embodiment, complete software implementation or the embodiment in conjunction with software and hardware aspect. And, the present invention can adopt the form at one or more upper computer programs implemented of computer-usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.) wherein including computer usable program code.
The present invention is that flow chart and/or block diagram with reference to method according to embodiments of the present invention, equipment (system) and computer program describe. It should be understood that can by the combination of the flow process in each flow process in computer program instructions flowchart and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame. These computer program instructions can be provided to produce a machine to the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device so that the instruction performed by the processor of computer or other programmable data processing device is produced for realizing the device of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and can guide in the computer-readable memory that computer or other programmable data processing device work in a specific way, the instruction making to be stored in this computer-readable memory produces to include the manufacture of command device, and this command device realizes the function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices provides for realizing the step of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
In a typical configuration, computing equipment includes one or more processor (CPU), input/output interface, network interface and internal memory.
Internal memory potentially includes the forms such as the volatile memory in computer-readable medium, random access memory (RAM) and/or Nonvolatile memory, such as read only memory (ROM) or flash memory (flashRAM). Internal memory is the example of computer-readable medium.
Computer-readable medium includes permanent and impermanency, removable and non-removable media can by any method or technology to realize information storage. information can be computer-readable instruction, data structure, the module of program or other data. the example of the storage medium of computer includes, but it is not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read only memory (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus or any other non-transmission medium, can be used for the information that storage can be accessed by a computing device. according to defining herein, computer-readable medium does not include temporary computer readable media (transitorymedia), such as data signal and the carrier wave of modulation.
It can further be stated that, term " includes ", " comprising " or its any other variant are intended to comprising of nonexcludability, so that include the process of a series of key element, method, commodity or equipment not only include those key elements, but also include other key elements being not expressly set out, or also include the key element intrinsic for this process, method, commodity or equipment. When there is no more restriction, statement " including ... " key element limited, it is not excluded that there is also other identical element in including the process of described key element, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program. Therefore, the application can adopt the form of complete hardware embodiment, complete software implementation or the embodiment in conjunction with software and hardware aspect. And, the application can adopt the form at one or more upper computer programs implemented of computer-usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.) wherein including computer usable program code.
The foregoing is only embodiments herein, be not limited to the application. To those skilled in the art, the application can have various modifications and variations. All make within spirit herein and principle any amendment, equivalent replacement, improvement etc., should be included within claims hereof scope.