CN103701830B - A kind of data that realize process and mutual method and system - Google Patents

A kind of data that realize process and mutual method and system Download PDF

Info

Publication number
CN103701830B
CN103701830B CN201410014386.1A CN201410014386A CN103701830B CN 103701830 B CN103701830 B CN 103701830B CN 201410014386 A CN201410014386 A CN 201410014386A CN 103701830 B CN103701830 B CN 103701830B
Authority
CN
China
Prior art keywords
command
chained list
packet
thread
bag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410014386.1A
Other languages
Chinese (zh)
Other versions
CN103701830A (en
Inventor
张在理
王倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baoding Inspur Cloud Computing Co ltd
Original Assignee
Inspur Beijing Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201410014386.1A priority Critical patent/CN103701830B/en
Publication of CN103701830A publication Critical patent/CN103701830A/en
Application granted granted Critical
Publication of CN103701830B publication Critical patent/CN103701830B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of data that realize to process and mutual method, it is applied to client, including: command process thread takes out request command from newly requested order chained list and insertion is just processing in order chained list, described request command is split, the packet split into is inserted and sends in bag chained list;Transmission thread takes out packet from described transmission bag chained list and is transmitted;Receiving thread such as receives the packet from service end, then inserted by packet and receive in bag chained list;Processing data packets thread judges whether the packet received in bag chained list can be assembled into complete response command, it is to take out packet and assemble, insert assembling complete response command in response command chained list, and according to this response command, the corresponding requests order just processed in order chained list is deleted;Wherein, described transmission thread and receiving thread are multiple, and each thread parallel performs.The present invention can improve the bandwidth utilization rate of physical connection and optimize the number that logic connects.

Description

A kind of data that realize process and mutual method and system
Technical field
The present invention relates to computer communication technology field, in particular one realizes data process and hands over Mutual method and system.
Background technology
In currently stored framework, between node, node and client, the data such as node and storage end It is indispensable alternately.The implementation of data interaction is also had nothing in common with each other, but mostly use client- Server mode.
When generally node needs other node to process data, it is all by two joints by single thread Connection between point is sent to opposite end and goes to process, and this locality during processing data, opposite end needs to wait that opposite end processes The return of result.During opposite end processes, two internodal connections are in idle condition, it is impossible to effectively Utilize Internet resources, local process thread is also at wait state.Process thread and send request life The return result to be received such as after order, it is long that the time length of wait depends on that opposite end performs time of command request The short speed with transceiving data, if the time that opposite end processes data is long, those local needs wait Time is the most long.Therefore, when a physical connection is set up single logic connection, for single Logic connection carries out data receiver and sends the bandwidth being typically not capable of physical connection, it is impossible to effectively utilize two The individual internodal network bandwidth.
But, if although each the request of opposite end uses one process thread processes can be bright The aobvious utilization rate improving physical connection and the processing speed of data, thus improve local data treatment effeciency, But ever-increasing Thread Count can be difficult to control to.
Summary of the invention
The technical problem to be solved be to provide a kind of realize data process and mutual method and System, it is possible to increase the bandwidth utilization rate of physical connection and optimize the number that logic connects.
In order to solve above-mentioned technical problem, the invention provides a kind of data that realize and process and mutual side Method, is applied to client, including:
Command process thread takes out request command from newly requested order chained list and insertion is just processing command chaining In table, described request command is split, the one or more packets split into are inserted and sends bag In chained list;
Transmission thread takes out packet from described transmission bag chained list and is transmitted;
Receiving thread such as receives the packet from service end, then inserted by packet and receive bag chained list In;
Processing data packets thread judges to receive whether the packet in bag chained list can be assembled into one completely Response command, be to take out packet and assemble, insert response life by assembling complete response command Make in chained list, and according to this response command, the corresponding requests order just processed in order chained list is deleted;
Wherein, described transmission thread and receiving thread are multiple;Each thread parallel performs.
Further, the method also includes following feature:
Described transmission bag chained list is multiple with receiving bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
The one or more packets split into are inserted and send in bag chained list by command process thread, including: Command process thread selects a shortest transmission bag chained list of length from multiple transmission bag chained lists, will split The one or more packets become insert this table tail sending bag chained list selected.
Further, the method also includes following feature:
Described request command is split by command process thread, including: command process thread is according to presetting Single transmission bag maximum length, request command is split into one or more packet;Wherein, often Individual packet carries the command id of this request command, the sequence number of notebook data bag and this request command altogether The total number of packet split into;
Processing data packets thread judges to receive whether the packet in bag chained list can be assembled into one completely Response command, be to take out packet and assemble, judge to receive bag including: processing data packets thread The packet whether number of the packet in chained list with same command id splits into equal to this order Total number, be from described reception bag chained list, to take out described packet assemble;Wherein, each The packet received carries the command id of this response command, the sequence number of notebook data bag and this response life The total number of packet that order splits into altogether;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
Further, the method also includes following feature:
Other nodes will be asked to insert the table tail of described newly requested order chained list by worker thread;
Worker thread inquires about described response command chained list, as found the response command corresponding with request command, Then from described response command chained list, take out this response command, carry out resolving and obtaining response results.
Further, the method also includes following feature:
Time-out scanning thread periodic scan is just processing the order in order chained list, as certain order exceedes pre- Fix time and be not the most deleted, then this order is taken out and reinsert in described newly requested order chained list.
In order to solve above-mentioned technical problem, present invention also offers a kind of data that realize and process and mutual side Method, is applied to service end, including:
Receiving thread such as receives the packet from client, then inserted by packet and receive bag chained list In;
Processing data packets thread judge to receive in bag chained list to packet whether can be assembled into one complete Whole request command, is to take out described packet and assemble, and inserts assembling complete request command In newly requested order chained list;
Worker thread takes out request command from described newly requested order chained list and processes, after being disposed Generate response command, insert in response command chained list;
Command process thread takes out response command from described response command chained list and splits, and will split into One or more packets insert and send in bag chained list;
Transmission thread takes out packet from described transmission bag chained list and is transmitted;
Wherein, described transmission thread, receiving thread, worker thread are multiple;Each thread parallel performs.
Further, the method also includes following feature:
Described reception bag chained list is multiple with sending bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
The one or more packets split into are inserted and send in bag chained list by command process thread, including: Command process thread selects a shortest transmission bag chained list of length from multiple transmission bag chained lists, will split The one or more packets become insert this table tail sending bag chained list selected.
Further, the method also includes following feature:
Processing data packets thread judges to receive whether the packet in bag chained list can be assembled into one completely Request command, be to take out packet and assemble, judge to receive bag including: processing data packets thread The packet whether number of the packet in chained list with same command id splits into equal to this order Total number, be from described reception bag chained list, to take out described packet assemble;Wherein, each The packet received carries the command id of this request command, the sequence number of notebook data bag and this request life The total number of packet that order splits into altogether;
Described response command is split by command process thread, including: command process thread is according to presetting Single transmission bag maximum length, response command is split into one or more packet;Wherein, often Individual packet carries the command id of this response command, the sequence number of notebook data bag and this response command altogether The total number of packet split into;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
In order to solve above-mentioned technical problem, present invention also offers a kind of data that realize and process and mutual be System, is applied to client, including:
Command processing module, takes out request command also for command process thread from newly requested order chained list Inserting just is processing in order chained list, splits described request command, one or more by split into Packet inserts and sends in bag chained list;
Sending module, is used for sending thread and takes out packet from described transmission bag chained list and be transmitted;
Receiver module, such as receives the packet from service end, is then inserted by packet for receiving thread Enter to receive in bag chained list;
Whether processing data packets module, judge the packet in reception bag chained list for processing data packets thread A complete response command can be assembled into, be, take out packet and assemble, complete by assembling Response command inserts in response command chained list, and right by just process in order chained list according to this response command Request command is answered to delete;
Wherein, described transmission thread and receiving thread are multiple;Each thread parallel performs.
Further, this system also includes following feature:
Described transmission bag chained list is multiple with receiving bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
Command processing module, sends out the one or more packets insertion split into for command process thread Send in bag chained list, including: it is the shortest that command process thread selects a length from multiple transmission bag chained lists Send bag chained list, the one or more packets split into are inserted this table sending bag chained list selected Tail.
Further, this system also includes following feature:
Command processing module, splits described request command for command process thread, including: life Order processes the thread maximum length according to the single transmission bag preset, and request command splits into one or many Individual packet;Wherein, each packet carries the command id of this request command, the sequence of notebook data bag Number and the total number of packet that splits into altogether of this request command;
Whether processing data packets module, judge the packet in reception bag chained list for processing data packets thread A complete response command can be assembled into, be, take out packet and assemble, including: packet Process thread and whether judge to receive the number of the packet in bag chained list with same command id equal to being somebody's turn to do Total number of the packet that order splits into, is to take out described packet from described reception bag chained list and enter Row assembles;Wherein, the packet of each reception carries the command id of this response command, notebook data bag Sequence number and the total number of packet that splits into altogether of this response command;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
Further, this system also includes following feature:
This system also includes request and respond module, will insert the request of other nodes for worker thread The table tail of described newly requested order chained list;Worker thread inquires about described response command chained list, as found and this The response command that before thread, the request command of transmission is corresponding, then taking out from described response command chained list should Response command, carries out resolving and obtaining response results.
Further, this system also includes following feature:
This system also includes timeout treatment module, is just processing order for time-out scanning thread periodic scan Order in chained list, is not the most deleted as certain order exceedes the scheduled time, then this order is taken out weight In newly inserted described newly requested order chained list.
In order to solve above-mentioned technical problem, present invention also offers a kind of data that realize and process and mutual be System, is applied to service end, including:
Receiver module, such as receives the packet from client, is then inserted by packet for receiving thread Enter to receive in bag chained list;
For processing data packets thread, processing data packets module, judges that receiving the packet given in bag chained list is No can be assembled into a complete request command, be to take out described packet and assemble, will assemble Complete request command inserts in newly requested order chained list;
Request and respond module, take out request command for worker thread from described newly requested order chained list Process, generate response command after being disposed, insert in response command chained list;
Command processing module, takes out response command for command process thread from described response command chained list Split, the one or more packets split into are inserted and sends in bag chained list;
Sending module, is used for sending thread and takes out packet from described transmission bag chained list and be transmitted;
Wherein, described transmission thread, receiving thread, worker thread are multiple;Each thread parallel performs.
Further, this system also includes following feature:
Described reception bag chained list is multiple with sending bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
Command processing module, sends out the one or more packets insertion split into for command process thread Send in bag chained list, including: it is the shortest that command process thread selects a length from multiple transmission bag chained lists Send bag chained list, the one or more packets split into are inserted this table sending bag chained list selected Tail.
Further, this system also includes following feature:
Whether processing data packets module, judge the packet in reception bag chained list for processing data packets thread A complete request command can be assembled into, be, take out packet and assemble, including: packet Process thread and whether judge to receive the number of the packet in bag chained list with same command id equal to being somebody's turn to do Total number of the packet that order splits into, is to take out described packet from described reception bag chained list and enter Row assembles;Wherein, the packet of each reception carries the command id of this request command, notebook data bag Sequence number and the total number of packet that splits into altogether of this request command;
Command processing module, splits described response command for command process thread, including: life Order processes the thread maximum length according to the single transmission bag preset, and response command splits into one or many Individual packet;Wherein, each packet carries the command id of this response command, the sequence of notebook data bag Number and the total number of packet that splits into altogether of this response command;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
Compared with prior art, a kind of of present invention offer realizes data process and mutual method and is System, is performed by multiple thread parallels, and uses chained list to transmit data so that the logic between node is even The number connect can be controlled, and improves the bandwidth utilization rate of physical connection.
Accompanying drawing explanation
Fig. 1 is that a kind of data that realize of the embodiment of the present invention process and the stream of mutual method (client) Cheng Tu.
Fig. 2 is that a kind of data that realize of the embodiment of the present invention process and the stream of mutual method (service end) Cheng Tu.
Fig. 3 is that a kind of data that realize of the embodiment of the present invention process and the information interaction figure of mutual method.
Fig. 4 is that a kind of data that realize of the embodiment of the present invention process and the knot of mutual system (client) Structure schematic diagram.
Fig. 5 is that a kind of data that realize of the embodiment of the present invention process and the knot of mutual system (service end) Structure schematic diagram.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing Embodiments of the invention are described in detail.It should be noted that in the case of not conflicting, this Shen Embodiment in please and the feature in embodiment can mutually be combined.
Process and mutual method as it is shown in figure 1, embodiments provide a kind of data that realize, should For client, including:
S10, command process thread takes out request command from newly requested order chained list and insertion is just processing life Make in chained list, described request command is split, the one or more packets split into are inserted and sends out Send in bag chained list;
S20, transmission thread takes out packet from described transmission bag chained list and is transmitted;
S30, receiving thread such as receives the packet from service end, is then inserted by packet and receive bag In chained list;
S40, processing data packets thread judges whether the packet received in bag chained list can be assembled into one Complete response command, is to take out packet and assemble, inserts sound by assembling complete response command In order chained list, and according to this response command, the corresponding requests order just processed in order chained list should be deleted Remove;
Wherein, described transmission thread and receiving thread are multiple;Each thread parallel performs;
The method can also include following feature:
Preferably, described newly requested order chained list, transmission bag chained list and reception bag chained list are bidirectional circulating Chained list;
Wherein, when inserting data in double-linked circular list, it is inserted into the afterbody of described double-linked circular list, When taking out data from double-linked circular list, take out data from the gauge outfit of described double-linked circular list.
Preferably, same type of multiple thread can form thread pool;
Preferably, other nodes will be asked to insert the table of described newly requested order chained list by worker thread Tail;
Preferably, worker thread inquires about described response command chained list, as found the sound corresponding with request command Should order, then from described response command chained list, take out this response command, carry out resolving and obtain response knot Really;
Wherein, worker thread is one or more;
Preferably, command process thread takes out request command in the following ways from newly requested order chained list And insertion is just processing in order chained list: command process thread takes out from the gauge outfit of newly requested order chained list newly please Ask order and insert the table tail just processing order chained list;
Preferably, described request command is split by command process thread in the following ways: at order Request command, according to the maximum length of the single transmission packet preset, is split into one or many by reason thread Individual packet;Wherein, each packet carries the command id of this request command, the sequence of notebook data bag Number and the total number of packet that splits into altogether of this request command;
Preferably, it is multiple for sending thread, and it is multiple for sending bag chained list, and it is corresponding that each sends bag chained list One sends thread;
Preferably, the one or more packets split into are inserted and send bag chained list by command process thread In, including:
Command process thread selects a shortest transmission bag chained list of length from multiple transmission bag chained lists, will The one or more packets split into insert this table tail sending bag chained list selected;
Preferably, transmission thread takes out packet from described transmission bag chained list and is transmitted, including: send out Line sending journey is taken out packet from the corresponding gauge outfit sending bag chained list and is transmitted;
Preferably, receiving thread is multiple;It is multiple for receiving bag chained list;Receiving thread and reception bag chained list One_to_one corresponding;
Preferably processing data packets thread judges whether the packet received in bag chained list can be assembled into one The response command that bar is complete, is to take out packet and assemble, including: processing data packets thread judges Whether the number receiving the packet in bag chained list with same command id is equal to what this order split into Total number of packet, is to take out described packet from described reception bag chained list and assemble;Wherein, The packet of each reception carries the command id of this response command, the sequence number of notebook data bag and this sound The total number of the packet split into altogether should be ordered;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With;
Preferably, packet is assembled into response command by processing data packets thread, including: processing data packets The serial number information of this packet that thread carries according to each packet, will have same commands mark Data packet group dresses up response command.
Preferably, also including a time-out scanning thread, time-out scanning thread periodic scan is just processing order Order in chained list, is not the most deleted as certain order exceedes the scheduled time, then this order is taken out weight In newly inserted described newly requested order chained list.
Process and mutual method as in figure 2 it is shown, embodiments provide a kind of data that realize, should For service end, including:
S10, receiving thread such as receives the packet from client, is then inserted by packet and receive bag In chained list;
S20, processing data packets thread judge to receive in bag chained list to packet whether can be assembled into one The request command that bar is complete, is to take out described packet and assemble, and will assemble complete request command Insert in newly requested order chained list;
S30, worker thread takes out request command from described newly requested order chained list and processes, and processes After generate response command, insert in response command chained list;
S40, command process thread takes out response command from described response command chained list and splits, will The one or more packets split into insert and send in bag chained list;
S50, transmission thread takes out packet from described transmission bag chained list and is transmitted;
Wherein, described transmission thread, receiving thread, worker thread are multiple;Each thread parallel performs.
The method can also include following feature:
Preferably, same type of multiple threads composition thread pool;
Preferably, described reception bag chained list is multiple with sending bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
Preferably, described reception bag chained list, transmission bag chained list, newly requested order chained list, response command chain Table is double-linked circular list;
Wherein, when inserting data in double-linked circular list, it is inserted into the afterbody of described double-linked circular list, When taking out data from double-linked circular list, take out data from the gauge outfit of described double-linked circular list.
Preferably, the one or more packets split into are inserted and send bag chained list by command process thread In, including: command process thread selects a shortest transmission bag chain of length from multiple transmission bag chained lists The one or more packets split into are inserted this table tail sending bag chained list selected by table.
Preferably, packet is inserted and receives in bag chained list by arbitrary receiving thread, including: arbitrary reception line Packet is inserted the table tail receiving bag chained list by journey;
Preferably, processing data packets thread judges whether the packet received in bag chained list can be assembled into one The request command that bar is complete, is to take out packet and assemble, including: processing data packets thread judges Whether the number receiving the packet in bag chained list with same command id is equal to what this order split into Total number of packet, is to take out described packet from described reception bag chained list and assemble;Wherein, The packet of each reception carries the command id of this request command, the sequence number of notebook data bag and should ask The total number of packet asking order to split into altogether;
Described response command is split by command process thread, including: command process thread is according to presetting Single transmission bag maximum length, response command is split into one or more packet;Wherein, often Individual packet carries the command id of this response command, the sequence number of notebook data bag and this response command altogether The total number of packet split into;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
Preferably, packet is assembled into request command by processing data packets thread, including: processing data packets The serial number information of this packet that thread carries according to each packet, will have same commands mark Data packet group dresses up request command.
Fig. 3 shows the node as client and as the mutual mistake of the information between the node of service end Journey.
As shown in Figure 4, embodiments provide a kind of data that realize and process and mutual system, should For client, including:
Command processing module, takes out request command also for command process thread from newly requested order chained list Inserting just is processing in order chained list, splits described request command, one or more by split into Packet inserts and sends in bag chained list;
Sending module, is used for sending thread and takes out packet from described transmission bag chained list and be transmitted;
Receiver module, such as receives the packet from service end, is then inserted by packet for receiving thread Enter to receive in bag chained list;
Whether processing data packets module, judge the packet in reception bag chained list for processing data packets thread A complete response command can be assembled into, be, take out packet and assemble, complete by assembling Response command inserts in response command chained list, and right by just process in order chained list according to this response command Request command is answered to delete;
Wherein, described transmission thread and receiving thread are multiple;Each thread parallel performs.
This system can also include following feature:
Preferably, described transmission bag chained list is multiple with receiving bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
Command processing module, sends out the one or more packets insertion split into for command process thread Send in bag chained list, including: it is the shortest that command process thread selects a length from multiple transmission bag chained lists Send bag chained list, the one or more packets split into are inserted this table sending bag chained list selected Tail.
Preferably, command processing module, for command process thread, described request command is split, Including: request command, according to the maximum length of the single transmission bag preset, is split into by command process thread One or more packets;Wherein, each packet carries the command id of this request command, this number The total number of packet split into altogether according to sequence number and this request command of bag;
Whether processing data packets module, judge the packet in reception bag chained list for processing data packets thread A complete response command can be assembled into, be, take out packet and assemble, including: packet Process thread and whether judge to receive the number of the packet in bag chained list with same command id equal to being somebody's turn to do Total number of the packet that order splits into, is to take out described packet from described reception bag chained list and enter Row assembles;Wherein, the packet of each reception carries the command id of this response command, notebook data bag Sequence number and the total number of packet that splits into altogether of this response command;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
Preferably, this system also includes a request and respond module:
Request and respond module, will insert described newly requested life to the request of other nodes for worker thread Make the table tail of chained list;Worker thread inquires about described response command chained list, sends before this thread as found Response command corresponding to request command, then from described response command chained list, take out this response command, enter Row resolves and obtains response results.
Preferably, this system also includes a timeout treatment module:
Timeout treatment module, is just processing the life in order chained list for time-out scanning thread periodic scan Order, is not the most deleted as certain order exceedes the scheduled time, then this order taken out described in reinserting In newly requested order chained list.
Process and mutual system as it is shown in figure 5, embodiments provide a kind of data that realize, should For service end, including:
Receiver module, such as receives the packet from client, is then inserted by packet for receiving thread Enter to receive in bag chained list;
For processing data packets thread, processing data packets module, judges that receiving the packet given in bag chained list is No can be assembled into a complete request command, be to take out described packet and assemble, will assemble Complete request command inserts in newly requested order chained list;
Request and respond module, take out request command for worker thread from described newly requested order chained list Process, generate response command after being disposed, insert in response command chained list;
Command processing module, takes out response command for command process thread from described response command chained list Split, the one or more packets split into are inserted and sends in bag chained list;
Sending module, is used for sending thread and takes out packet from described transmission bag chained list and be transmitted;
Wherein, described transmission thread, receiving thread, worker thread are multiple;Each thread parallel performs.
This system can also include following feature:
Preferably, described reception bag chained list is multiple with sending bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
Command processing module, sends out the one or more packets insertion split into for command process thread Send in bag chained list, including: it is the shortest that command process thread selects a length from multiple transmission bag chained lists Send bag chained list, the one or more packets split into are inserted this table sending bag chained list selected Tail.
Preferably, processing data packets module, judge to receive the number in bag chained list for processing data packets thread Whether can be assembled into a complete request command according to bag, be, take out packet and assemble, including: Whether processing data packets thread judges to receive in bag chained list the number of the packet with same command id Equal to total number of the packet that this order splits into, it is to take out described number from described reception bag chained list Assemble according to bag;Wherein, the packet of each reception carries the command id of this request command, basis The total number of packet that the sequence number of packet and this request command split into altogether;
Command processing module, splits described response command for command process thread, including: life Order processes the thread maximum length according to the single transmission bag preset, and response command splits into one or many Individual packet;Wherein, each packet carries the command id of this response command, the sequence of notebook data bag Number and the total number of packet that splits into altogether of this response command;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
Preferably, described reception bag chained list, transmission bag chained list, newly requested order chained list, response command chain Table is double-linked circular list;
Wherein, when inserting data in double-linked circular list, it is inserted into the afterbody of described double-linked circular list, When taking out data from double-linked circular list, take out data from the gauge outfit of described double-linked circular list.
A kind of data that realize that above-described embodiment provides process and mutual method and system, by multiple lines Journey executed in parallel, and use chained list to transmit data so that the number that the logic between node connects can be hard to bear Control, and improve the bandwidth utilization rate of physical connection.
One of ordinary skill in the art will appreciate that all or part of step in said method can pass through journey Sequence instructs related hardware and completes, and described program can be stored in computer-readable recording medium, as only Read memory, disk or CD etc..Alternatively, all or part of step of above-described embodiment can also make Realizing with one or more integrated circuits, correspondingly, each module/unit in above-described embodiment can be adopted Realize by the form of hardware, it would however also be possible to employ the form of software function module realizes.The present invention is not restricted to The combination of the hardware and software of any particular form.
It should be noted that the present invention also can have other various embodiments, without departing substantially from the present invention spirit and In the case of its essence, those of ordinary skill in the art can make various corresponding change according to the present invention And deformation, but these change accordingly and deform the protection model that all should belong to appended claims of the invention Enclose.

Claims (16)

1. realize data to process and a mutual method, be applied to client, including:
Command process thread takes out request command from newly requested order chained list and insertion is just processing command chaining In table, described request command is split, the one or more packets split into are inserted and sends bag In chained list;
Transmission thread takes out packet from described transmission bag chained list and is transmitted;
Receiving thread such as receives the packet from service end, then inserted by packet and receive bag chained list In;
Processing data packets thread judges to receive whether the packet in bag chained list can be assembled into one completely Response command, be to take out packet and assemble, insert response life by assembling complete response command Make in chained list, and according to this response command, the corresponding requests order just processed in order chained list is deleted;
Wherein, described transmission thread and receiving thread are multiple;Each thread parallel performs.
2. the method for claim 1, it is characterised in that:
Described transmission bag chained list is multiple with receiving bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
The one or more packets split into are inserted and send in bag chained list by command process thread, including: Command process thread selects a shortest transmission bag chained list of length from multiple transmission bag chained lists, will split The one or more packets become insert the table tail sending bag chained list that described length is the shortest.
3. the method for claim 1, it is characterised in that:
Described request command is split by command process thread, including: command process thread is according to presetting Single transmission bag maximum length, request command is split into one or more packet;Wherein, often Individual packet carries the command id of this request command, the sequence number of notebook data bag and this request command altogether The total number of packet split into;
Processing data packets thread judges to receive whether the packet in bag chained list can be assembled into one completely Response command, be to take out packet and assemble, judge to receive bag including: processing data packets thread The packet whether number of the packet in chained list with same command id splits into equal to this order Total number, be from described reception bag chained list, to take out described packet assemble;Wherein, each The packet received carries the command id of this response command, the sequence number of notebook data bag and this response life The total number of packet that order splits into altogether;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
4. the method for claim 1, it is characterised in that also include:
Other nodes will be asked to insert the table tail of described newly requested order chained list by worker thread;
Worker thread inquires about described response command chained list, as found the response command corresponding with request command, Then from described response command chained list, take out this response command, carry out resolving and obtaining response results.
5. the method for claim 1, it is characterised in that also include:
Time-out scanning thread periodic scan is just processing the order in order chained list, as certain order exceedes pre- Fix time and be not the most deleted, then this order is taken out and reinsert in described newly requested order chained list.
6. realize data to process and a mutual method, be applied to service end, including:
Receiving thread such as receives the packet from client, then inserted by packet and receive bag chained list In;
Processing data packets thread judge to receive in bag chained list to packet whether can be assembled into one complete Whole request command, is to take out described packet and assemble, and inserts assembling complete request command In newly requested order chained list;
Worker thread takes out request command from described newly requested order chained list and processes, after being disposed Generate response command, insert in response command chained list;
Command process thread takes out response command from described response command chained list and splits, and will split into One or more packets insert and send in bag chained list;
Transmission thread takes out packet from described transmission bag chained list and is transmitted;
Wherein, described transmission thread, receiving thread, worker thread are multiple;Each thread parallel performs.
7. method as claimed in claim 6, it is characterised in that:
Described reception bag chained list is multiple with sending bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
The one or more packets split into are inserted and send in bag chained list by command process thread, including: Command process thread selects a shortest transmission bag chained list of length from multiple transmission bag chained lists, will split The one or more packets become insert the table tail sending bag chained list that described length is the shortest.
8. method as claimed in claim 6, it is characterised in that:
Processing data packets thread judges to receive whether the packet in bag chained list can be assembled into one completely Request command, be to take out packet and assemble, judge to receive bag including: processing data packets thread The packet whether number of the packet in chained list with same command id splits into equal to this order Total number, be from described reception bag chained list, to take out described packet assemble;Wherein, each The packet received carries the command id of this request command, the sequence number of notebook data bag and this request life The total number of packet that order splits into altogether;
Described response command is split by command process thread, including: command process thread is according to presetting Single transmission bag maximum length, response command is split into one or more packet;Wherein, often Individual packet carries the command id of this response command, the sequence number of notebook data bag and this response command altogether The total number of packet split into;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
9. realize data to process and a mutual system, be applied to client, including:
Command processing module, takes out request command also for command process thread from newly requested order chained list Inserting just is processing in order chained list, splits described request command, one or more by split into Packet inserts and sends in bag chained list;
Sending module, is used for sending thread and takes out packet from described transmission bag chained list and be transmitted;
Receiver module, such as receives the packet from service end, is then inserted by packet for receiving thread Enter to receive in bag chained list;
Whether processing data packets module, judge the packet in reception bag chained list for processing data packets thread A complete response command can be assembled into, be, take out packet and assemble, complete by assembling Response command inserts in response command chained list, and right by just process in order chained list according to this response command Request command is answered to delete;
Wherein, described transmission thread and receiving thread are multiple;Each thread parallel performs.
10. system as claimed in claim 9, it is characterised in that:
Described transmission bag chained list is multiple with receiving bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
Command processing module, sends out the one or more packets insertion split into for command process thread Send in bag chained list, including: it is the shortest that command process thread selects a length from multiple transmission bag chained lists Send bag chained list, the one or more packets split into are inserted the transmission bag chained list that described length is the shortest Table tail.
11. systems as claimed in claim 9, it is characterised in that:
Command processing module, splits described request command for command process thread, including: life Order processes the thread maximum length according to the single transmission bag preset, and request command splits into one or many Individual packet;Wherein, each packet carries the command id of this request command, the sequence of notebook data bag Number and the total number of packet that splits into altogether of this request command;
Whether processing data packets module, judge the packet in reception bag chained list for processing data packets thread A complete response command can be assembled into, be, take out packet and assemble, including: packet Process thread and whether judge to receive the number of the packet in bag chained list with same command id equal to being somebody's turn to do Total number of the packet that order splits into, is to take out described packet from described reception bag chained list and enter Row assembles;Wherein, the packet of each reception carries the command id of this response command, notebook data bag Sequence number and the total number of packet that splits into altogether of this response command;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
12. systems as claimed in claim 9, it is characterised in that also include:
Request and respond module, will insert described newly requested life to the request of other nodes for worker thread Make the table tail of chained list;Worker thread inquires about described response command chained list, sends before this thread as found Response command corresponding to request command, then from described response command chained list, take out this response command, enter Row resolves and obtains response results.
13. systems as claimed in claim 9, it is characterised in that also include:
Timeout treatment module, is just processing the life in order chained list for time-out scanning thread periodic scan Order, is not the most deleted as certain order exceedes the scheduled time, then this order taken out described in reinserting In newly requested order chained list.
14. 1 kinds realize data and process and mutual system, are applied to service end, including:
Receiver module, such as receives the packet from client, is then inserted by packet for receiving thread Enter to receive in bag chained list;
For processing data packets thread, processing data packets module, judges that receiving the packet given in bag chained list is No can be assembled into a complete request command, be to take out described packet and assemble, will assemble Complete request command inserts in newly requested order chained list;
Request and respond module, take out request command for worker thread from described newly requested order chained list Process, generate response command after being disposed, insert in response command chained list;
Command processing module, takes out response command for command process thread from described response command chained list Split, the one or more packets split into are inserted and sends in bag chained list;
Sending module, is used for sending thread and takes out packet from described transmission bag chained list and be transmitted;
Wherein, described transmission thread, receiving thread, worker thread are multiple;Each thread parallel performs.
15. systems as claimed in claim 14, it is characterised in that:
Described reception bag chained list is multiple with sending bag chained list;
Send thread and send bag chained list one_to_one corresponding, receiving thread and reception bag chained list one_to_one corresponding;
Command processing module, sends out the one or more packets insertion split into for command process thread Send in bag chained list, including: it is the shortest that command process thread selects a length from multiple transmission bag chained lists Send bag chained list, the one or more packets split into are inserted the transmission bag chained list that described length is the shortest Table tail.
16. systems as claimed in claim 14, it is characterised in that:
Whether processing data packets module, judge the packet in reception bag chained list for processing data packets thread A complete request command can be assembled into, be, take out packet and assemble, including: packet Process thread and whether judge to receive the number of the packet in bag chained list with same command id equal to being somebody's turn to do Total number of the packet that order splits into, is to take out described packet from described reception bag chained list and enter Row assembles;Wherein, the packet of each reception carries the command id of this request command, notebook data bag Sequence number and the total number of packet that splits into altogether of this request command;
Command processing module, splits described response command for command process thread, including: life Order processes the thread maximum length according to the single transmission bag preset, and response command splits into one or many Individual packet;Wherein, each packet carries the command id of this response command, the sequence of notebook data bag Number and the total number of packet that splits into altogether of this response command;
Wherein, the command id phase of the command id that described response command carries and corresponding request command With.
CN201410014386.1A 2014-01-13 2014-01-13 A kind of data that realize process and mutual method and system Active CN103701830B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410014386.1A CN103701830B (en) 2014-01-13 2014-01-13 A kind of data that realize process and mutual method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410014386.1A CN103701830B (en) 2014-01-13 2014-01-13 A kind of data that realize process and mutual method and system

Publications (2)

Publication Number Publication Date
CN103701830A CN103701830A (en) 2014-04-02
CN103701830B true CN103701830B (en) 2016-09-07

Family

ID=50363226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410014386.1A Active CN103701830B (en) 2014-01-13 2014-01-13 A kind of data that realize process and mutual method and system

Country Status (1)

Country Link
CN (1) CN103701830B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117230B (en) * 2015-08-31 2018-08-10 深圳神州数码云科数据技术有限公司 A kind of both-end task processing method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1645342A (en) * 2005-01-21 2005-07-27 清华大学 Large scale resource memory managing method based on network under SAN environment
CN1700177A (en) * 2005-06-24 2005-11-23 中国人民解放军国防科学技术大学 Method for constructing Web server based on soft flow construction and server thereof
CN101316193A (en) * 2007-05-28 2008-12-03 北京师范大学珠海分校 Multi-task scheduling method of measuring probe
CN101827088A (en) * 2010-03-15 2010-09-08 北京航空航天大学 Realization method of basic communication protocol based on CPU (Central Processing Unit) bus interconnection
CN102868726A (en) * 2012-08-23 2013-01-09 北京神鹰城讯科技有限公司 Method and system for publishing Internet information
WO2013036750A1 (en) * 2011-09-09 2013-03-14 Oracle International Corporation System and method for providing a dynamic invocation and service interface for use in a middleware or other environment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1645342A (en) * 2005-01-21 2005-07-27 清华大学 Large scale resource memory managing method based on network under SAN environment
CN1700177A (en) * 2005-06-24 2005-11-23 中国人民解放军国防科学技术大学 Method for constructing Web server based on soft flow construction and server thereof
CN101316193A (en) * 2007-05-28 2008-12-03 北京师范大学珠海分校 Multi-task scheduling method of measuring probe
CN101827088A (en) * 2010-03-15 2010-09-08 北京航空航天大学 Realization method of basic communication protocol based on CPU (Central Processing Unit) bus interconnection
WO2013036750A1 (en) * 2011-09-09 2013-03-14 Oracle International Corporation System and method for providing a dynamic invocation and service interface for use in a middleware or other environment
CN102868726A (en) * 2012-08-23 2013-01-09 北京神鹰城讯科技有限公司 Method and system for publishing Internet information

Also Published As

Publication number Publication date
CN103701830A (en) 2014-04-02

Similar Documents

Publication Publication Date Title
JP2015525505A (en) System and method for persistent wireless docking
CN105450785B (en) File transmission method and device
CN105450769A (en) File transmission method and device
JP2008263436A (en) Load distribution device and network apparatus
JP7046983B2 (en) Packet transmission method and equipment
US10037297B2 (en) Method of extending range of USB transmission for isochronous transfer
CN116204487A (en) Remote data access method and device
CN107579929B (en) Method, system and related device for setting reliable connection communication queue pair
CN104811431A (en) Data packet processing method and device based on parallel protocol stack instance
WO2014092551A1 (en) System and method for optimal memory management between cpu and fpga unit
CN103701830B (en) A kind of data that realize process and mutual method and system
WO2020039607A1 (en) Communication device, communication method, and communication program
CN113157465A (en) Message sending method and device based on pointer linked list
CN105450679A (en) Method and system for performing data cloud storage
CN116886576A (en) Multi-control storage cluster communication timeout control method, device, equipment and medium
US7962799B2 (en) System and method for synchronizing test runs on separate systems
CN107920035B (en) Multi-core processor type device, system and vehicle for deterministic switched Ethernet
CN105912477B (en) A kind of method, apparatus and system that catalogue is read
CN106372013A (en) Remote memory access method, apparatus and system
CN111245794B (en) Data transmission method and device
CN106161549B (en) Data transmission method, system, control server and client
JP2006209465A (en) Load distribution system, load distribution device, server, load distribution program and load distribution method
WO2016197607A1 (en) Method and apparatus for realizing route lookup
CN110166506B (en) Method for connecting hypertext transfer protocol Http and node equipment
US20050080922A1 (en) Address translation program and address translation apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20180827

Address after: 200436 Room 411, No. three, JIANGCHANG Road, Jingan District, Shanghai, 411

Patentee after: SHANGHAI INSPUR CLOUD CALCULATING SERVICE CO.,LTD.

Address before: 100085 floor 1, C 2-1, No. 2, Shang Di Road, Haidian District, Beijing.

Patentee before: INSPUR (BEIJING) ELECTRONIC INFORMATION INDUSTRY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221021

Address after: 071000 Room 502, Block B, East Lake Yunduan Science and Technology Industrial Park, No. 1111, Jinhe Street, Dongjinzhuang Township, Lianchi District, Baoding City, Hebei Province

Patentee after: Baoding Inspur Cloud Computing Co.,Ltd.

Address before: 200436 Room 411, No. three, JIANGCHANG Road, Jingan District, Shanghai, 411

Patentee before: SHANGHAI INSPUR CLOUD CALCULATING SERVICE CO.,LTD.