A method for improving the stability and concurrent processing capability of embedded platform socket server

By using Linux system API and virtual network card driver on the embedded platform, concurrent processing on the Socket server is realized, solving the problems of tight CPU resources and complex thread management, and improving stability and concurrency capabilities.

CN114900565BActive Publication Date: 2024-11-15NANJING ZHONGKE SHANGYUAN TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210454573.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-24
Publication Date
2024-11-15
Estimated Expiration
2042-04-24

AI Technical Summary

Technical Problem

When the prior art realizes concurrent processing of Socket servers on an embedded platform, there are problems such as tight CPU resources, frequent memory copying, complex thread management and low stability, which affects the normal operation of the business.

Method used

By calling the Linux system API to create sockets, fork creates subprocesses to process requests, and using virtual network card drivers and port mapping modules to achieve concurrent processing, pre-set subservice processes to avoid memory copying and thread management, and ensure independent operation.

Benefits of technology

It reduces CPU usage, simplifies code logic, improves the stability and concurrent processing capabilities of the server, avoids thread management complexity and resource occupation, and ensures that the original service can still run normally when the extended service fails.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114900565B_ABST
    Figure CN114900565B_ABST
Patent Text Reader

Abstract

The present invention discloses a concurrent processing method based on an embedded platform server, including calling a Linux system APIsocket to create a socket, APIbind to bind a service port number, APIaccept to receive a request, and APIfork to create a subprocess to process the request; running a redirection handler in a subprocess in the fork, and running several fork subprocesses at the same time to achieve concurrent processing; after the subprocess in the fork completes running the directional handler, the subprocess is released to complete a complete request processing flow. The present invention presets a subservice process to avoid frequent memory copying, process application, release and other operations in the program running state; the code logic is simple, there is no additional code such as thread management and event calling, it can be compatible with the original service, the extended subservice and the original service coexist, and are independent of each other, even if the extended service fails, the original service can still run normally.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of backend service concurrent processing, and in particular to a method for improving the stability and concurrent processing capability of an embedded platform Socket server. Background Art

[0002] At present, the commonly used software architectures are CS architecture and BS architecture. Both are implemented through sockets. Generally, the server needs to support several C-end or B-end access requests at the same time, so the server is required to have concurrent processing capabilities; the commonly used server-side concurrent implementation solutions are as follows: sub-process, sub-thread, pooling (sub-process pool or thread pool), asynchronous event processing.

[0003] Disadvantages of the above solutions:

[0004] The child process will copy the parent process memory. Frequent copying will lead to increased CPU usage. The application and release of the process will also occupy resources. The CPU resources of the embedded platform are relatively tight. This solution will cause the CPU usage to remain high, affecting normal business.

[0005] Multiple threads share the memory space of the parent process, which reduces CPU usage compared to child processes, but limits usage scenarios (scenarios that require memory isolation). An error in one thread often causes errors in other threads. In addition, frequent requests for release by threads will still occupy additional resources.

[0006] Pooling technology mainly solves the problem of frequent thread application and release. The disadvantage is that it increases the complexity of the code and has low reliability. Frequent thread switching may also cause thread jitter, and too many threads will cause server instability.

[0007] Asynchronous event processing is highly efficient, but the scheduling between events is relatively complex. It is suitable for projects starting from scratch. In addition, asynchronous event processing is generally only applicable to non-blocking processing. For time-consuming processing, multi-process or multi-threading is still required. Summary of the invention

[0008] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0009] In view of the above existing problems, the present invention is proposed.

[0010] To solve the above technical problems, the present invention provides the following technical solutions: including calling the Linux system API socket to create a socket, API bind to bind a service port number, API accept to receive a request, and API fork to create a subprocess to process the request; running a redirection handler in the subprocess in the fork, and running several fork subprocesses at the same time to achieve concurrent processing; after the subprocess in the fork completes running the redirection handler, releasing the subprocess to complete a complete request processing flow.

[0011] As a preferred solution of the concurrent processing method based on the embedded platform server of the present invention, it also includes:

[0012] In loop iteration, API accept receives the request, and API fork creates a child process to handle the request;

[0013] Continuously receive requests from clients;

[0014] When the client request interval is less than the time required for business processing, there will be multiple fork sub-processes, and the client is in a concurrent processing state.

[0015] As a preferred solution of the concurrent processing method based on the embedded platform server of the present invention, wherein: a virtual network card driver is added, the virtual network card ed0;

[0016] When the program starts, several subprocesses are preset. Each subprocess corresponds to a listening port, the network card is ed0, and the original service is also bound to port 3990, the network card is eth1.

[0017] As a preferred solution of the concurrent processing method based on the embedded platform server of the present invention, wherein: a port mapping function module is set to capture the client access request message by using the HooK mechanism of Netfilter;

[0018] The original port number 3990 is replaced with the extended service port, and after the port is modified according to the TCP / UDP protocol requirements, the TCP or UDP header checksum is calculated;

[0019] The value of skb->dev is replaced from eth1 to ed0 interface, the skb is resubmitted to the system protocol stack, and the preset sub-service process bound to ed0 receives the request.

[0020] As a preferred solution of the concurrent processing method based on the embedded platform server of the present invention, wherein: a service process is preset, a request message of the client is received from ed0, a business subroutine responds to the request according to the business processing logic, and the response message generated by it is sent out through ed0;

[0021] After the port mapping module captures the response message sent to the client, it restores the extended port number in the message to 3990, and calls the sending interface of eth1 to send the message to the client.

[0022] As a preferred solution of the concurrent processing method based on the embedded platform server described in the present invention, the port mapping module is a kernel module, and a .ko kernel driver is obtained after code compilation, and the ko module is loaded using insmod.

[0023] As a preferred solution of the concurrent processing method based on the embedded platform server described in the present invention, after the ko module is started, the HOOK mechanism of the Netfilter of the Linux system is used to capture the message of the client accessing the WebPortal service, the service port number is 3990, and the port mapping is obtained according to the client MAC address.

[0024] As a preferred solution of the concurrent processing method based on the embedded platform server described in the present invention, the destination port number of the captured client request message is defined as 3990, the last byte of the client MAC address is selected and the modulus calculation is performed with the number of extended ports, and the calculation result is added with 3990 to obtain the port to be replaced, which determines which preset service process the request will be sent to for processing.

[0025] As a preferred solution of the concurrent processing method based on the embedded platform server of the present invention, if 32 service ports are extended, the currently captured client MAC address is 48-51-C5-70-9B-49, and the service port number requested to be replaced is 3999, the client request will be processed by the preset sub-service bound to 3999, and the calculation formula is as follows:

[0026] 0x49%32+3990=3999.

[0027] As a preferred solution of the concurrent processing method based on the embedded platform server described in the present invention, wherein: the Skb represents a data packet in the Linux kernel code, and skb->dev indicates which network card the data packet comes from. If it is not replaced, the application cannot receive the data packet.

[0028] The beneficial effects of the present invention are as follows: 1. Presetting the sub-service process avoids frequent memory copying, process application, release and other operations when the program is running; 2. The code logic is simple, and there is no additional code such as thread management and event calling; 3. It is compatible with the original service, and the extended sub-service and the original service coexist and are independent of each other. Even if the extended service fails, the original service can still operate normally. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0030] Figure 1 It is a flowchart of a concurrent processing method based on an embedded platform server according to the first embodiment of the present invention;

[0031] Figure 2 A schematic diagram of a WebPortal business processing flow of a concurrent processing method based on an embedded platform server according to a first embodiment of the present invention;

[0032] Figure 3 A schematic diagram of a sub-process calling flow of a concurrent processing method based on an embedded platform server according to a first embodiment of the present invention;

[0033] Figure 4 A schematic diagram of pre-set service processing of a concurrent processing method based on an embedded platform server according to a second embodiment of the present invention;

[0034] Figure 5 This is a schematic diagram of the test architecture of the concurrent processing method based on the embedded platform server according to the second embodiment of the present invention. DETAILED DESCRIPTION

[0035] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0036] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0037] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0038] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0039] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0040] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0041] Example 1

[0042] Reference Figure 1 , Figure 2 and Figure 3 , which is the first embodiment of the present invention, provides a concurrent processing method based on an embedded platform server, specifically comprising:

[0043] S1: Call the Linux system API socket to create a socket.

[0044] S2: Call the Linux system API bind to bind the service port number.

[0045] S3: Call the Linux system API accept to receive the request.

[0046] S4: Call the Linux system API fork to create a child process to handle the request.

[0047] S5: Run the redirection handler in the child process in the fork, and several fork child processes can be run at the same time to achieve the purpose of concurrent processing.

[0048] S6: After the child process in Fork finishes running the redirection handler, the child process is released, completing a complete request processing flow.

[0049] S3 to S6 are in a loop, continuously receiving requests from the client and handing the requests over to S4 for processing. When the interval between client requests is less than the time required for business processing, there will be multiple fork child processes, and the client is in a concurrent processing state.

[0050] The calling code is as follows:

[0051]

[0052] Reference Figure 1 , each Accept request corresponds to a business processing process, thus achieving the purpose of concurrent processing.

[0053] Reference Figure 2 This embodiment also provides a Web Portal service processing unit, which is responsible for processing client requests and sending response messages, wherein port 3990 is the default Web Portal service port, and port 3991-xxxxx is the port number extended by the technology of this embodiment and is also used for the Web Portal service port, virtual interface ed0. This embodiment hopes to improve the concurrency performance without changing the original software architecture, so the extended service port is bound to the virtual interface ed0.

[0054] Port mapping maps the original 3990 to the extended service port number (3991-xxxx) according to certain rules.

[0055] Specifically, the steps are as follows:

[0056] (1) Add a virtual network card driver, virtual network card ed0.

[0057]

[0058] (2) When the program starts, several subprocesses are preset (the specific number can be determined according to the business scale). Each subprocess corresponds to a listening port. The network card uses ed0. The original service is also bound to port 3990, and the network card uses eth1.

[0059] Furthermore, in order to ensure that the use of the technical solution provided in this embodiment will not result in a worse result than when not using it, Figure 2 The business sub-process in the process also has the ability to fork sub-processes. Although requests from different clients will be assigned to different business sub-processes for processing, it is theoretically possible that the requests will be concentrated in a certain business sub-process. According to the statistical calculation of the client MAC address and actual testing, the probability of this happening is very small.

[0060] (3) Set up the port mapping function module and use Netfilter's HooK mechanism to capture client access request messages.

[0061] Specifically, the port mapping module is a kernel module. After the code is compiled, a .ko kernel driver is obtained. The ko module is loaded using insmod. After the module is started, the HOOK mechanism of the Netfilter of the Linux system will be used to capture the message of the client accessing the Web Portal service. The service port number is 3990, and the port mapping is obtained according to the client MAC address.

[0062] Assume that the destination port number of the client request message captured by the module is 3990, select the last byte of the client MAC address and the extended port number for modulo calculation (the modulo algorithm can discretely distribute different MAC addresses. The present invention uses the modulo algorithm to map different MAC address requests to different port numbers to avoid multiple requests being concentrated on a certain port number), add 3990 to the calculation result to obtain the port to be replaced, and the port determines which preset service process the request will be sent to for processing.

[0063] Furthermore, if 32 service ports are extended, and the currently captured client MAC address is 48-51-C5-70-9B-49, the service port number replaced by the request is 3999, and the client request will be processed by the preset sub-service bound to 3999. The calculation formula is as follows:

[0064] 1.0x49%32+3990=3999

[0065] (4) Use the extended service port calculated in step (3) to replace the original port number 3990. After modifying the port according to the TCP / UDP protocol requirements, only the TCP or UDP header checksum needs to be calculated, so the performance is still guaranteed.

[0066] (5) Replace the value of skb->dev in step (4) from eth1 to ed0 interface, and resubmit the skb to the system protocol stack so that the preset sub-service process bound to ed0 can receive the request.

[0067] Specifically, Skb represents a data packet in the Linux kernel code, and skb->dev indicates which network card the data packet comes from. If it is not replaced, the application will not be able to receive the data packet.

[0068] (6) After step (5), the preset service process can receive the client's request message from ed0, the business subroutine responds to the request according to the business processing logic, and sends the response message generated by the business logic processing module through ed0.

[0069] (7) After the port mapping module captures the response message sent to the client, it restores the extended port number in the message to 3990. The restoration operation method is the same as step (4), except that the mapped 3999 is restored to 3990, and then the sending interface of eth1 is called to send the message to the client.

[0070] The above steps complete a request and response interaction process, and the entire process is transparent and invisible to the client.

[0071] Preferably, the present embodiment also needs to be explained in detail that the present invention enables the server to have concurrent processing capabilities by pre-starting a number of service sub-processes with business functions. Compared with commonly used concurrent technologies, the code structure of the method of the present invention is simpler and can be compatible with existing codes. When a preset sub-service fails, the original service can still run normally, so the stability is higher.

[0072] Preferably, the present invention presets multiple sub-service processes and binds their respective service port numbers during the server initialization phase, and maps the original service port number to the sub-service port number based on the client identifier such as the MAC address. Compared with the process pool, the method of the present invention does not require sub-process scheduling and management, which is completely static. In addition, since each service sub-process is completely independent (including the port number), even if a sub-process fails, it will not affect the entire service.

[0073] Example 2

[0074] Reference Figure 4 and Figure 5 , which is the second embodiment of the present invention. This embodiment is different from the first embodiment in that it provides an experimental test of a concurrent processing method based on an embedded platform server, specifically including:

[0075] If the traditional server-side concurrent processing method runs on an embedded platform, the CPU, memory, and flash resources are relatively limited. The design idea of ​​the present invention is to make the server-side program static, and replace the dynamically applied sub-process with a static preset service sub-process. Each preset service process is bound to an extended port, and each sub-process is an independent server. The server discretely distributes several client requests to each sub-process for processing through the client identifier.

[0076] Preferably, each server software has an external port number, such as 80 for HTTP, 3306 for MySQL, and 21 and 22 for FTP. If the external port of a server software is 8000, the method of the present invention expands several service ports on the original basis. These expanded ports are transparent to the client, and the service port number is always 8000 from the client's point of view.

[0077] Reference Figure 4 ,The port mapping module uses a discrete algorithm to distribute client requests to various ,preset service processes for processing based on the client identifier (such as MAC address). ,The priority control ,function can also be easily implemented in this module.

[0078] This embodiment tests the open source Coovachilli software on an embedded development platform. Coova Chilli is a widely used Web Portal authentication (Captive Portal, UMA) and gateway solution, which can be embedded in a router or run as an independent service software. It has been integrated into the operating system Openwrt.

[0079] In order to verify the effectiveness of the present invention, on the same hardware platform, the CPU occupancy rates of the Coovachilli software using the present invention and the Coovachilli software not using the present invention when responding to the same number of QPS are compared.

[0080] Table 1: Experimental environment:.

[0081] Hardware Platform BCM4908 operating system Linux 3.6.7 WEBServer Coovachilli WEBClient IE

[0082] Test steps:

[0083] SS1: Download the coova-chilli source code from github, source code address;

[0084] SS2: compile and install coova-chilli software;

[0085] SS3: Use three PCs to connect to the LAN port of the BCM4908 platform router;

[0086] SS4: When a PC browser accesses an IP address such as 1.2.3.4, the coovachilli Web Portal authentication function will redirect the page request to a specified page such as: 192.168.0.1 / index.htm;

[0087] SS5: Set the PC's IE browser to automatically refresh, with an interval of 100ms;

[0088] SS6: The TOP command counts the BCM4908 CPU usage.

[0089] Table 2: Test results.

[0090] Table 2-1

[0091]

[0092] Table 2-2

[0093]

[0094] Table 2-3

[0095]

[0096] Referring to the contents of the above table, it can be intuitively seen from Table 2-1 that the Coovachilli software solution without using the present invention occupies a large amount of CPU resources, while the test results using the present invention are shown in Table 2-2, and the CPU occupancy rate is significantly reduced. It can be seen from the test results Table 2-3 that the method of the present invention enables the same hardware platform to access and process more business requests.

[0097] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose.

[0098] Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed collectively on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.

[0099] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or part thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques described in the present invention, the present invention also includes the computer itself. The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on a display.

[0100] As used in this application, the terms "component", "module", "system", etc. are intended to refer to a computer-related entity, which can be hardware, firmware, a combination of hardware and software, software, or software in operation. For example, a component can be, but is not limited to: a process running on a processor, a processor, an object, an executable file, a thread in execution, a program, and / or a computer. As an example, an application running on a computing device and the computing device can both be components. One or more components can exist in a process and / or thread in execution, and a component can be located in a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures thereon. These components can communicate in a local and / or remote process manner, such as according to a signal having one or more data packets (e.g., data from a component that interacts with another component in a local system, a distributed system, and / or interacts with other systems in a signal manner through a network such as the Internet).

[0101] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for improving the stability and concurrent processing capability of an embedded platform Socket server, characterized in that: include, Call the Linux system API socket to create a socket, API bind to bind the service port number, API accept to receive the request, and API fork to create a child process to handle the request; Run the redirection handler in the forked child process, and run several forked child processes at the same time to achieve concurrent processing; After the child process in the fork completes the directional processing program, the child process is released to complete a complete request processing flow; Specifically, the steps are as follows: (1) Add a virtual network card driver, virtual network card ed0; (2) When the program starts, several subprocesses are preset. Each subprocess corresponds to a listening port. The network card uses ed0. The original service is also bound to port 3990. The network card uses eth1. (3) Set up the port mapping module, use Netfilter's HooK mechanism to capture the client access request message, and calculate the extended service port based on the client's MAC address; (4) Use the extended service port calculated in step (3) to replace the original port number 3990. After modifying the port according to the TCP / UDP protocol requirements, calculate the TCP or UDP header checksum; (5) Replace the value of skb->dev in step (4) from eth1 to ed0 interface. The Skb represents a data packet in the Linux kernel code, and skb->dev indicates which network card the data packet comes from. If the replacement is not made, the application cannot receive the data packet. The skb is resubmitted to the system protocol stack, and the preset sub-service process bound to ed0 receives the request. (6) After step (5), the preset service process can receive the client's request message from ed0, the business subroutine responds to the request according to the business processing logic, and sends the response message generated by the business logic processing module through ed0; (7) After the port mapping module captures the response message sent to the client, it restores the extended port number in the message to 3990. The restoration operation method is the same as step (4), except that the mapped extended service port is restored to 3990, and then the sending interface of eth1 is called to send the message to the client.

2. The method for improving the stability and concurrent processing capability of the embedded platform Socket server according to claim 1, characterized in that: Also includes, In loop iteration, API accept receives the request, and API fork creates a child process to handle the request; Continuously receive requests from clients; When the client request interval is less than the time required for business processing, there will be multiple fork sub-processes, and the client is in a concurrent processing state.

3. The method for improving the stability and concurrent processing capability of the embedded platform Socket server according to claim 1, characterized in that: The port mapping module is a kernel module. After code compilation, a .ko kernel driver is obtained, and the ko module is loaded using insmod.

4. The method for improving the stability and concurrent processing capability of the embedded platform Socket server according to claim 3, characterized in that: After the ko module is started, the HOOK mechanism of Netfilter of the Linux system is used to capture the message of the client accessing the Web Portal service. The service port number is 3990, and the port mapping is obtained according to the client MAC address.

5. The method for improving the stability and concurrent processing capability of the embedded platform Socket server according to claim 4, characterized in that: Define the destination port number of the captured client request message as 3990, select the last byte of the client MAC address and the number of extended ports for modulo calculation, add 3990 to the result to get the port to be replaced, which determines which preset service process the request will be sent to for processing.

6. The method for improving the stability and concurrent processing capability of the embedded platform Socket server according to claim 5, characterized in that: If 32 service ports are extended, and the currently captured client MAC address is 48-51-C5-70-9B-49, the service port number requested to be replaced is 3999. The client request will be processed by the preset sub-service bound to 3999. The calculation formula is as follows: 0x49%32 + 3990 = 3999。

Citation Information

Patent Citations

  • Master-slave architecture server, service processing method thereof and service processing system thereof

    CN105337755A

  • Debugging method, electronic equipment and storage medium

    CN114020621A

  • Multi-process architecture for implementing a secure internet service

    US10805275B1

  • A method for the distribution of software processes to a plurality of computers

    WO2007144891A1

  • Routing nvme-over-fabric packets

    WO2020242474A1