A method, system, device and medium for processing SMB request

CN113630338BActive Publication Date: 2024-10-15JINAN INSPUR DATA TECH CO LTD
7 Cites 0 Cited by

Patent Information

Application Number
CN202110867150.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-29
Publication Date
2024-10-15
Estimated Expiration
2041-07-29

Smart Images

  • Figure CN113630338B_ABST
    Figure CN113630338B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device and storage medium for processing SMB requests, the method comprising: setting an index number for each SMB request in sequence; sending all SMB requests to each SMB channel in turn in a polling manner, and transmitting the SMB requests in different SMB channels to the corresponding physical link after hash balancing; setting a window cache queue at a Samba server, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request, and judging whether the SMB request at the current starting position of the window cache queue is received; and in response to receiving the SMB request at the current starting position of the window cache queue, executing the SMB requests from the current starting position to the current ending position of the window cache queue in sequence. The present invention fundamentally avoids the occurrence of SMB request misorder by designing a window cache queue at the Samba server to arrange and reorganize the SMB requests according to the index number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data transmission, and more specifically, to a method, system, computer device and readable medium for sequentially processing SMB requests through multiple channels of Samba. Background Art

[0002] Link aggregation is the process of aggregating multiple physical ports to form a logical port. Through the binding operation of the network card interface, on the one hand, high-throughput data transmission can be achieved on the network, and on the other hand, fault redundancy backup can be achieved. When one of the physical ports fails, the other physical port can normally assume business access, thereby avoiding user business interruption.

[0003] SMB (Server Message Block, a shared transmission protocol between different network nodes) supports multi-channel since version 2.2. Under multi-channel connection conditions, multiple network TCP (Transmission Control Protocol) connections can be formed from the Windows client to the Samba (an application that implements SMB and is used to provide sharing services from the Linux server to the Windows client) server. When the underlying aggregated links are balanced based on the transport layer parameters, multiple SMB channels can be relatively evenly divided into each aggregated link, which can further improve the network transmission efficiency of multiple SMB data.

[0004] The same client SMB data stream uses only one physical link for transmission when link aggregation is not configured. In this case, the frames of the data stream can always reach the receiving end in the correct order. However, after link aggregation is configured, if the balancing method of the aggregated link is based on the HASH distribution process calculated at network layers 3 and 4, the frames in the data streams of different SMB multi-channels of the same client will be transmitted through different physical links. In this way, the second data frame of the same file processing object may reach the receiving end before the first data frame, resulting in out-of-order reception of data packets. Summary of the invention

[0005] In view of this, the purpose of the embodiments of the present invention is to propose a method, system, computer device and computer-readable storage medium for sequentially processing SMB requests in Samba multi-channels. The present invention designs a window cache queue on the Samba server, and uses the window cache queue to reorganize SMB requests according to index numbers, thereby ensuring that each data stream received from multiple SMB channels is arranged in the correct order, thereby ensuring that the SMB request is in the correct sequential queue before actually entering the file system for processing, fundamentally avoiding the occurrence of SMB request misordering.

[0006] Based on the above purpose, an embodiment of the present invention provides a method for Samba multi-channel sequential processing of SMB requests, comprising the following steps: setting an index number for each SMB request in sequence; sending all SMB requests to each SMB channel in turn in a polling manner, and transmitting the SMB requests in different SMB channels to the corresponding physical link after hash balancing; setting a window cache queue on the Samba server, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request, and determining whether the SMB request at the current starting position of the window cache queue is received; and in response to receiving the SMB request at the current starting position of the window cache queue, executing the SMB requests from the current starting position to the current ending position of the window cache queue in sequence.

[0007] In some embodiments, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request includes: determining the first index number of the last SMB request executed last time, setting the starting position to the next digit of the first index number, and determining whether the SMB request corresponding to the next digit of the starting position has been received, and in response to not receiving the SMB request corresponding to the next digit of the starting position, placing the ending position at the same position as the starting position.

[0008] In some embodiments, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request includes: in response to receiving an SMB request corresponding to the next bit of the starting position, setting the ending position to the last bit of the continuous SMB requests that have been received starting from the starting position.

[0009] In some implementations, setting an index number for each SMB request in sequence includes: setting a message type of the SMB request to a negotiation message, and setting an index number for each SMB request in ascending order.

[0010] In some implementations, setting an index number for each SMB request in sequence includes: in response to the index number reaching a first threshold, setting the message type of a subsequent SMB request to a non-negotiated message, and setting an index number for each subsequent SMB request in ascending order.

[0011] In some implementations, the method further includes: in response to the number of data packets that continuously exceed the read and write times threshold being greater than a second threshold, establishing a new SMB channel connection.

[0012] In some implementations, the method further includes: assigning the new SMB channel a globally unique identifier that is the same as that of the original SMB channel, and setting a separate monitoring object for the new SMB channel.

[0013] In another aspect of an embodiment of the present invention, a system for sequentially processing SMB requests through multiple channels of Samba is provided, comprising: a numbering module configured to set an index number for each SMB request in sequence; a transmission module configured to send all SMB requests to each SMB channel in turn in a polling manner, and transmit the SMB requests in different SMB channels to the corresponding physical link after hash balancing; an adjustment module configured to set a window cache queue on a Samba server, dynamically adjust the starting position and the ending position of the window cache queue according to the index number of the received SMB request, and determine whether the SMB request at the current starting position of the window cache queue is received; and an execution module configured to execute the SMB requests from the current starting position to the current ending position of the window cache queue in sequence in response to receiving the SMB request at the current starting position of the window cache queue.

[0014] According to another aspect of an embodiment of the present invention, a computer device is provided, comprising: at least one processor; and a memory, wherein the memory stores computer instructions executable on the processor, and the instructions implement the steps of the above method when executed by the processor.

[0015] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, which stores a computer program that implements the above method steps when executed by a processor.

[0016] The present invention has the following beneficial technical effects: by designing a window cache queue on the Samba server, the window cache queue is used to reorganize SMB requests according to index numbers, thereby ensuring that each data stream received from multiple SMB channels is arranged in a correct order, thereby ensuring that the SMB request is in a correct order queue before actually entering the file system for processing, thereby fundamentally avoiding the occurrence of SMB request misordering. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

[0018] Figure 1A schematic diagram of an embodiment of a method for sequentially processing SMB requests through multiple channels of Samba provided by the present invention;

[0019] Figure 2 It is a basic interaction diagram of SMB multi-channel;

[0020] Figure 3 This is a working diagram of the window cache queue;

[0021] Figure 4 A schematic diagram of the hardware structure of an embodiment of a computer device for sequentially processing SMB requests through multiple channels of Samba provided by the present invention;

[0022] Figure 5 A schematic diagram of an embodiment of a computer storage medium for sequentially processing SMB requests through multiple channels provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0024] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0025] A first aspect of the embodiments of the present invention provides an embodiment of a method for sequentially processing SMB requests using Samba multi-channels. Figure 1 FIG. 2 is a schematic diagram of an embodiment of a method for sequentially processing SMB requests in multiple channels of Samba provided by the present invention. Figure 1 As shown, the embodiment of the present invention includes the following steps:

[0026] S1. Set the index number for each SMB request in order;

[0027] S2: All SMB requests are sent to each SMB channel in turn in a round-robin manner, and the SMB requests in different SMB channels are transmitted to the corresponding physical link after hash balancing;

[0028] S3, setting a window cache queue on the Samba server, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request, and determining whether an SMB request for the current starting position of the window cache queue is received; and

[0029] S4. In response to receiving the SMB request at the current starting position of the window cache queue, executing the SMB requests from the current starting position to the current ending position of the window cache queue in sequence.

[0030] Set an index number for each SMB request in order. Each SMB request comes with a message number (also known as the index number), and the message numbers before and after are marked as consecutive numbers on the client. Therefore, the server can implement a sequential SMB message processing queue based on the number, thereby ensuring the sequential nature of SMB message processing.

[0031] In some implementations, setting an index number for each SMB request in order includes: setting the message type of the SMB request to a negotiation message, and setting an index number for each SMB request in ascending order. The message numbering starts from the first formal negotiation message and is numbered from 1 in ascending order.

[0032] In some embodiments, the setting of index numbers for each SMB request in sequence includes: in response to the index number reaching a first threshold, setting the message type of subsequent SMB requests to a non-negotiated message, and setting the index number for each subsequent SMB request in ascending order. Index number reversal refers to the situation where the index number does not increase after exceeding a certain value and is directly initialized to count from one. In consideration of index number reversal, when the index number reaches the first threshold, the message type of subsequent SMB requests is set to a non-negotiated message, and the index number is set for each subsequent SMB request in ascending order from one. In this way, when it is subsequently detected that the SMB index number is 1 but the message type is not a negotiated message, it means that the index number has been reversed, and when it is added to the window cache queue, it must be placed at the tail for processing.

[0033] In some embodiments, the method further includes: in response to the number of data packets that continuously exceed the read and write times threshold being greater than a second threshold, establishing a new SMB channel connection. The SMB multi-channel establishment occurs during the file read and write phase. Before the file read and write occurs, the Windows client will only establish an SMB channel connection during the process of mapping the network drive, and then read and write files to the shared directory. When the transmitted data flow reaches the flow threshold set by Windows, the Windows client can automatically initiate a multi-channel connection.

[0034] In some implementations, the method further includes: assigning the same global unique identifier as the original SMB channel to the new SMB channel, and setting a separate monitoring object for the new SMB channel. The difference between SMB multi-channel connection and ordinary SMB connection is that SMB multi-channel connection uses the same client GUID (Globally Unique Identifier). When the Samba server determines that the GUID identifier has been recorded, it will treat it as multiple SMB channel connections of the same client, and the same SMB session is still used in the end. Each SMB channel is separately set with an EPOLL (an implementation form of the multiplexed input and output interface under Linux) monitoring object.

[0035] All SMB requests are sent to each SMB channel in turn in a polling manner, and the SMB requests in different SMB channels are transmitted to the corresponding physical link after hash balancing. The Windows client uses a polling method to send SMB requests, that is, all SMB requests for a file are sent to each SMB channel in turn according to the polling strategy. Before the SMB data packet is actually sent to the physical link, it will be encapsulated into a complete data packet by the network protocol stack, and then the appropriate HASH parameters will be selected for the balancing process calculation, and a suitable physical link will be selected in the aggregated link based on the calculation results to send it out.

[0036] Figure 2 The following is a basic interaction diagram of SMB multi-channel. Figure 2 As shown, the Windows client sends SMB requests to SMB channel 1, SMB channel 2, SMB channel 3, and SMB channel 4 in turn. All SMB requests are sent out through different physical links after being HASH balanced.

[0037] A window cache queue is set on the Samba server, and the starting position and ending position of the window cache queue are dynamically adjusted according to the index number of the received SMB request, and it is determined whether the SMB request of the current starting position of the window cache queue is received. The Samba server initializes an empty window cache queue, and sets the sliding window starting and ending positions to 1, indicating that it is expected to process the SMB request with index number 1 at this time. After receiving the SMB request, the Samba server first reads the SMB request header length value, and then further reads the SMB data of this length from the SOCKET buffer. Extract the index number in the SMB data. Under normal circumstances, Windows will attach an 8-byte unsigned MESSAGE ID field to each SMB request. This field is incremented in sequence from 1 for each separate SMB mount.

[0038] The start position and end position of the window cache queue can be dynamically adjusted as follows: the start position and end position of the sliding window are both 1; when the first negotiation request is received and processed, the start position and end position are modified to 2, indicating that the SMB request with index number 2 is expected to be processed next; if the SMB request with a later order arrives first, it is inserted into the window cache queue; it is determined whether the SMB request newly inserted into the queue is sequentially connected with the SMB request currently expected to be processed in terms of index number. If so, the end position of the window is moved to the new SMB request; otherwise, it means that there are other SMB requests in the middle that have not been received, and the end position of the window is not moved at this time. For the start position of the window, it automatically moves back by 1 for each SMB request processed; if a combined SMB request is encountered, the number of single SMB requests contained in the combined SMB request is automatically incremented. A combined SMB request is a plurality of consecutive SMB requests. For example, if a combined SMB request consists of SMB[n2], SMB[n3], and SMB[n4], the start position is automatically incremented by 3.

[0039] In some embodiments, the dynamically adjusting the start position and the end position of the window cache queue according to the index number of the received SMB request includes: determining the first index number of the last SMB request executed last time, setting the start position to the next position of the first index number, and judging whether the SMB request corresponding to the next position of the start position has been received, and in response to not receiving the SMB request corresponding to the next position of the start position, placing the end position and the start position at the same position. For example, if the first index number of the last SMB request executed last time is [n2], the start position can be set to [n3]. If [n4] is not received, the end position is also set to [n3].

[0040] If the new SMB request index number is consistent with the current expected processing index number, it will be processed directly, and the window start and end positions will be moved after the processing is completed; for example, if the new SMB request index number and the current expected processing index number are both [n2], SMB [n2] will be processed directly, and the start and end positions will be moved to SMB [n3]. The end position is calculated from the SMB request with the index number after the start position, and the SMB requests that are continuously in the window cache queue will also continuously increase the end position, so that the maximum number of SMB requests can be processed continuously each time; if the new SMB request index number is the current expected processing index number + 1, it will be placed in the window cache queue and the window end position will be moved + 1; if the new SMB request index number is the current expected processing index number + n, it will be placed in the window cache queue and the window end position will be moved + n.

[0041] In some embodiments, the dynamically adjusting the start position and the end position of the window cache queue according to the index number of the received SMB request includes: in response to receiving the SMB request corresponding to the next bit of the start position, setting the end position to the last bit of the continuous SMB request received from the start position. Continuing with the above example, if [n4] is received, the end position is moved to [n4], and it is determined whether [n5] is received. If [n5] is received, the end position is moved to [n5], and so on.

[0042] Figure 3 The following is a schematic diagram of the working process of the window cache queue. Figure 3 As shown, in stage 1, the starting position of the window of the cache queue is SMB[n2], indicating the next SMB request expected to be processed. Since SMB[n3] and SMB[n4] already exist in the queue, the end position of the window is marked as SMB[n4]. In stage 2, the SMB[n2] request is received. At this time, the SMB requests between Start (starting position) and End (ending position), namely SMB[n2-n4], are processed continuously at one time. After the processing is completed, the Start and End positions are slid forward again. Since SMB[n5] and SMB[n6] have not arrived, the new Start and End positions will stay at SMB[n5]. If SMB[n6] arrives first in stage 3, it will be added to the queue and the End position will be updated to SMB[n6]. At this time, since SMB[n7] already exists in the queue, the End position will continue to be updated to [n7], and continue to wait for the arrival of SMB[n5]. And so on, that is, the End position is always at the continuous end position of the current expected SMB request.

[0043] In response to receiving the SMB request at the current starting position of the window cache queue, the SMB requests from the current starting position to the current ending position of the window cache queue are executed in sequence. Continuing with the above example, if SMB[n5] is received, the SMB requests from the current starting position to the current ending position of the window cache queue are executed in sequence. The Samba server needs to convert the call result into SMB NT_STATUS format and respond to the client. If it is an SMB read request, the read data needs to be packaged and sent to the Windows client.

[0044] The embodiment of the present invention designs a window cache queue on the Samba server, and uses the window cache queue to reorganize SMB requests according to index numbers, thereby ensuring that each data stream received from multiple SMB channels is arranged in a correct order, thereby ensuring that the SMB request is in a correct order queue before actually entering the file system for processing, and fundamentally avoiding the occurrence of SMB request misordering.

[0045] It should be particularly pointed out that the various steps in the various embodiments of the above-mentioned Samba multi-channel sequential processing of SMB requests method can be cross-linked, replaced, added, and deleted. Therefore, these reasonable permutations, combinations and transformations of the Samba multi-channel sequential processing of SMB requests method should also fall within the protection scope of the present invention, and the protection scope of the present invention should not be limited to the embodiments.

[0046] Based on the above purpose, a second aspect of an embodiment of the present invention proposes a Samba multi-channel sequential processing SMB request system, comprising: a numbering module, configured to set an index number for each SMB request in sequence; a transmission module, configured to send all SMB requests to each SMB channel in turn in a polling manner, and transmit the SMB requests in different SMB channels to the corresponding physical link after hash balancing; an adjustment module, configured to set a window cache queue on the Samba server, dynamically adjust the starting position and the ending position of the window cache queue according to the index number of the received SMB request, and determine whether the SMB request at the current starting position of the window cache queue is received; and an execution module, configured to respond to the SMB request at the current starting position of the window cache queue, and execute the SMB requests from the current starting position to the current ending position of the window cache queue in sequence.

[0047] In some embodiments, the adjustment module is configured to: determine the first index number of the last SMB request executed last time, set the starting position to the next bit of the first index number, and determine whether the SMB request corresponding to the next bit of the starting position has been received, and in response to not receiving the SMB request corresponding to the next bit of the starting position, place the end position at the same position as the starting position.

[0048] In some implementations, the adjustment module is configured to: in response to receiving an SMB request corresponding to the next bit of the start position, set the end position to the last bit of the continuous SMB requests received starting from the start position.

[0049] In some implementations, the numbering module is configured to: set the message type of the SMB request to a negotiation message, and set an index number for each SMB request in ascending order.

[0050] In some implementations, the numbering module is configured to: in response to the index number reaching a first threshold, set the message type of a subsequent SMB request to a non-negotiation message, and set an index number for each subsequent SMB request in ascending order.

[0051] In some embodiments, the system further includes a channel module configured to: establish a new SMB channel connection in response to the number of data packets that continuously exceed the read and write times threshold being greater than a second threshold.

[0052] In some implementations, the system further includes a setting module configured to: assign the new SMB channel a globally unique identifier that is the same as that of the original SMB channel, and set a separate monitoring object for the new SMB channel.

[0053] Based on the above purpose, a third aspect of an embodiment of the present invention provides a computer device, comprising: at least one processor; and a memory, the memory storing computer instructions that can be run on the processor, the instructions being executed by the processor to implement the following steps: S1, setting an index number for each SMB request in sequence; S2, sending all SMB requests to each SMB channel in turn in a polling manner, and transmitting the SMB requests in different SMB channels to the corresponding physical link after hash balancing; S3, setting a window cache queue on the Samba server, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request, and determining whether the SMB request at the current starting position of the window cache queue is received; and S4, in response to receiving the SMB request at the current starting position of the window cache queue, executing the SMB requests from the current starting position to the current ending position of the window cache queue in sequence.

[0054] In some embodiments, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request includes: determining the first index number of the last SMB request executed last time, setting the starting position to the next digit of the first index number, and determining whether the SMB request corresponding to the next digit of the starting position has been received, and in response to not receiving the SMB request corresponding to the next digit of the starting position, placing the ending position at the same position as the starting position.

[0055] In some embodiments, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request includes: in response to receiving an SMB request corresponding to the next bit of the starting position, setting the ending position to the last bit of the continuous SMB requests that have been received starting from the starting position.

[0056] In some implementations, setting an index number for each SMB request in sequence includes: setting a message type of the SMB request to a negotiation message, and setting an index number for each SMB request in ascending order.

[0057] In some implementations, setting an index number for each SMB request in sequence includes: in response to the index number reaching a first threshold, setting the message type of a subsequent SMB request to a non-negotiated message, and setting an index number for each subsequent SMB request in ascending order.

[0058] In some implementations, the steps further include: in response to the number of data packets that continuously exceed the read and write times threshold being greater than a second threshold, establishing a new SMB channel connection.

[0059] In some implementations, the steps further include: assigning the new SMB channel a globally unique identifier that is the same as that of the original SMB channel, and setting a separate monitoring object for the new SMB channel.

[0060] like Figure 4 , which is a schematic diagram of the hardware structure of an embodiment of the computer device for sequentially processing SMB requests through multiple Samba channels provided by the present invention.

[0061] As Figure 4 Taking the device shown as an example, the device includes a processor 201 and a memory 202, and may also include: an input device 203 and an output device 204.

[0062] The processor 201, the memory 202, the input device 203 and the output device 204 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0063] The memory 202 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the method for sequentially processing SMB requests by Samba multi-channels in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 202, that is, the method for sequentially processing SMB requests by Samba multi-channels in the above method embodiment is implemented.

[0064] The memory 202 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by using a method for sequentially processing SMB requests in a multi-channel manner according to Samba, etc. In addition, the memory 202 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 202 may optionally include a memory remotely arranged relative to the processor 201, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0065] The input device 203 can receive input information such as user name and password. The output device 204 can include display devices such as display screens.

[0066] Program instructions / modules corresponding to one or more Samba multi-channel sequential processing SMB request methods are stored in the memory 202, and when executed by the processor 201, the Samba multi-channel sequential processing SMB request method in any of the above method embodiments is executed.

[0067] Any embodiment of a computer device that executes the above-mentioned Samba multi-channel sequential processing of SMB requests method can achieve the same or similar effect as any corresponding aforementioned method embodiment.

[0068] The present invention also provides a computer-readable storage medium, which stores a computer program that performs the above method when executed by a processor.

[0069] like Figure 5 As shown, it is a schematic diagram of an embodiment of the computer storage medium for sequentially processing SMB requests through multiple channels provided by the present invention. Figure 5 Taking the computer storage medium shown as an example, the computer readable storage medium 3 stores a computer program 31 that performs the above method when executed by a processor.

[0070] Finally, it should be noted that a person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program. The program of the method for sequentially processing SMB requests through multiple channels of Samba can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium of the program can be a magnetic disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned arbitrary method embodiments.

[0071] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.

[0072] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.

[0073] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0074] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0075] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims

1. A method for processing an SMB request, characterized in that: The following steps are involved: Set the index number for each SMB request in order; All SMB requests are sent to each SMB channel in turn in a round-robin manner, and the SMB requests in different SMB channels are transmitted to the corresponding physical link after hash balancing; Setting a window cache queue on the Samba server, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request, and determining whether an SMB request at the current starting position of the window cache queue is received; as well as In response to receiving the SMB request at the current starting position of the window cache queue, the SMB requests from the current starting position to the current ending position of the window cache queue are executed in sequence, The steps of setting a window cache queue on the Samba server, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request, and determining whether an SMB request at the current starting position of the window cache queue is received are specifically as follows: The Samba server initializes an empty window cache queue and sets the sliding window start and end positions to 1, indicating that it expects to process the SMB request with index number 1. After receiving the SMB request, the Samba server first reads the SMB request header length value, and then further reads the SMB data of this length from the SOCKET buffer to extract the index number in the SMB data. Under normal circumstances, Windows will attach an 8-byte unsigned MESSAGE ID field to each SMB request, and this field is incremented from 1 to the next for each separate SMB mount. The starting position and the end position of the sliding window are both 1. When the first negotiation request is received and processed, the starting position and the end position are modified to 2, indicating that the SMB request with index number 2 is expected to be processed next. If the SMB request with a later order comes first, it is inserted into the window cache queue to determine whether the SMB request newly inserted into the queue is sequentially connected with the SMB request currently expected to be processed in terms of index number. If so, the end position of the window is moved to the new SMB request. Otherwise, it means that there are other SMB requests that have not been received in the middle. At this time, the end position of the window is no longer moved. For the starting position of the window, it automatically moves backward by 1 for each SMB request processed. If a combined SMB request is encountered, the number of single SMB requests contained in the combined SMB request is automatically incremented. The dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request includes: Determine the first index number of the last SMB request executed last time, set the starting position to the next bit of the first index number, and determine whether the SMB request corresponding to the next bit of the starting position has been received, and in response to not receiving the SMB request corresponding to the next bit of the starting position, place the ending position and the starting position at the same position, wherein, If the new SMB request index number is the same as the current expected processing index number, it will be processed directly. After the processing is completed, the window start and end positions will be moved. If the new SMB request index number is the current expected processing index number + n, it is placed in the window cache queue and the window end position is moved + n; and In response to receiving an SMB request corresponding to the next bit of the starting position, setting the end position to the last bit of the continuous SMB requests received starting from the starting position; The step of sequentially setting an index number for each SMB request includes: Set the message type of the SMB request to negotiation message, and set the index number for each SMB request in ascending order; The step of sequentially setting an index number for each SMB request includes: In response to the index number reaching the first threshold, the message type of the subsequent SMB request is set to a non-negotiation message, and the index number is set for each subsequent SMB request in ascending order.

2. The method according to claim 1, characterized in that The method also includes: In response to the number of data packets that continuously exceed the read and write times threshold being greater than a second threshold, a new SMB channel connection is established.

3. The method according to claim 2, characterized in that The method also includes: The new SMB channel is assigned the same globally unique identifier as the original SMB channel, and a separate monitoring object is set for the new SMB channel.

4. A system for processing SMB requests, characterized in that: include: A numbering module is configured to set an index number for each SMB request in sequence; A transmission module, configured to send all SMB requests to each SMB channel in turn in a polling manner, and transmit the SMB requests in different SMB channels to the corresponding physical link after hash balancing; An adjustment module is configured to set a window cache queue on a Samba server, dynamically adjust a start position and an end position of the window cache queue according to an index number of a received SMB request, and determine whether an SMB request for a current start position of the window cache queue is received; as well as an execution module, configured to execute the SMB requests from the current starting position to the current ending position of the window cache queue in sequence in response to receiving the SMB request at the current starting position of the window cache queue, The steps of setting a window cache queue on the Samba server, dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request, and determining whether an SMB request at the current starting position of the window cache queue is received are specifically as follows: The Samba server initializes an empty window cache queue and sets the sliding window start and end positions to 1, indicating that it expects to process the SMB request with index number 1. After receiving the SMB request, the Samba server first reads the SMB request header length value, and then further reads the SMB data of this length from the SOCKET buffer to extract the index number in the SMB data. Under normal circumstances, Windows will attach an 8-byte unsigned MESSAGE ID field to each SMB request, and this field is incremented from 1 to the next for each separate SMB mount. The starting position and the end position of the sliding window are both 1. When the first negotiation request is received and processed, the starting position and the end position are modified to 2, indicating that the SMB request with index number 2 is expected to be processed next. If the SMB request with a later order comes first, it is inserted into the window cache queue to determine whether the SMB request newly inserted into the queue is sequentially connected with the SMB request currently expected to be processed in terms of index number. If so, the end position of the window is moved to the new SMB request. Otherwise, it means that there are other SMB requests that have not been received in the middle. At this time, the end position of the window is no longer moved. For the starting position of the window, it automatically moves backward by 1 for each SMB request processed. If a combined SMB request is encountered, the number of single SMB requests contained in the combined SMB request is automatically incremented. The dynamically adjusting the starting position and the ending position of the window cache queue according to the index number of the received SMB request includes: Determine the first index number of the last SMB request executed last time, set the starting position to the next bit of the first index number, and determine whether the SMB request corresponding to the next bit of the starting position has been received, and in response to not receiving the SMB request corresponding to the next bit of the starting position, place the ending position and the starting position at the same position, wherein, If the new SMB request index number is the same as the current expected processing index number, it will be processed directly. After the processing is completed, the window start and end positions will be moved. If the new SMB request index number is the current expected processing index number + n, it is placed in the window cache queue and the window end position is moved + n; and In response to receiving an SMB request corresponding to the next bit of the starting position, setting the end position to the last bit of the continuous SMB requests received starting from the starting position; The step of sequentially setting an index number for each SMB request includes: Set the message type of the SMB request to negotiation message, and set the index number for each SMB request in ascending order; The step of sequentially setting an index number for each SMB request includes: In response to the index number reaching the first threshold, the message type of the subsequent SMB request is set to a non-negotiation message, and the index number is set for each subsequent SMB request in ascending order.

5. A computer device, characterized in that: include: at least one processor; as well as A memory, wherein the memory stores computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 3.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Method, device and system for self-adaptation multiple-link aggregation

    CN103618678A

  • Multi-link data distribution method and device and electronic equipment

    CN110417650A

  • Method and system for realizing TCP (Transmission Control Protocol) full-offload IP (Internet Protocol) cores for multi-connection management

    CN110535827A

  • Far-end file processing method, system and device and readable storage medium

    CN111901386A

  • Distributed byte lock detection control method and device

    CN112839099A