Multi-thread data processing service method and system based on port multiplexing
By building a communication client profile database and optimizing algorithm to generate port communication strategies, the problems of low single thread efficiency and multi-thread memory overflow in UDP network communication are solved, and efficient communication between multi-communication clients and servers is achieved.
Patent Information
- Application Number
- CN202510733301.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-04
AI Technical Summary
In UDP network communication, single thread is inefficient when processing multiple clients. Multi-thread binding to multiple ports will cause memory overflow. How to achieve efficient communication between multi-communication clients and multi-communication servers in high concurrency scenarios.
By building a communication client portrait database, classifying requirements based on the communication feature set, combining the resource information of the communication server, using an optimization algorithm to generate port communication strategies, flexibly switch single-port single-threaded and single-port multi-threaded communication methods, and optimizing port thread communication methods and client objects.
The communication efficiency and quality under large-scale group communication are improved, the problems of single-thread inefficiency and multi-thread memory overflow are solved, and efficient communication is achieved.
Smart Images

Figure CN120263741A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technologies, and particularly to a multi-threaded data processing service method and system based on port multiplexing. Background Art
[0002] In UDP network communication, the data interaction process generally is that the data receiving party (server) uses a port as the data receiving port, and receives data by binding the socket to this interface. The data sending party (client) binds its own IP and port through the socket and uses UDP for network communication.
[0003] However, in the UDP usage mode of the server that needs to interact with multiple clients, the efficiency of a single thread in processing data of multiple clients is relatively low, and there will be a certain time delay; using multiple threads to bind multiple data receiving ports can solve the problem of too slow data receiving rate of a single thread. However, multiple data receiving ports will cause inconvenience to the client. In engineering applications, unless in special cases, the multi-port method is usually rarely adopted; using multiple threads to bind a single data receiving port to process data of multiple clients will, because it is necessary to allocate independent stack space for each thread, result in a large overhead of thread resources in a high-concurrency communication scenario and is prone to memory overflow problems.
[0004] Therefore, how to achieve efficient communication between multiple communication clients and multiple communication servers under large-scale group communication, adopt the optimal communication access strategy between the communication client and the communication server on the basis of reasonably selecting the port thread communication mode of the communication server, and improve the overall communication efficiency and communication quality is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] The main purpose of the present invention is to provide a multi-threaded data processing service method and system based on port multiplexing, aiming to solve at least one of the above technical problems.
[0006] To achieve the above purpose, the present invention provides a multi-threaded data processing service method based on port multiplexing, and the method includes the following steps: S1: Obtain the historical communication records between the communication client and the communication server, and extract the communication service association information of each communication client in the historical communication records; S2: Generate a client portrait for each communication client according to the communication service association information, and construct a communication client portrait database; wherein, the communication client portrait database stores a communication feature set composed of several communication features of each communication client; S3: Classify the communication requirements of each communication client during the target communication period based on the communication feature set of each communication client, and obtain the communication requirement categories of each communication client for each unit communication cycle during the target communication period; S4: Obtain the communication resource information of several communication servers during the target communication period, and generate a port communication strategy for each communication client and each communication server for each unit communication cycle during the target communication period according to the communication resource information and the communication requirement categories of each communication client; S5: Extract the port thread communication method of each communication server and the port communication object of each communication client for each unit communication cycle in the port communication strategy, and control the communication client and the communication server to perform service communication according to the corresponding port thread communication method during the target communication period.
[0007] Optionally, step S1: Obtain the historical communication records between the communication client and the communication server, and extract the communication service association information of each communication client in the historical communication records, specifically including: S11: Obtain the historical communication records between the communication client and the communication server; wherein, the historical communication records include the communication request information and communication period information of each service type when the communication client and the communication server perform historical communication services; S12: Generate the communication service association information of each communication client based on the communication request information and communication period information of each service type in the historical communication records.
[0008] Optionally, step S2: Generate a client portrait for each communication client according to the communication service association information, and construct a communication client portrait database, specifically including: S21: Extract the service quality parameters of the communication request information of each service type in the communication service association information, and query the delay tolerance threshold corresponding to each service type using the service quality parameters; S22: Extract the communication period information of each service type in the communication service association information, and determine the execution cycle period of each service type using the period mapping relationship between the communication period information and each unit communication cycle; S23: Generate a communication feature set for each communication client based on the delay tolerance threshold and execution cycle period of each service type, and construct a communication client portrait database.
[0009] Optionally, step S3: Classify the communication requirements of each communication client during the target communication period based on the communication feature set of each communication client, and obtain the communication requirement categories of each communication client for each unit communication cycle during the target communication period, specifically including: S31: Based on the communication feature sets of each communication client, use the pre-constructed communication demand prediction model to predict the communication demands of each communication client during the target communication period; S32: According to the communication demands of each communication client during the target communication period, classify the communication demands of the communication clients during the target communication period to obtain the communication demand categories of each communication client for each unit communication cycle during the target communication period.
[0010] Optionally, based on the communication feature sets of each communication client, using the pre-constructed communication demand prediction model to predict the communication demands of each communication client during the target communication period specifically includes: S311: Construct an initial LSTM model architecture including an input layer, a bidirectional LSTM layer, a Dropout layer, a unidirectional LSTM layer, and a fully connected layer, and configure the key parameters including the time step, the number of neurons in the LSTM layer, the optimizer type, and the loss function in the initial LSTM model architecture; S312: Divide the communication feature sets of each communication client into a training set and a validation set, and use the training set and the validation set to train the initial LSTM model architecture to obtain a trained communication demand prediction model; S313: Use the communication demand prediction model and the communication feature sets extracted from the historical communication records of each communication client to predict the communication demands of each communication client during the target communication period.
[0011] Optionally, step S32: According to the communication demands of each communication client during the target communication period, classify the communication demands of the communication clients during the target communication period to obtain the communication demand categories of each communication client for each unit communication cycle during the target communication period specifically includes: S321: Extract the communication demands of each communication client during the target communication period; wherein, the communication demands include the delay tolerance threshold for each unit communication cycle during the target communication period; S322: According to the communication demand category section to which the delay tolerance threshold belongs in the preset standard, assign the label of the communication demand category corresponding to the communication demand category section to which the delay tolerance threshold belongs to each unit communication cycle of each communication client during the target communication period.
[0012] Optionally, step S4: Obtain the communication resource information of several communication servers during the target communication period, and generate the port communication strategy of each communication client and each communication server for each unit communication cycle during the target communication period according to the communication resource information and the communication demand categories of each communication client, specifically including: S41: Obtain the communication resource information of several communication servers during the target communication period; wherein, the communication resource information includes the total thread stack space size corresponding to the to-be-allocated thread stack space resource and the communication data processing speed corresponding to the communication data processing resource; S42: According to the communication resource information of each communication server and the communication requirement categories of each communication client, construct a constraint condition set with the total thread stack space size, communication data processing speed, and communication quality, determine the optimization objective with the number of server communication switches, and use an optimization algorithm to solve the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle; S43: Based on the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle, generate the port communication strategy of each communication client and each communication server in each unit communication cycle during the target communication period.
[0013] Optionally, step S42: According to the communication resource information of each communication server and the communication requirement categories of each communication client, construct a constraint condition set with the total thread stack space size, communication data processing speed, and communication quality, determine the optimization objective with the number of server communication switches, and use an optimization algorithm to solve the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle, specifically including: S421: According to the thread stack memory size and communication data processing speed of each communication server, consider the communication requirement categories of each communication client in each unit communication cycle during the target communication period; S422: Take the product of the number of communication clients allocated to each communication server divided into the single-port multi-thread communication mode in each unit communication cycle and the standard thread stack space size being less than the total thread stack space size corresponding to this communication server as the first constraint condition, and take that for each communication server divided into the single-port single-thread communication mode, there is at least one unit communication cycle among consecutive target number of unit communication cycles that satisfies: the sum of the standard data communication volumes of all allocated communication clients is less than the data communication processing volume determined by the product of the communication data processing speed and the unit communication cycle as the second constraint condition, take the proportion of each communication client being allocated to the port thread communication mode corresponding to the communication requirement category in each unit communication cycle during the target communication period exceeding the preset communication quality threshold proportion as the third constraint condition, and take the minimum number of times of switching communication servers by all communication servers during the target communication period as the optimization objective; S423: Use an optimization algorithm to optimize and solve the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle.
[0014] Optionally, step S5: Extract the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle in the port communication policy, and control the communication client and the communication server to perform service communication according to the corresponding port thread communication method during the target communication period, specifically including: S51: Extract the port thread communication method of each communication server in the port communication policy to control each communication server to select the corresponding port thread communication method during the target communication period; S52: Extract the port communication object of each communication client in each unit communication cycle in the port communication policy, and control the communication client to switch the communication server with which it communicates in the corresponding unit communication cycle to complete the service communication process.
[0015] In addition, to achieve the above object, the present invention also provides a multi-threaded data processing service system based on port multiplexing, including: An acquisition module, configured to acquire the historical communication records of the communication client and the communication server, and extract the communication service association information of each communication client in the historical communication records; A construction module, configured to generate a client portrait of each communication client according to the communication service association information, and construct a communication client portrait database; wherein, the communication client portrait database stores a communication feature set composed of a plurality of communication features of each communication client; A classification module, configured to classify the communication requirements of the communication client during the target communication period based on the communication feature set of each communication client, and obtain the communication requirement category of each communication client in each unit communication cycle during the target communication period; A generation module, configured to acquire the communication resource information of a plurality of communication servers during the target communication period, and generate a port communication policy of each communication client and each communication server in each unit communication cycle during the target communication period according to the communication resource information and the communication requirement category of each communication client; A communication module, configured to extract the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle in the port communication policy, and control the communication client and the communication server to perform service communication according to the corresponding port thread communication method during the target communication period.
[0016] The beneficial effects of the present invention are as follows: A multi-threaded data processing service method and system based on port multiplexing are proposed. By obtaining the historical communication records between communication clients and communication servers, extracting communication service association information, constructing a communication client profile database, classifying the communication requirements of each communication client in each unit communication cycle during the target communication period based on the communication feature set of each communication client in the communication client profile database, and considering the communication resource information of the communication server and the communication requirement categories of the communication clients, taking into account the total thread stack space size corresponding to the thread stack space resources to be allocated in the communication resource information of the communication server and the communication data processing speed corresponding to the communication data processing resources, constructing a constraint condition set with the total thread stack space size, communication data processing speed, and communication quality, determining the optimization target with the number of server communication switches, using an optimization algorithm to solve the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle, generating a port communication strategy, and thus controlling the port thread communication method of the communication server during the target communication period and the communication client switching to the best port communication object to execute business communication in each unit communication cycle. Therefore, by integrating the communication resource information of all communication servers and the communication requirement categories of communication clients, adopting a flexible switching and selection method of single-port single-thread communication and single-port multi-thread communication, taking into account both communication quality and communication efficiency, on the basis of reasonably selecting the port thread communication method of the communication server, adopting the optimal communication access strategy between the communication client and the communication server, improving the overall communication efficiency and communication quality, and realizing efficient communication between multiple communication clients and multiple communication servers under large-scale group communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of the multi-threaded data processing service method based on port multiplexing of the present invention; Figure 2 It is a structural diagram of the multi-threaded data processing service system based on port multiplexing of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0019] An embodiment of the present invention provides a multi-threaded data processing service method based on port multiplexing, referring to Figure 1 , Figure 1 It is a schematic flow diagram of an embodiment of the multi-threaded data processing service method based on port multiplexing of the present invention.
[0020] In this embodiment, a multi-threaded data processing service method based on port multiplexing includes the following steps: S1: Obtain the historical communication records between the communication client and the communication server, and extract the communication service association information of each communication client in the historical communication records; S2: Generate a client profile for each communication client according to the communication service association information, and construct a communication client profile database; wherein, the communication client profile database stores a communication feature set composed of several communication features of each communication client; S3: Classify the communication requirements of the communication client during the target communication period based on the communication feature set of each communication client, and obtain the communication requirement category of each communication client in each unit communication cycle during the target communication period; S4: Obtain the communication resource information of several communication servers during the target communication period, and generate a port communication policy for each communication client and each communication server in each unit communication cycle during the target communication period according to the communication resource information and the communication requirement category of each communication client; S5: Extract the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle in the port communication policy, and control the communication client and the communication server to perform service communication according to the corresponding port thread communication method during the target communication period.
[0021] It should be noted that in the UDP usage mode of the server that needs to interact with multiple clients, the single-threaded efficiency is relatively low when processing data of multiple clients, and there will be a certain time delay; using multiple threads to bind multiple data receiving ports can solve the problem of too slow single-threaded data receiving rate. However, multiple data receiving ports will cause inconvenience to the client. In engineering applications, unless in special cases, the multi-port method is usually rarely adopted; using multiple threads to bind a single data receiving port to process data of multiple clients will, due to the need to allocate independent stack space for each thread, result in a large overhead of thread resources in a high-concurrency communication scenario and is prone to memory overflow problems.
[0022] To solve the above problems, in this embodiment, a communication client portrait database is constructed, and the communication requirements of each communication client are classified for each unit communication cycle during the target communication period. Considering the to-be-allocated thread stack space resources and communication data processing resources of the communication server, a constraint condition set is constructed based on the total thread stack space size, communication data processing speed, and communication quality. With the optimization goal determined by the number of server communication switches, the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle are optimized and solved. By integrating resources and requirements, a flexible switching and selection method of single-port single-thread communication and single-port multi-thread communication is adopted, taking into account both communication quality and communication efficiency, to achieve efficient communication between multiple communication clients and multiple communication servers under large-scale group communication.
[0023] In a preferred embodiment, step S1: Obtain the historical communication records of the communication client and the communication server, and extract the communication service association information of each communication client in the historical communication records, specifically including: S11: Obtain the historical communication records of the communication client and the communication server; wherein, the historical communication records include the communication request information and communication period information of each service type when the communication client and the communication server perform historical communication services. S12: Generate the communication service association information of each communication client based on the communication request information and communication period information of each service type in the historical communication records.
[0024] On this basis, step S2: Generate the client portrait of each communication client according to the communication service association information, and construct a communication client portrait database, specifically including: S21: Extract the service quality parameters of the communication request information of each service type in the communication service association information, and query the delay allowance threshold corresponding to each service type by using the service quality parameters. S22: Extract the communication period information of each service type in the communication service association information, and determine the execution cycle period of each service type by using the period cycle mapping relationship between the communication period information and each unit communication cycle. S23: Generate the communication feature set of each communication client based on the delay allowance threshold and execution cycle period of each service type, and construct a communication client portrait database.
[0025] In this embodiment, by obtaining the historical communication records between the communication client and the communication server, extracting the communication request information and communication time period information of each service type when the historical communication service is executed between the communication client and the communication server from the historical communication records, and then determining the corresponding delay tolerance threshold (for example, ≤100 ms) by extracting the quality of service parameters (such as QoS parameters), and extracting the communication time period of each service type to determine the execution cycle time period (for example, 9:00-11:00 every day), so as to generate the communication feature set of each communication client and further construct the communication client portrait database.
[0026] In a preferred embodiment, step S3: Based on the communication feature set of each communication client, classify the communication requirements of the communication client during the target communication time period, and obtain the communication requirement category of each communication client for each unit communication cycle during the target communication time period, specifically including: S31: Based on the communication feature set of each communication client, use the pre-constructed communication requirement prediction model to predict the communication requirements of each communication client during the target communication time period; S32: According to the communication requirements of each communication client during the target communication time period, classify the communication requirements of the communication client during the target communication time period, and obtain the communication requirement category of each communication client for each unit communication cycle during the target communication time period.
[0027] Furthermore, based on the communication feature set of each communication client, use the pre-constructed communication requirement prediction model to predict the communication requirements of each communication client during the target communication time period, specifically including: S311: Construct an initial LSTM model architecture including an input layer, a bidirectional LSTM layer, a Dropout layer, a unidirectional LSTM layer, and a fully connected layer, and configure the key parameters including the time step, the number of neurons in the LSTM layer, the optimizer type, and the loss function in the initial LSTM model architecture; S312: Divide the communication feature set of each communication client into a training set and a validation set, and use the training set and the validation set to train the initial LSTM model architecture to obtain a trained communication requirement prediction model; S313: Use the communication requirement prediction model and the communication feature set extracted from the historical communication records of each communication client to predict the communication requirements of each communication client during the target communication time period.
[0028] Furthermore, step S32: According to the communication requirements of each communication client during the target communication time period, classify the communication requirements of the communication client during the target communication time period, and obtain the communication requirement category of each communication client for each unit communication cycle during the target communication time period, specifically including: S321: Extract the communication requirements of each communication client during the target communication period; wherein, the communication requirements include the delay tolerance threshold for each unit communication cycle during the target communication period. S322: According to the communication requirement category section to which the delay tolerance threshold belongs in the preset standard, assign the label of the communication requirement category corresponding to the communication requirement category section to which the delay tolerance threshold belongs to each communication client for each unit communication cycle during the target communication period.
[0029] In this embodiment, using the communication feature set of each communication client, a communication requirement prediction model based on the LSTM model architecture is used to predict the communication requirements of each communication client during the target communication period, and the communication requirements of each communication client for each unit communication cycle during the target communication period are classified. This classification process is used to balance communication quality and communication efficiency by integrating resources and requirements and adopting the method of flexibly switching and selecting single-port single-thread communication and single-port multi-thread communication.
[0030] In a preferred embodiment, step S4: Obtain the communication resource information of several communication servers during the target communication period, and generate the port communication strategy of each communication client and each communication server for each unit communication cycle during the target communication period according to the communication resource information and the communication requirement category of each communication client, specifically including: S41: Obtain the communication resource information of several communication servers during the target communication period; wherein, the communication resource information includes the total thread stack space size corresponding to the thread stack space resource to be allocated and the communication data processing speed corresponding to the communication data processing resource. S42: According to the communication resource information of each communication server and the communication requirement category of each communication client, construct a constraint condition set with the total thread stack space size, communication data processing speed, and communication quality, determine the optimization target with the server communication switching times, and use an optimization algorithm to solve the port thread communication method of each communication server and the port communication object of each communication client for each unit communication cycle. S43: Based on the port thread communication method of each communication server and the port communication object of each communication client for each unit communication cycle, generate the port communication strategy of each communication client and each communication server for each unit communication cycle during the target communication period.
[0031] Further, step S42: According to the communication resource information of each communication server and the communication requirement categories of each communication client, a constraint condition set is constructed based on the total thread stack space size, communication data processing speed, and communication quality. The optimization objective is determined by the number of server communication switches. An optimization algorithm is used to solve the port thread communication mode of each communication server and the port communication object of each communication client in each unit communication cycle, specifically including: S421: According to the thread stack memory size and communication data processing speed of each communication server, consider the communication requirement categories of each communication client in each unit communication cycle during the target communication period; S422: Take the product of the number of communication clients assigned to each communication server with a single-port multi-thread communication mode in each unit communication cycle and the standard thread stack space size being less than the total thread stack space size corresponding to this communication server as the first constraint condition. Take that for each communication server with a single-port single-thread communication mode, there is at least one unit communication cycle in a continuous target number of unit communication cycles that satisfies: the sum of the standard data communication volumes of all assigned communication clients is less than the data communication processing volume determined by the product of the communication data processing speed and the unit communication cycle as the second constraint condition. Take the proportion of each communication client being assigned to the port thread communication mode corresponding to the communication requirement category in each unit communication cycle during the target communication period exceeding the preset communication quality threshold ratio as the third constraint condition. Take the minimum number of times of switching communication servers by all communication servers during the target communication period as the optimization objective; S423: Use an optimization algorithm to optimize and solve the port thread communication mode of each communication server and the port communication object of each communication client in each unit communication cycle.
[0032] In this embodiment, according to the communication resource information of the communication server and the communication requirement categories of the communication client, considering the total thread stack space size corresponding to the thread stack space resource to be allocated in the communication resource information of the communication server and the communication data processing speed corresponding to the communication data processing resource, a constraint condition set is constructed based on the total thread stack space size, communication data processing speed, and communication quality. The optimization objective is determined by the number of server communication switches. An optimization algorithm is used to solve the port thread communication mode of each communication server and the port communication object of each communication client in each unit communication cycle, generating a port communication strategy, thereby controlling the port thread communication mode of the communication server and the best port communication object for the communication client to switch in each unit communication cycle to execute service communication during the target communication period.
[0033] In a preferred embodiment, step S5: Extract the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle from the port communication policy, and control the communication client and the communication server to perform service communication according to the corresponding port thread communication method during the target communication period, which specifically includes: S51: Extract the port thread communication method of each communication server from the port communication policy to control each communication server to select the corresponding port thread communication method during the target communication period; S52: Extract the port communication object of each communication client in each unit communication cycle from the port communication policy, and control the communication client to switch the communication server with which it communicates in the corresponding unit communication cycle to complete the service communication process.
[0034] In this embodiment, by integrating the communication resource information of all communication servers and the communication demand categories of communication clients, and adopting the method of flexibly switching and selecting single-port single-thread communication and single-port multi-thread communication, taking into account both communication quality and communication efficiency, on the basis of reasonably selecting the port thread communication method of the communication server, adopting the optimal communication access strategy between the communication client and the communication server, improving the overall communication efficiency and communication quality, and realizing efficient communication between multiple communication clients and multiple communication servers under large-scale group communication.
[0035] Refer to Figure 2 , Figure 2 which is the structural block diagram of the embodiment of the multi-threaded data processing service system based on port multiplexing of the present invention.
[0036] As Figure 2 shown, the multi-threaded data processing service system based on port multiplexing proposed in the embodiment of the present invention includes: An acquisition module 10, configured to acquire the historical communication records of the communication client and the communication server, and extract the communication service association information of each communication client from the historical communication records; A construction module 20, configured to generate a client portrait of each communication client according to the communication service association information, and construct a communication client portrait database; wherein, the communication client portrait database stores a communication feature set composed of several communication features of each communication client; A classification module 30, configured to classify the communication requirements of the communication client during the target communication period based on the communication feature set of each communication client, and obtain the communication requirement category of each communication client in each unit communication cycle during the target communication period; A generation module 40, configured to obtain communication resource information of a plurality of communication servers within a target communication period, and generate a port communication policy for each communication client and each communication server within each unit communication cycle in the target communication period according to the communication resource information and the communication requirement categories of each communication client. A communication module 50, configured to extract the port thread communication modes of each communication server and the port communication objects of each communication client within each unit communication cycle in the port communication policy, and control the communication clients and the communication servers to perform service communication according to the corresponding port thread communication modes within the target communication period.
[0037] For other embodiments or specific implementation manners of the multi-threaded data processing service system based on port multiplexing of the present invention, reference may be made to the above method embodiments, which will not be elaborated herein.
[0038] It can be understood that in the description of this specification, the descriptions with reference to terms such as "one embodiment", "another embodiment", "other embodiments", or "the first embodiment to the Nth embodiment" mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0039] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or system including the element.
[0040] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A multi-threaded data processing service method based on port multiplexing, characterized in that The method includes the following steps: S1: Obtain the historical communication records between the communication client and the communication server, and extract the communication service association information of each communication client in the historical communication records; S2: Generate a client portrait for each communication client according to the communication service association information, and construct a communication client portrait database; wherein, the communication client portrait database stores a communication feature set composed of several communication features of each communication client; S3: Classify the communication requirements of the communication client during the target communication period based on the communication feature set of each communication client, and obtain the communication requirement categories of each communication client in each unit communication cycle during the target communication period; S4: Obtain the communication resource information of several communication servers during the target communication period, and generate a port communication policy for each communication client and each communication server in each unit communication cycle during the target communication period according to the communication resource information and the communication requirement categories of each communication client; S5: Extract the port thread communication mode of each communication server and the port communication object of each communication client in each unit communication cycle in the port communication policy, and control the communication client and the communication server to perform service communication according to the corresponding port thread communication mode during the target communication period.
2. The multi-threaded data processing service method based on port multiplexing according to claim 1, wherein Step S1: Obtain the historical communication records between the communication client and the communication server, and extract the communication service association information of each communication client in the historical communication records, specifically including: S11: Obtain the historical communication records between the communication client and the communication server; wherein, the historical communication records include the communication request information and communication period information of each service type when the communication client and the communication server perform historical communication services; S12: Generate the communication service association information of each communication client based on the communication request information and communication period information of each service type in the historical communication records.
3. The multi-threaded data processing service method based on port multiplexing according to claim 1, characterized in that Step S2: Generate a client portrait for each communication client according to the communication service association information, and construct a communication client portrait database, specifically including: S21: Extract the service quality parameters of the communication request information of each service type in the communication service association information, and query the delay tolerance threshold corresponding to each service type by using the service quality parameters; S22: Extract the communication period information of each service type in the communication service association information, and determine the execution period of each service type by using the period mapping relationship between the communication period information and each unit communication cycle; S23: Generate a communication feature set for each communication client based on the delay tolerance threshold and execution period of each service type, and construct a communication client portrait database.
4. The multi-threaded data processing service method based on port multiplexing according to claim 1, characterized in that Step S3: Classify the communication requirements of the communication client during the target communication period based on the communication feature set of each communication client, and obtain the communication requirement categories of each communication client in each unit communication cycle during the target communication period, specifically including: S31: Predict the communication requirements of each communication client during the target communication period by using the pre-constructed communication requirement prediction model based on the communication feature set of each communication client; S32: Classify the communication requirements of each communication client during the target communication period according to the communication requirements of each communication client during the target communication period, and obtain the communication requirement category of each communication client in each unit communication cycle during the target communication period.
5. The multi-threaded data processing service method based on port multiplexing according to claim 4, characterized in that Based on the communication feature set of each communication client, use the pre-constructed communication requirement prediction model to predict the communication requirements of each communication client during the target communication period, specifically including: S311: Construct an initial LSTM model architecture including an input layer, a bidirectional LSTM layer, a Dropout layer, a unidirectional LSTM layer, and a fully connected layer, and configure the key parameters including the time step, the number of neurons in the LSTM layer, the optimizer type, and the loss function in the initial LSTM model architecture; S312: Divide the communication feature set of each communication client into a training set and a validation set, and use the training set and the validation set to train the initial LSTM model architecture to obtain a trained communication requirement prediction model; S313: Use the communication requirement prediction model and the communication feature set extracted from the historical communication records of each communication client to predict the communication requirements of each communication client during the target communication period.
6. The multi-threaded data processing service method based on port multiplexing according to claim 4, wherein Step S32: Classify the communication requirements of each communication client during the target communication period according to the communication requirements of each communication client during the target communication period, and obtain the communication requirement category of each communication client in each unit communication cycle during the target communication period, specifically including: S321: Extract the communication requirements of each communication client during the target communication period; wherein, the communication requirements include the delay tolerance threshold for each unit communication cycle during the target communication period; S322: According to the communication requirement category section to which the delay tolerance threshold belongs in the preset standard, assign the label of the communication requirement category corresponding to the communication requirement category section to which the delay tolerance threshold belongs to each communication client in each unit communication cycle during the target communication period.
7. The multi-threaded data processing service method based on port multiplexing according to claim 1, wherein Step S4: Obtain the communication resource information of several communication servers during the target communication period, and generate the port communication strategy of each communication client and each communication server in each unit communication cycle during the target communication period according to the communication resource information and the communication requirement category of each communication client, specifically including: S41: Obtain the communication resource information of several communication servers during the target communication period; wherein, the communication resource information includes the total thread stack space size corresponding to the thread stack space resource to be allocated and the communication data processing speed corresponding to the communication data processing resource; S42: According to the communication resource information of each communication server and the communication requirement category of each communication client, construct a constraint condition set with the total thread stack space size, the communication data processing speed, and the communication quality, determine the optimization target with the number of server communication switches, and use the optimization algorithm to solve the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle. S43: Generate the port communication strategy for each communication client and each communication server in each unit communication cycle during the target communication period based on the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle.
8. The multi-threaded data processing service method based on port multiplexing according to claim 7, wherein Step S42: According to the communication resource information of each communication server and the communication requirement categories of each communication client, construct a constraint condition set with the total thread stack space size, communication data processing speed, and communication quality, determine the optimization objective based on the number of server communication switches, and use an optimization algorithm to solve the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle. Specifically, it includes: S421: According to the thread stack memory size and communication data processing speed of each communication server, consider the communication requirement categories of each communication client in each unit communication cycle during the target communication period; S422: Take the product of the number of communication clients assigned to each communication server with a single-port multi-thread communication method in each unit communication cycle and the standard thread stack space size being less than the total thread stack space size corresponding to this communication server as the first constraint condition, and take that for each communication server with a single-port single-thread communication method, there is at least one unit communication cycle in a continuous target number of unit communication cycles that satisfies: the sum of the standard data communication volumes of all assigned communication clients is less than the data communication processing volume determined by the product of the communication data processing speed and the unit communication cycle as the second constraint condition, take the proportion of each communication client being assigned to the port thread communication method corresponding to its communication requirement category in each unit communication cycle during the target communication period exceeding the preset communication quality threshold ratio as the third constraint condition, and take the minimum number of times of switching communication servers by all communication servers during the target communication period as the optimization objective; S423: Use an optimization algorithm to optimize and solve the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle.
9. The multi-threaded data processing service method based on port multiplexing according to claim 1, wherein Step S5: Extract the port thread communication method of each communication server and the port communication object of each communication client in each unit communication cycle in the port communication strategy, and control the communication client and the communication server to perform business communication according to the corresponding port thread communication method during the target communication period. Specifically, it includes: S51: Extract the port thread communication method of each communication server in the port communication strategy to control each communication server to select the corresponding port thread communication method during the target communication period; S52: Extract the port communication object of each communication client in each unit communication cycle in the port communication strategy, and control the communication client to switch the communication server it communicates with in the corresponding unit communication cycle to complete the business communication process.
10. A multi-threaded data processing service system based on port multiplexing, characterized in that, It includes: An acquisition module, used to acquire the historical communication records of the communication client and the communication server, and extract the communication service association information of each communication client in the historical communication records; A building module for generating a client portrait of each communication client according to the communication service association information and building a communication client portrait database; wherein, the communication client portrait database stores a communication feature set composed of a number of communication features of each communication client; A classification module for classifying the communication requirements of communication clients during a target communication period based on the communication feature set of each communication client, and obtaining the communication requirement categories of each communication client in each unit communication cycle during the target communication period; A generation module for obtaining the communication resource information of a number of communication servers during the target communication period, and generating a port communication strategy for each communication client and each communication server in each unit communication cycle during the target communication period according to the communication resource information and the communication requirement categories of each communication client; A communication module for extracting the port thread communication mode of each communication server and the port communication object of each communication client in each unit communication cycle in the port communication strategy, and controlling the communication client and the communication server to perform service communication according to the corresponding port thread communication mode during the target communication period.
Citation Information
Patent Citations
Data communication method, device and system
CN104079398A
Multi-channel multiplexing and communication mode Internet of Things operating system based on uniform interface
CN114760336A
Port multiplexing method based on cloud game server, processing equipment and storage medium
CN115842849A
Video stream processing method and device, nonvolatile storage medium and electronic equipment
CN118337764A
APPARATUSES AND METHODS FOR MULTILANE UNIVERSAL SERIAL BUS (USB2) COMMUNICATION OVER EMBEDDED UNIVERSAL SERIAL BUS (eUSB2)
US20180189222A1