Communication method, service processing system and communication middleware
Through a layered communication middleware architecture, efficient, reliable, and scalable heterogeneous communication among multiple clients in semiconductor devices is achieved. This solves the problem of communication complexity affecting business processing in existing technologies and improves the control precision and production efficiency of equipment operation.
Patent Information
- Application Number
- CN202611287151.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-06
AI Technical Summary
In semiconductor equipment, existing technologies struggle to achieve efficient, reliable, and scalable communication in heterogeneous communication scenarios between multiple clients, impacting the control precision and production efficiency of equipment operation.
The communication middleware architecture is deployed in a layered manner, including a business layer, a plug-in layer and a transport layer. The plug-in layer manages multiple communication protocols and connection objects, thereby decoupling the functions of business processing and communication transmission, and supporting multi-protocol compatibility and dynamic expansion.
It reduces the coupling between the business layer and the communication middleware, improves the scalability of the communication middleware and the reusability of connection objects, enhances the versatility of the communication architecture and the flexibility of business iteration, and ensures the focus and efficiency of business processing.
Smart Images

Figure CN123055790A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of semiconductor technology, and in particular to a communication method, a service processing system, and a communication middleware. Background Technology
[0002] In semiconductor equipment control systems, efficient and reliable collaborative communication is required between multiple clients to ensure that each client can obtain and process business processing requests in real time. This communication is a key foundation for achieving precise control and stable operation of semiconductor equipment, directly affecting the control accuracy and production efficiency of the equipment. Therefore, a communication method is needed to meet the requirements of efficient, reliable, and scalable communication in multi-client heterogeneous communication scenarios. Summary of the Invention
[0003] This disclosure provides a communication method, a business processing system, and a communication middleware to at least meet the needs of efficient, reliable, and scalable communication in multi-client heterogeneous communication scenarios.
[0004] According to a first aspect of the present disclosure, a communication method is provided, applied to a first client. The first client deploys a service layer and a first communication middleware. The first communication middleware includes a first interface layer, a first plugin layer, and a first transport layer. The first plugin layer includes client plugins corresponding to various communication protocols, and a first connection object created by the client plugins. The method includes: The business layer calls the sending interface of the first interface layer to send the first business processing request to the first plug-in layer. The first business processing request includes at least a first business instruction, an identifier of the target communication protocol, and an identifier of the second client. The first plugin layer loads the client plugin of the target communication protocol according to the first mapping relationship between the maintained communication protocol identifier and the client plugin, and determines the first connection object for sending the first service processing request; The first transport layer, based on the target communication protocol, sends the first service processing request to the second connection object of the server through the first connection object, so that the server forwards the first service processing request to the second client; the second connection object is created by the server plugin corresponding to the target communication protocol.
[0005] According to a second aspect of the present disclosure, another communication method is provided, applied to a server. The server deploys a centralized routing layer and a second communication middleware. The second communication middleware includes a second plugin layer, a first transport layer, and a second transport layer. The second plugin layer includes server plugins corresponding to various communication protocols, and a second connection object and a third connection object created by the server plugins. The second connection object communicates with a first connection object of a client through the first transport layer. The method includes: The first transport layer receives a first service processing request sent by the first connection object through the second connection object. The first service processing request includes at least a first service instruction, an identifier of the target communication protocol, and an identifier of the second client. The centralized routing layer determines the session corresponding to the second client based on the maintained third mapping relationship between client identifiers and client sessions; and determines the third connection object for forwarding the first service processing request based on the session corresponding to the second client. The second transport layer, based on the target communication protocol, sends the first service processing request to the fourth connection object of the second client through the third connection object, so that the second client executes the first service instruction; wherein, the third connection object communicates and transmits with the fourth connection object through the second transport layer; the fourth connection object is created by the client plugin of the target communication protocol located on the second client.
[0006] According to a third aspect of the present disclosure, a business processing system is provided, the business processing system including a plurality of clients and servers; Each of the aforementioned clients is deployed with a service layer and a first communication middleware, the first communication middleware including a first interface layer, a first plug-in layer and a first transport layer; The server is deployed with a centralized routing layer and a second communication middleware, the second communication middleware including a second plug-in layer, a first transport layer and a second transport layer; The first interface layer is used to provide a communication interface between the business layer and the first plug-in layer; The first plugin layer includes client plugins corresponding to various communication protocols, and a first connection object created by the client plugins. The first plugin layer is used to maintain a first mapping relationship between communication protocol identifiers and client plugins; the client plugins are used to maintain a second mapping relationship between connection object identifiers and client connection objects. The second plugin layer includes server-side plugins corresponding to various communication protocols, as well as a second connection object and a third connection object created by the server-side plugins; The first transport layer is used to send and receive data through the first connection object and the second connection object based on the corresponding communication protocol; The second transport layer is used to send and receive data through the third connection object and the first connection object based on the corresponding communication protocol; The centralized routing layer is used to maintain a third mapping relationship between client identifiers and client sessions.
[0007] According to a fourth aspect of the present disclosure, a communication middleware is provided, the communication middleware including an interface layer, a plug-in layer and a transport layer; The interface layer is used to provide a communication interface for interaction with the business layer; The plugin layer includes plugins corresponding to various communication protocols, and connection objects created by the plugins. The plugins include client plugins and server plugins. The client plugins are used to create a first connection object on the client side, and the server plugins are used to create a second connection object on the server side. The first connection object is used to communicate and transmit with the second connection object. The transport layer is used to realize communication transmission between the first connection object and the second connection object based on the communication protocol corresponding to the service layer.
[0008] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method as described in any one of the first aspects above.
[0009] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided such that, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method described in any of the first aspects of the present disclosure. According to a seventh aspect of the present disclosure, a computer program product including instructions is provided that, when run on a computer, causes the computer to perform the method described in any of the first aspects of the present disclosure.
[0010] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects: The first client decouples business processing from communication transmission by deploying the business layer and the first communication middleware in a layered manner. The business layer only needs to call the sending interface to send the first business processing request and specify the identifier of the target communication protocol. It does not need to know the underlying communication protocol and other transmission details. The first plug-in layer automatically completes the loading of the client plug-in and the determination of the first connection object. Then, the first transport layer adapts to the corresponding communication protocol to complete the sending of the first business processing request to the second connection object on the server. This allows the business layer to only be responsible for generating business instructions without intervening in the communication execution logic. It also supports multiple communication protocols with the help of the plug-in architecture. When adding a new communication protocol, only the corresponding client plug-in needs to be added to complete the adaptation. The entire process does not require the business layer to know the differences in the underlying communication protocols. This reduces the coupling between the business layer and the communication middleware, improves the scalability of the communication middleware and the reusability of connection objects, reduces the cost of business development and multi-protocol compatibility transformation, and effectively improves the versatility of the client communication architecture and the flexibility of business iteration. This achieves the separation of business processing and communication implementation, ensuring that the focus and execution efficiency of business processing are not affected by the complexity of the communication architecture.
[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0012] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0013] Figure 1 This is a system architecture diagram of a first client according to an exemplary embodiment; Figure 2 This is a schematic diagram illustrating a process of a first client sending a first service processing request according to an exemplary embodiment; Figure 3 This is a schematic diagram illustrating a first request processing unit according to an exemplary embodiment, which processes a first business processing request based on a preset processing command and sends the processed first business processing request to a first plug-in layer through a sending interface. Figure 4 This is a schematic diagram illustrating a process of a service layer according to an exemplary embodiment, which obtains first response information and determines the processing result of a first service instruction based on the first response information. Figure 5 This is a schematic diagram illustrating a process of generating a new client connection object corresponding to a first new communication protocol and generating a second mapping relationship between the identifier of the new client connection object and the new client connection object, according to an exemplary embodiment. Figure 6 This is a system architecture diagram of the server according to an exemplary embodiment; Figure 7 This is a schematic diagram illustrating a process of a server forwarding a first business processing request according to an exemplary embodiment; Figure 8 This is a schematic diagram illustrating a process of sending first response information to a first connection object through a second connection object in a first transport layer according to an exemplary embodiment; Figure 9 This is a schematic diagram illustrating a process of adding the correspondence between newly added server connection objects and newly added client connection objects to a third mapping relationship in a centralized routing layer according to an exemplary embodiment; Figure 10 This is a system architecture diagram of a business processing system according to an exemplary embodiment; Figure 11 This is a block diagram illustrating an electronic device for communication according to an exemplary embodiment. Detailed Implementation
[0014] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0015] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar different contents and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0016] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0017] Figure 1 This is a system architecture diagram of a first client according to an exemplary embodiment. The first client deploys a business layer, a first communication middleware, and a request processing layer. The first communication middleware includes a first interface layer, a first plugin layer, and a first transport layer. The first plugin layer includes client plugins corresponding to various communication protocols, and a first connection object created by the client plugins.
[0018] Specifically, the first client is applied within the semiconductor equipment. The first client can be a functional board within the semiconductor equipment. It interconnects with other clients belonging to the same functional board within the semiconductor equipment through a first communication middleware. It can proactively send service processing requests to other clients, driving the corresponding clients to execute the operations corresponding to those requests, and it can also receive service processing requests initiated by other clients and execute the operations corresponding to those requests. The first client can also be a master control program node within the semiconductor equipment. It similarly establishes communication with other clients based on the first communication middleware, sending service processing requests to clients that are functional boards and driving the corresponding clients to execute related operations, but it does not receive service processing requests proactively initiated by other clients.
[0019] The business layer is used to generate and issue the first business processing request, and does not participate in the underlying communication. The first communication middleware is further divided into three sub-layers: the first interface layer provides a sending interface, enabling the business layer to issue the first business processing request based on this sending interface without being aware of the differences in the underlying protocols; the first plugin layer is responsible for managing the client plugins corresponding to various communication protocols, with each client plugin corresponding to a communication protocol type. The first plugin layer maintains the first mapping relationship between the communication protocol identifier and the client plugin. At the same time, the client plugin is used to create and manage a unique first connection object under the corresponding communication protocol, and maintains the second mapping relationship between the connection object identifier under the corresponding communication protocol and the first connection object, realizing the dynamic loading of plugins and the on-demand reuse of connection objects; the first transport layer performs data sending and receiving based on the corresponding communication protocol and through the connection object under that communication protocol.
[0020] The request processing layer includes at least one request processing unit, each request processing unit corresponds to a preset command identifier range, and the request processing unit is used to execute the preset processing command.
[0021] In a specific embodiment, such as Figure 2 As shown, the process of the first client sending the first service processing request to the second client is as follows: Step S201: The business layer calls the sending interface of the first interface layer to send the first business processing request to the first plugin layer.
[0022] In one specific embodiment, the first service processing request includes at least a first service instruction, an identifier of the target communication protocol, and an identifier of the second client.
[0023] Specifically, the first business instruction is used to indicate the specific business operation to be performed; the target communication protocol identifier is used to characterize the type of communication protocol used in the business processing request; and the second client identifier is used to characterize the recipient that receives and processes the first business processing request.
[0024] In one specific embodiment, the first business processing request further includes a first business type identifier, and the first client also deploys a request processing layer, which includes at least one request processing unit. Each request processing unit corresponds to a preset command identifier range, and the request processing unit is used to execute a preset processing command.
[0025] Specifically, the first business type identifier is used to characterize the business category to which the first business processing request belongs. The request processing unit is responsible for processing all business processing requests within the corresponding command identifier range.
[0026] For example, the request processing layer can be deployed with three request processing units: Request Processing Unit A, Request Processing Unit B, and Request Processing Unit C. Request Processing Unit A corresponds to the preset command identifier range 0x0000-0x00FF and is used to process initialization commands; Request Processing Unit B corresponds to the preset command identifier range 0x0100-0x01FF and is used to process motion control commands; Request Processing Unit C corresponds to the preset command identifier range 0x0200-0x02FF and is used to process data acquisition commands. When the command identifier in the first service processing request falls into a certain range, the corresponding request processing unit processes the first service processing request.
[0027] In one specific embodiment, the preset processing command may include commands such as encapsulating the business processing request to be sent, decapsulating the received response information, and generating a business command object corresponding to the business instruction to be executed.
[0028] Accordingly, when the first client is the sender of the business processing request, the request processing unit is used to encapsulate the first business processing request and send the encapsulated first business processing request to the first plugin layer; and after receiving the response information, it decapsulates the response information and restores it to a business processing result that the business layer can recognize.
[0029] When the first client is the recipient of the business processing request, the request processing unit generates a business command object corresponding to the business instruction to be executed in the received business processing request, and sends the business command object to the business layer so that the business layer can perform the corresponding operation based on the business command object.
[0030] In a specific embodiment, such as Figure 3 As shown, the above-mentioned business layer calls the sending interface of the first interface layer to send the first business processing request to the first plugin layer, including: Step S301: The business layer calls the sending interface to send the first business processing request to the request processing layer.
[0031] Step S303: The request processing layer determines the first request processing unit corresponding to the preset command identifier range into which the first business type identifier falls.
[0032] Step S305: The first request processing unit processes the first business processing request based on a preset processing command, and sends the processed first business processing request to the first plug-in layer through the sending interface.
[0033] In a specific embodiment, the first request processing unit, based on a preset processing command, processes the first business processing request and sends the processed first business processing request to the first plug-in layer through a sending interface. This may include: the first request processing unit encapsulating the first business processing request and sending the encapsulated first business processing request to the first plug-in layer through the sending interface of the first interface layer.
[0034] In actual operation, if a new business type needs to be added, there is no need to modify the existing request processing unit. Simply add a new request processing unit corresponding to that business type in the request processing layer and assign a corresponding preset command identifier range to it. When a business processing request belonging to this new business type is subsequently received, the request processing layer can automatically determine and process the request based on the preset command identifier range where the business type identifier in the request falls, thereby achieving on-demand expansion and dynamic access of business types.
[0035] In the above embodiments, by adding a request processing layer between the first interface layer and the first plugin layer, and utilizing the matching mechanism between the first business type identifier and the preset command identifier range, accurate classification and targeted distribution of business processing requests are achieved. This enables different types of requests to be processed independently by their corresponding request processing units, ensuring the uniformity and standardization of the data format sent to the first plugin layer. It also separates the request preprocessing logic from the business layer and the plugin layer, reducing the burden of responsibilities on the business layer and allowing the first plugin layer to focus on protocol adaptation and connection management. At the same time, the independent deployment and on-demand expansion of the request processing units mean that when a new business type is added, only the corresponding request processing unit needs to be added to complete the adaptation without modifying the existing processing logic. This effectively improves the flexibility and maintainability of the first client when handling diverse business requests.
[0036] Step S203, First plug-in layer: Based on the maintained communication protocol identifier and the first mapping relationship between the client plug-in, load the client plug-in of the target communication protocol and determine the first connection object used to send the first service processing request.
[0037] Specifically: The first plugin layer first looks up the first mapping relationship between the communication protocol identifier and the client plugin based on the identifier of the target communication protocol carried in the first service processing request, thereby obtaining the client plugin corresponding to the identifier of the target communication protocol, loading the client plugin, and determining the first connection object used to send the first service processing request.
[0038] In one specific embodiment, the first mapping relationship described above is established in the following manner: The first plugin layer scans the plugin files in the first plugin directory, obtains the exported object representing the client plugin from the plugin file, determines the communication protocol identifier supported by the client plugin based on the exported object, and establishes the first mapping relationship between the client plugin and its corresponding communication protocol identifier.
[0039] In one specific embodiment, the first plugin layer first scans all plugin files in the first plugin directory and identifies each plugin file existing in the directory. For each identified plugin file, the first plugin layer loads the plugin file and extracts an exported object representing the client plugin from the plugin file. By calling the method of the exported object, the communication protocol identifier supported by the client plugin can be obtained. The communication protocol identifier is used to uniquely identify the type of communication protocol that the client plugin can handle. Finally, the first plugin layer establishes a correspondence between the client plugin and its supported communication protocol identifier, thereby completing the establishment of the first mapping relationship.
[0040] In the above embodiments, the first plugin layer scans the plugin files in the first plugin directory, obtains the exported object of the client plugin from the plugin file, determines the communication protocol identifier supported by the client plugin based on the exported object, and establishes a first mapping relationship between the client plugin and the identifier of the target communication protocol accordingly. This realizes the automatic association and dynamic registration between the client plugin and the communication protocol it supports, so that the corresponding client plugin can be quickly located and loaded according to the identifier of the target communication protocol, thereby improving the communication middleware's ability to extend and dynamically adapt to different communication protocols.
[0041] In one specific embodiment, determining the first connection object for sending the first service processing request includes: Query the second mapping relationship between the connection object identifier and the client connection object maintained by the client plugin of the target communication protocol; If a second mapping relationship is found, the first connection object used to send the first business processing request is determined based on the second mapping relationship.
[0042] Specifically, since only one first connection object is maintained under a client plugin, finding the second mapping relationship means that the client plugin has already created the corresponding first connection object. It can be directly determined that the first connection object is the object used to send the first business processing request, without the need to create it again.
[0043] In the above embodiments, the second mapping relationship maintained by the client plugin of the target communication protocol is queried, and the first connection object used to send the first service processing request is directly determined when the mapping relationship is found. This realizes the rapid location and reuse of the existing connection object, avoids the system overhead of recreating the first connection object every time a service processing request is sent, thereby reducing the repeated creation of connection objects and the waste of underlying resources, and improving the reuse efficiency of the first connection object and the response speed of the first client communication processing.
[0044] In one specific embodiment, the above method further includes: If the second mapping relationship is not found, the client plugin of the target communication protocol creates a first connection object and establishes the identifier of the first connection object and the second mapping relationship of the first connection object.
[0045] In the above embodiments, when the client plugin of the target communication protocol does not find the second mapping relationship, the client plugin creates the first connection object and establishes the corresponding second mapping relationship. This realizes the on-demand creation and dynamic registration of connection objects, so that the system only creates the connection object when it is first needed. This avoids the resource idleness and waste caused by pre-creating all possible connection objects. At the same time, by creating the second mapping relationship, the ability to reuse the connection object in the future is ensured. Thus, while ensuring the on-demand supply of connection objects, the dynamic management capability of the client plugin for connection objects and the utilization efficiency of underlying resources are improved.
[0046] Step S205: In the first transport layer, based on the target communication protocol, the first service processing request is sent to the second connection object of the server through the first connection object, so that the server forwards the first service processing request to the second client.
[0047] In one specific embodiment, the second connection object is created by a server-side plugin corresponding to the target communication protocol. The second connection object is a transmission endpoint on the server side specifically used to communicate with the first connection object on the first client side.
[0048] In a specific embodiment, such as Figure 4 As shown, the above method also includes: Step S401: The first connection object receives the first response information forwarded by the second connection object.
[0049] In one specific embodiment, the first response information is generated by the second client after executing the first business instruction in the first business processing request.
[0050] Step S403: The business layer obtains the first response information and determines the processing result of the first business instruction based on the first response information.
[0051] In the above embodiments, the first response information forwarded by the second connection object is received by the first connection object, and the processing result of the first service instruction is determined by the service layer after obtaining the first response information. This realizes a complete communication closed loop from request to response reception, enabling the service layer to know the execution status of the first service instruction based on the obtained first response information without needing to be aware of the underlying response transmission path and forwarding details. This ensures that the service layer can reliably obtain the service processing result and effectively support subsequent decision-making.
[0052] In one specific embodiment, the first service processing request further includes a first session identifier, and the first response information includes a second session identifier.
[0053] In one specific embodiment, the first session identifier is used to identify the identity of the first service processing request. The second session identifier is used to identify the identity of the first response information.
[0054] It should be noted that the first business processing request will only include the first session identifier when the business layer sends the first business processing request synchronously (sends the request and waits for the processing result to return before continuing to execute the subsequent process). Correspondingly, the first response information will include the second session identifier. When the business layer sends the first business processing request asynchronously (sends the request and immediately continues to execute the subsequent process without waiting for the processing result to return), it is not necessary to carry the session identifier for matching.
[0055] In one specific embodiment, the first connection object receiving the first response information forwarded by the second connection object includes: The first connection object receives the first response information forwarded by the second connection object and compares the first session identifier and the second session identifier.
[0056] In a specific embodiment, the business layer described above obtains the first response information by including: In the business layer, if the first session identifier and the second session identifier are the same, the receiving interface of the first interface layer is called to obtain the first response information from the first connection object.
[0057] In the above embodiments, by comparing the first session identifier and the second session identifier when the first connection object receives the first response information forwarded by the second connection object, and only allowing the business layer to obtain the first response information through the receiving interface of the first interface layer if the two are the same, precise filtering of response information is achieved when the business layer sends the first business processing request synchronously. This ensures that the first response information received by the business layer is necessarily a correct response that matches the current pending first business processing request, thereby avoiding response mismatch problems caused by factors such as disconnection and reconnection or communication delay, and improving the accuracy and reliability of the response results obtained by the business layer.
[0058] In a specific embodiment, when the business layer sends a first business processing request asynchronously, the business layer obtains the first response information including: The business layer receives the first response information through the listener callback function of the first interface layer.
[0059] In one specific embodiment, the listener callback function is triggered by the first connection object after receiving the first response information.
[0060] In the above embodiments, by pre-registering a listening callback function in the business layer, the first connection object actively triggers the callback function after receiving the first response information, without blocking and waiting for the response to return. This enables the business layer to immediately execute other tasks after sending the first business processing request, significantly improving the concurrent processing capability of the business layer and the overall operating efficiency of the system.
[0061] In a specific embodiment, such as Figure 5 As shown, the above method also includes: Step S501, First Plugin Layer: During operation, monitor the first plugin directory; when the first newly added plugin file is detected in the first plugin directory, load the newly added client plugin corresponding to the first newly added plugin file.
[0062] In one specific embodiment, the newly added client plugin corresponds to a newly added communication protocol. The first plugin layer obtains an exported object representing the newly added client plugin from the first newly added plugin file, and calls a method of the exported object to obtain the identifier of the newly added communication protocol supported by the newly added client plugin.
[0063] Step S503, First Plugin Layer: Add the correspondence between the newly added client plugin and the identifier of the newly added communication protocol to the first mapping relationship.
[0064] Step S505: Add a new client plugin, create a new client connection object corresponding to the new communication protocol, and establish a second mapping relationship between the identifier of the new client connection object and the new client connection object.
[0065] In the above embodiments, the first plugin layer continuously monitors the first plugin directory during operation. When a new plugin file is detected, the corresponding new client plugin is loaded immediately, and the correspondence between the new client plugin and the identifier of the new communication protocol is added to the first mapping relationship. At the same time, the new client plugin generates a new client connection object corresponding to the new communication protocol and establishes a corresponding second mapping relationship. This enables the new client plugin and its new client connection object corresponding to the new communication protocol to be dynamically connected and effective without system downtime. This realizes the dynamic expansion capability of the communication protocol. The integration and deployment of the new protocol can be completed without interrupting the existing business processing, which significantly improves the dynamic adaptability of the first client in a multi-protocol environment and the system availability, and reduces the downtime maintenance cost caused by protocol expansion.
[0066] The above describes the processing flow when the first client is the sender of the first service processing request. The following describes the processing flow when the first client is a function board in a semiconductor device and is the receiver of the second service processing request.
[0067] After receiving the second service processing request (which includes at least a second service instruction, a target communication protocol identifier, and a second service type identifier) forwarded by the server, the first connection object of the first client calls the sending interface of the first interface layer in the first client to send the second service processing request to the service layer of the first client. The service layer of the first client then calls the sending interface to send the second service processing request to the request processing layer of the first client.
[0068] The request processing layer determines the corresponding request processing unit based on the preset command identifier range into which the second business type identifier in the second business processing request falls. This request processing unit, based on a preset processing command, decapsulates the second business processing request, generates a corresponding business command object, and then calls the sending interface to send the business command object to the business layer of the first client.
[0069] The first client's business layer executes the operation corresponding to the second business instruction based on the business command object and generates the second response information.
[0070] The business layer of the first client calls the sending interface to send the second response information to the request processing layer of the first client. The request processing layer determines the corresponding request processing unit based on the preset command identifier range in which the second business type identifier in the second response information falls. The request processing unit encapsulates the second response information based on the preset processing command and calls the sending interface to send the encapsulated second response information to the first connection object of the first client.
[0071] The first transport layer, based on the target communication protocol, sends the second response information to the second connection object of the server through the first connection object, so that the server forwards the second response information to the client that initiated the second business processing request.
[0072] Figure 6 This is a system architecture diagram of a server according to an exemplary embodiment. The server deploys a centralized routing layer and a second communication middleware. The second communication middleware includes a second plugin layer, a first transport layer, and a second transport layer. The second plugin layer includes server plugins corresponding to various communication protocols, as well as second connection objects and third connection objects created by the server plugins. The second connection object communicates with the first connection object of the first client through the first transport layer. The third connection object communicates with the fourth connection object of the second client through the second transport layer.
[0073] Specifically, the second plugin layer manages server-side plugins corresponding to various communication protocols. Each server-side plugin corresponds to a specific communication protocol type, and creates a second connection object and a third connection object for that protocol type. The second connection object communicates with the first connection object of the first client through the first transport layer, while the third connection object communicates with the fourth connection object of the second client through the second transport layer. The centralized routing layer maintains the mapping between client identifiers and client sessions, and determines the session corresponding to the target client based on this mapping, thereby instructing the corresponding connection object to complete data reception and forwarding.
[0074] In this context, a client session refers to a one-to-one correspondence between a connection object on the server and a connection object on the client. Specifically, for the first client: the second connection object on the server under the target communication protocol. The first connection object under the target communication protocol in the first client and the correspondence between them constitute a client session. For the second client: the third connection object under the target communication protocol in the server. The fourth connection object under the target communication protocol in the second client, and the correspondence between the two constitutes another client session.
[0075] In a specific embodiment, such as Figure 7 As shown, the process by which the server receives and forwards the first business processing request is as follows: Step S701: The first transport layer receives the first service processing request sent by the first connection object through the second connection object.
[0076] In one specific embodiment, the first service processing request includes at least a first service instruction, an identifier of the target communication protocol, and an identifier of the second client.
[0077] Step S703: The centralized routing layer determines the session corresponding to the second client based on the maintained third mapping relationship between client identifiers and client sessions; and determines the third connection object used to forward the first service processing request based on the session corresponding to the second client.
[0078] Specifically, after receiving the first service processing request, the centralized routing layer parses out the identifier of the second client carried in it, and then determines the session corresponding to the second client based on the pre-maintained third mapping relationship between the client identifier and the client session. That is, it determines that under the target communication protocol, the third connection object in the server communicates with the fourth connection object in the second client, and the second connection object sends the first service processing request to the third connection object.
[0079] In one specific embodiment, the third mapping relationship is established in the following manner: The server-side plugin for any communication protocol can generate a server-side connection object for any communication protocol in response to the connection request of the client connection object for any communication protocol. The centralized routing layer establishes a third mapping relationship between server connection objects corresponding to any communication protocol and client connection objects corresponding to any communication protocol.
[0080] Specifically, when a client connection object corresponding to any communication protocol initiates a connection request to the server, the server-side plugin corresponding to that communication protocol responds to the connection request by generating a corresponding server connection object. This server connection object is specifically used for communication and transmission with the client connection object. Subsequently, the centralized routing layer establishes a correspondence between this server connection object and the client connection object that initiated the connection, forming a third mapping relationship.
[0081] For example, when a first connection object under the target communication protocol in the first client initiates a connection request to the server, the server-side plugin corresponding to the target communication protocol responds to the connection request and generates a second connection object under the target communication protocol; this second connection object is specifically used for communication transmission with the first connection object. When a fourth connection object under the target communication protocol in the second client initiates a connection request to the server, the server-side plugin corresponding to the target communication protocol responds to the connection request and generates a third connection object under the target communication protocol; this third connection object is specifically used for communication transmission with the fourth connection object. The centralized routing layer records the correspondence between the second and first connection objects, and the correspondence between the third and fourth connection objects, respectively, in the third mapping relationship between client identifiers and client sessions.
[0082] In the above embodiments, the server-side plugin generates a corresponding server-side connection object in response to the client's connection request. The centralized routing layer then establishes a third-party mapping relationship between this server-side connection object and the client connection object that initiated the connection. This achieves communication binding between the server-side connection object and the client connection object, thus providing a foundation for the centralized routing layer to quickly locate the corresponding communication channel based on the client identifier. This improves the server's dynamic adaptation capability and the automation level of routing management in multi-client access scenarios, as well as the routing flexibility and protocol adaptation efficiency in multi-protocol scenarios, ensuring automatic matching and accurate forwarding of heterogeneous client requests.
[0083] In one specific embodiment, the centralized routing layer is used to maintain a fourth mapping relationship between client identifiers and client online status; the above method further includes: When any client logs in or disconnects, the central routing layer updates the fourth mapping relationship and broadcasts it to online clients, so that online clients can update their locally maintained peer online status mapping table based on the fourth mapping relationship.
[0084] Specifically, when any client logs in or disconnects, the centralized routing layer first updates the fourth mapping relationship it maintains between client identifiers and client online status, marking the corresponding client's online status as online or offline. Subsequently, the centralized routing layer broadcasts the updated fourth mapping relationship to all currently online clients. After receiving the fourth mapping relationship, each online client updates its locally maintained peer online status mapping table accordingly.
[0085] For example, assuming the currently online clients include a first client, a second client, and a third client, the fourth mapping relationship between client identifiers and online status maintained by the centralized routing layer is: First client → Online, Second client → Online, Third client → Online. When the third client disconnects, the centralized routing layer first updates the online status of the third client in the fourth mapping relationship to offline, and then broadcasts the updated fourth mapping relationship (i.e., First client → Online, Second client → Online, Third client → Offline) to the currently online first client and second client. After receiving the fourth mapping relationship, the first client and second client update their respective locally maintained peer online status mapping tables accordingly, thereby knowing in real time that the third client is offline. Subsequently, when initiating a service processing request to the third client, they can determine its unavailability based on the online status mapping table, avoiding invalid communication.
[0086] In the above embodiments, a fourth mapping relationship between client identifiers and client online status is maintained by a centralized routing layer. This fourth mapping relationship is updated in real time and broadcast to all online clients when any client logs in or disconnects. This allows each online client to synchronously update its locally maintained peer online status mapping table based on the received fourth mapping relationship. This achieves centralized management and real-time synchronization of the online status of each client by the server, ensuring that each client can dynamically perceive changes in the connection status of other clients without needing to actively poll or timeout retries to determine whether the peer is online. This improves the communication efficiency and real-time status perception of the system in scenarios with multiple clients dynamically accessing and exiting, enabling each client to promptly perceive the offline changes of other clients and avoiding invalid communication and resource waste caused by sending business processing requests to offline clients.
[0087] Step S705: The second transport layer, based on the target communication protocol, sends the first service processing request to the fourth connection object of the second client through the third connection object, so that the second client executes the first service instruction.
[0088] In one specific embodiment, the third connection object communicates with the fourth connection object through the second transport layer; the fourth connection object is created by a client plugin for the target communication protocol located in the second client.
[0089] In the above embodiments, the server's first transport layer receives the first service processing request sent by the first client via the second connection object. Then, the centralized routing layer locates the session corresponding to the second client and determines the third connection object based on the third mapping relationship between the second client identifier and the client session. Finally, the second transport layer forwards the request to the second client's fourth connection object through the third connection object. This achieves centralized reception, routing decision-making, and targeted forwarding of cross-client service processing requests by the server. It improves the routing efficiency and architectural scalability of the server in scenarios with concurrent communication between multiple clients, ensures efficient and secure forwarding of business requests between heterogeneous clients, and enhances the system's compatibility with multiple communication protocols and the flexibility of request processing.
[0090] In a specific embodiment, such as Figure 8 As shown, the above method also includes: Step S801: The third connection object receives the first response information sent by the fourth connection object.
[0091] In one specific embodiment, the first response information is generated by the second client after executing the first business instruction in the first business processing request.
[0092] Step S803: The centralized routing layer determines the session corresponding to the first client based on the identifier of the first client and the third mapping relationship carried in the first response information, and determines the second connection object for forwarding the first response information based on the session corresponding to the first client.
[0093] In a specific embodiment, the centralized routing layer determines the session corresponding to the first client based on the identifier of the first client and the third mapping relationship carried in the first response information, and determines the specific details of the second connection object used to forward the first response information based on the session. See step S703 above. The centralized routing layer determines the session corresponding to the second client based on the maintained third mapping relationship between the client identifier and the client session; and determines the third connection object used to forward the first service processing request based on the session. This will not be elaborated further here.
[0094] Step S805: The first transport layer sends the first response information to the first connection object through the second connection object.
[0095] In the above embodiments, the first response information generated by the second client based on the first business processing request is received through the third connection object. The centralized routing layer determines the corresponding session and the second connection object for forwarding the response based on the identifier of the first client carried in the first response information. Finally, the first transport layer sends the first response information to the first connection object through the second connection object. This realizes the reverse routing and accurate return of the response information by the server, so that the response information generated by the second client after executing the first business instruction can be reliably returned to the first client along the reverse link of the request path. This forms a complete communication closed loop from request to response return, ensuring that the first client can obtain the execution result of the second client in a timely manner, and improving the integrity of the cross-client business processing flow and the reliability of response return.
[0096] In a specific embodiment, such as Figure 9 As shown, the above method also includes: Step S901, Second Plugin Layer: During operation, monitor the second plugin directory; when a second newly added plugin file is detected in the second plugin directory, load the newly added server plugin corresponding to the second newly added plugin file.
[0097] In one specific embodiment, the newly added server-side plugin corresponds to a newly added communication protocol. The second plugin layer obtains an exported object representing the newly added server-side plugin from the second newly added plugin file, and calls the method of the exported object to obtain the identifier of the newly added communication protocol supported by the newly added server-side plugin.
[0098] Step S903: Add a new server-side plugin, which responds to the connection request of the new client connection object corresponding to the new communication protocol and generates a new server-side connection object corresponding to the new communication protocol.
[0099] Step S905: Centralize the routing layer and add the mapping relationship between the newly added server connection object and the newly added client connection object to the third mapping relationship.
[0100] In a specific embodiment, the aforementioned newly added server-side plugin, in response to a connection request from a newly added client connection object corresponding to a newly added communication protocol, generates a newly added server-side connection object and a centralized routing layer corresponding to the newly added communication protocol. The detailed process of adding the correspondence between the newly added server-side connection object and the newly added client connection object to the third mapping relationship can be found in the above-mentioned server-side plugin for any communication protocol, which generates a server-side connection object for any communication protocol in response to a connection request from a client connection object for any communication protocol; the centralized routing layer establishes a third mapping relationship between the server-side connection object and the client connection object for any communication protocol, which will not be elaborated further here.
[0101] In the above embodiments, the second plugin layer monitors the second plugin directory and loads new server plugins during operation. The new server plugins respond to the connection requests of new client connection objects corresponding to new communication protocols and generate corresponding new server connection objects. Then, the centralized routing layer adds the correspondence between the new server connection objects and the new client connection objects to the third mapping relationship. This enables the server to dynamically access new communication protocols and automatically register new client connection objects without interrupting existing business processing. This allows the server to flexibly expand the types of communication protocols it supports and accept clients using new protocols without downtime, improving the server's dynamic adaptability and system availability in multi-protocol scenarios.
[0102] In one specific embodiment, a business processing system is provided. The business processing system includes multiple clients and servers. Each client has a business layer and a first communication middleware. The first communication middleware includes a first interface layer, a first plug-in layer and a first transport layer. The server is deployed with a centralized routing layer and a second communication middleware. The second communication middleware includes a second plug-in layer, a first transport layer, and a second transport layer. The first interface layer is used to provide a communication interface between the business layer and the first plug-in layer; The first plugin layer includes client plugins corresponding to various communication protocols, and a first connection object created by the client plugins. The first plugin layer is used to maintain a first mapping relationship between communication protocol identifiers and client plugins. The client plugin is used to maintain a second mapping between connection object identifiers and client connection objects; The second plugin layer includes server-side plugins corresponding to various communication protocols, as well as second and third connection objects created by the server-side plugins. The first transport layer is used to send and receive data through the first connection object and the second connection object based on the corresponding communication protocol. The second transport layer is used to send and receive data through the third connection object and the first connection object based on the corresponding communication protocol. The centralized routing layer is used to maintain a third-party mapping between client identifiers and client sessions.
[0103] In one specific embodiment, each client also deploys a request processing layer, which includes at least one request processing unit. Each request processing unit corresponds to a command identifier range. The request processing unit corresponding to any command identifier range is used to process the business processing request corresponding to any command identifier based on a preset processing command. Any command identifier is located in any command identifier range.
[0104] Specifically, this business processing system consists of multiple clients and one server. Each client is a functional board in a semiconductor device, equipped with a business layer and a first communication middleware, which communicates with other clients through the first communication middleware and the server. The server is a communication intermediary node, equipped with a centralized routing layer and a second communication middleware, used for centralized routing and forwarding of information among the clients.
[0105] In a specific embodiment, such as Figure 10 As shown, the following explanation uses multiple clients, including the first client and the second client mentioned above, as an example.
[0106] The first client is a functional board in a semiconductor device that acts as the initiator of business processing requests. It consists of a business layer, a request processing layer, and a first communication middleware. The first communication middleware comprises three sub-layers: a first interface layer, a first plug-in layer, and a first transport layer. The first interface layer provides a communication interface for the business layer to interact with the first plug-in layer. The business layer sends the first business processing request by calling the sending interface of the first interface layer, or obtains response information through the receiving interface or listening callback function of the first interface layer. The first plug-in layer contains client plug-ins corresponding to various communication protocols, as well as first connection objects created by these client plug-ins. Each communication protocol corresponds to one client plug-in, and each client plug-in creates only one unique first connection object under that communication protocol; that is, there is a one-to-one correspondence between client plug-ins and first connection objects.
[0107] The first plugin layer maintains a first mapping between communication protocol identifiers and client plugins, while the client plugins maintain a second mapping between connection object identifiers and client connection objects. Each client plugin maintains only a mapping between its own unique connection object and the identifier of that connection object. The first plugin layer can locate the corresponding client plugin based on the identifier of the target communication protocol in the first service processing request and the first mapping. The corresponding client plugin can determine the corresponding first connection object based on the second mapping (which represents the correspondence between the client plugin and the unique connection object it creates). The first transport layer sends the first service processing request to the server's second connection object via the first connection object, based on the target communication protocol.
[0108] The server acts as a communication intermediary node, deploying a centralized routing layer and a second communication middleware. The second communication middleware comprises a second plugin layer, a first transport layer, and a second transport layer. The second plugin layer contains server plugins corresponding to various communication protocols, as well as second and third connection objects created by these server plugins. Each communication protocol corresponds to one server plugin, and each server plugin can generate at least two server connection objects under that communication protocol. Different server connection objects are used to communicate with connection objects in different clients.
[0109] In this application, a first connection object of a first client communicates with a second connection object of a server, and a fourth connection object of the second client communicates with a third connection object of the server. Specifically, the second connection object communicates with the first connection object of the first client through a first transport layer; the third connection object communicates with the fourth connection object of the second client through a second transport layer. The first transport layer, based on a corresponding communication protocol, sends and receives data between the second and first connection objects through the second connection object; the second transport layer, based on a corresponding communication protocol, sends and receives data between the third and fourth connection objects through the third connection object.
[0110] The centralized routing layer maintains a third mapping between client identifiers and client sessions, and a fourth mapping between client identifiers and client online status. Based on the identifier of the second client in the first service processing request and the third mapping, the centralized routing layer determines the client session corresponding to the second client, and determines the third connection object for forwarding the first service processing request based on this session; based on the identifier of the first client in the first response information and the third mapping, it determines the session corresponding to the first client, and determines the second connection object for forwarding the first response information based on this session; and updates the fourth mapping when any client logs in or disconnects, and broadcasts the fourth mapping to online clients so that online clients update their locally maintained peer online status mapping table based on the fourth mapping.
[0111] The second client is another functional board in the semiconductor device, which can act as a receiver of business processing requests. Its architecture is the same as the first client, also deploying a business layer, a request processing layer, and a first communication middleware. The first communication middleware includes a first interface layer, a first plug-in layer, and a first transport layer (actually the second transport layer). The first plug-in layer contains client plug-ins corresponding to various communication protocols, and first connection objects (actually the fourth connection objects) created by these client plug-ins; wherein, one communication protocol corresponds to one client plug-in, and each client plug-in creates only one first connection object (actually the fourth connection object) under that communication protocol, that is, there is a one-to-one correspondence between client plug-ins and first connection objects (actually the fourth connection objects). The first connection object (actually the fourth connection object) is used to communicate with the third connection object of the server through the first transport layer (actually the second transport layer), and is responsible for receiving the first business processing request forwarded by the server, and sending the first response information generated after the second client executes the first business instruction to the third connection object of the server.
[0112] The following is the communication flow between the first client, the server, and the second client.
[0113] Step 1: The first client sends the first business processing request.
[0114] The business layer of the first client generates a first business processing request, which includes at least a first business instruction, an identifier of the target communication protocol, an identifier of the second client, and an identifier of the first business type. The business layer calls the sending interface of the first interface layer to send the first business processing request to the request processing layer.
[0115] The request processing layer determines the corresponding first request processing unit based on the preset command identifier range into which the first business type identifier falls. The first request processing unit encapsulates the first business processing request based on the preset processing command and sends the encapsulated first business processing request to the first plugin layer through the sending interface of the first interface layer.
[0116] The first plugin layer loads the client plugin corresponding to the target communication protocol identifier based on the maintained first mapping relationship between the communication protocol identifier and the client plugin, and the identifier of the target communication protocol, and determines the corresponding first connection object.
[0117] The first transport layer, based on the target communication protocol, sends the first business processing request to the second connection object of the server through the first connection object.
[0118] Specifically, the process involves querying the second mapping relationship between connection object identifiers and client connection objects maintained by the client plugin of the target communication protocol to determine the corresponding first connection object. Since a client plugin creates only one first connection object under its corresponding communication protocol, meaning there is a one-to-one correspondence between the client plugin and the first connection object, if the second mapping relationship is found, it means that the client plugin has already created the corresponding first connection object, and it can directly reuse the first connection object without creating it again. If the second mapping relationship is not found, it means that the client plugin has not yet created the corresponding first connection object. In this case, the client plugin creates a new first connection object and generates a second mapping relationship between the identifier of the first connection object and the first connection object for subsequent reuse.
[0119] Step 2: The server receives and forwards the first business processing request. The server's first transport layer receives the first business processing request through the second connection object; The centralized routing layer determines the session corresponding to the second client based on the maintained third mapping relationship between client identifiers and client sessions and the identifier of the second client. Based on this session, it determines the third connection object used to forward the first service processing request. The second connection object sends the first service processing request to the third connection object.
[0120] The second transport layer, based on the target communication protocol, sends the first service processing request to the fourth connection object of the second client through the third connection object.
[0121] Step 3: The second client receives and processes the first business processing request. The second transport layer of the second client, based on the target communication protocol, receives the first service processing request through the fourth connection object of the second client. It then calls the send interface of the first interface layer in the second client to send the request to the service layer of the second client. The service layer of the second client then calls the send interface to send the first service processing request to the request processing layer of the second client.
[0122] The request processing layer of the second client determines the corresponding second request processing unit based on the preset command identifier range into which the first service type identifier in the first service processing request falls. This second request processing unit decapsulates the first service processing request based on the preset processing command, generates a corresponding service command object, and then calls the sending interface to send the service command object to the service layer of the second client. The service layer executes the operation corresponding to the first service instruction based on the service command object and generates first response information.
[0123] Step 4: The second client returns the first response information. The second client's business layer calls the sending interface to send the first response information to its request processing layer. The request processing layer determines the corresponding second request processing unit based on the preset command identifier range into which the first business type identifier in the first response information falls. This second request processing unit encapsulates the first business processing request based on a preset processing command and calls the sending interface to send the encapsulated first response information to the fourth connection object. The second transport layer, based on the target communication protocol, sends the first business processing request to the server's third connection object through the fourth connection object.
[0124] Step 5: The server forwards the first response information. The second transport layer, based on the target communication protocol, receives the first response information through the third connection object. The centralized routing layer then determines the session corresponding to the first client based on the first client's identifier and the third mapping relationship in the first response information, and determines the second connection object used to forward the first response information based on this session. The first transport layer then sends the first response information to the first connection object of the first client through the second connection object.
[0125] Step Six: The first client receives and processes the first response information. The first transport layer, based on the target communication protocol, receives the first response information forwarded by the second connection object through the first connection object. After obtaining the first response information from the first connection object, the business layer calls the sending interface to send the first response information to the request processing layer.
[0126] The request processing layer determines the corresponding first request processing unit based on the preset command identifier range into which the first service type identifier in the first response information falls. The first request processing unit, based on a preset processing command, decrypts the first response information, restoring it to a service processing result recognizable by the service layer, and calls the sending interface to send the decrypted first response information to the service layer of the first client. The service layer of the first client determines the processing result of the first service instruction based on the decrypted first response information.
[0127] In the above process, if the first business processing request is sent synchronously, it also includes a first session identifier, and the first response information includes a second session identifier. After receiving the first response information, the first connection object compares the first session identifier and the second session identifier. Only if they are the same will the business layer be allowed to call the receiving interface to obtain the first response information. If the first business processing request is sent asynchronously, the business layer receives the first response information through a listening callback function of the first interface layer. This listening callback function is triggered by the first connection object after receiving the first response information.
[0128] In the above embodiments, the business processing system achieves complete decoupling of business processing and communication transmission by deploying a business layer, a request processing layer, and a first communication middleware on each client, and a centralized routing layer and a second communication middleware on the server. Specifically, the request processing layer, through the correspondence between multiple request processing units and command identifier ranges, ensures that any business processing request corresponding to a command identifier can be accurately processed by the request processing unit within its specified range. This separates the preprocessing logic, such as the classification, encapsulation, and decapsulation of business processing requests, from the business layer and communication middleware. This reduces the burden on the business layer and allows the communication middleware to focus on protocol adaptation and connection management. Furthermore, the independent deployment and on-demand expansion of request processing units mean that when a new business type is added, only the corresponding request processing unit needs to be added to complete the adaptation without modifying the existing processing logic. This effectively improves the system's flexibility and maintainability when handling diverse business requests.
[0129] In a specific embodiment, such as Figure 11 As shown, a communication middleware includes an interface layer, a plug-in layer, and a transport layer; The interface layer provides communication interfaces for interaction with the business layer. The plugin layer includes plugins corresponding to various communication protocols, as well as connection objects created by the plugins. The plugins include client plugins and server plugins. The client plugin is used to create a first connection object on the client side, and the server plugin is used to create a second connection object on the server side. The first connection object is used for communication transmission between the first and second connection objects. The transport layer is used to enable communication transmission between the first connection object and the second connection object based on the communication protocol corresponding to the business layer.
[0130] Specifically, this communication middleware is a product that runs independently of the business layer, deployed on the client or server side, and is used to decouple and bridge communication between the business layer and the underlying layer. The communication middleware consists of three modules: an interface layer, a plugin layer, and a transport layer.
[0131] The interface layer provides communication interfaces for interaction with the business layer. The business layer sends business processing requests by calling the sending interface of the interface layer, or obtains response information through the receiving interface or listening callback function of the interface layer, without needing to know the implementation details of the underlying communication protocol.
[0132] The plugin layer includes plugins corresponding to various communication protocols, as well as connection objects created by these plugins. The client-side plugin layer includes client-side plugins corresponding to various communication protocols, and the server-side plugin layer includes server-side plugins corresponding to various communication protocols. Client-side plugins are used to create a first connection object under the corresponding communication protocol on the client side; one communication protocol corresponds to one client-side plugin, and each client-side plugin creates only one unique first connection object under its corresponding communication protocol. Server-side plugins are used to create second connection objects under the corresponding communication protocol on the server side; one communication protocol corresponds to one server-side plugin, and each server-side plugin can create multiple second connection objects under its corresponding communication protocol.
[0133] In this system, multiple second connection objects are used to communicate with first connection objects under the same communication protocol in different clients. For example, when a first connection object under the target communication protocol in a first client initiates a connection request to the server, the server-side plugin corresponding to the target communication protocol responds to the connection request and generates a second connection object specifically for communicating with the first connection object in the first client. When a first connection object under the same target communication protocol in a second client initiates a connection request to the server, the same server-side plugin responds to the connection request and generates another second connection object specifically for communicating with the first connection object in the second client. In this way, multiple second connection objects under the same communication protocol in the server establish one-to-one communication links with first connection objects under the same communication protocol in different clients.
[0134] In practical applications, the interface layer, plugin layer and transport layer of the communication middleware can be combined and deployed as needed according to the deployment scenario, without having to deploy them all on a single node.
[0135] For example, when communication middleware is deployed on the client side, it typically deploys all three modules: the interface layer, the plugin layer, and the transport layer. When communication middleware is deployed on the server side, only the plugin layer and the transport layer modules need to be deployed; the interface layer is unnecessary. This is because the server is used to receive and route information sent by the client. These two modules are sufficient to meet the server's functional requirements as a communication intermediary node.
[0136] By using this on-demand deployment method, the communication middleware can flexibly select the combination of modules to be deployed according to the functional requirements and resource constraints of different nodes, which not only meets the different communication needs of the client and the server, but also avoids the waste of resources caused by unnecessary module deployment.
[0137] If a new communication protocol needs to be enabled on a deployment node, no modification to existing code or a system restart is required. Simply add a new plugin file corresponding to that communication protocol to the plugin directory in the plugin layer. During operation, the plugin layer continuously monitors the plugin directory. When a new plugin file is detected, it automatically loads it, extracts an exported object, and obtains the communication protocol identifier supported by the plugin by calling methods on the exported object. Subsequently, the plugin layer establishes a mapping between the identifier of the target communication protocol and the new plugin, adding it to the target communication protocol identifier-plugin mapping. When information needs to be sent based on the new communication protocol, the plugin layer can load the corresponding plugin according to this mapping, and the plugin can create the corresponding connection object, thus dynamically expanding support for the new protocol without interrupting existing business processes.
[0138] In the above embodiments, the communication middleware, through a layered design of interface layer, plugin layer, and transport layer, completely decouples the business layer from the underlying communication protocol. This allows the business layer to send business processing requests and receive response information simply through the unified communication interface provided by the interface layer, without needing to be aware of the differences in the underlying communication protocol or the management details of the connection objects. Simultaneously, the plugin layer creates a first connection object and a second connection object through client-side and server-side plugins, respectively, and supports dynamic loading and adaptation of multiple communication protocols. This allows for expansion by simply adding the corresponding plugin when a new communication protocol is added. The transport layer implements communication transmission between the first and second connection objects based on the communication protocol corresponding to the business layer, further ensuring the protocol adaptability and link stability of data transmission, thereby improving the versatility, scalability, and ease of maintenance of the communication middleware.
[0139] Figure 11 This is a block diagram illustrating an electronic device for a communication method according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a communication method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0140] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements. In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the communication method as described in the embodiments of this disclosure.
[0141] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the communication method of the present disclosure embodiments.
[0142] In an exemplary embodiment, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the communication method of the present disclosure embodiments.
[0143] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0144] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0145] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A communication method, characterized in that, The method is applied to a first client, which deploys a business layer and a first communication middleware. The first communication middleware includes a first interface layer, a first plugin layer, and a first transport layer. The first plugin layer includes client plugins corresponding to various communication protocols, and a first connection object created by the client plugins. The method includes: The business layer calls the sending interface of the first interface layer to send the first business processing request to the first plug-in layer. The first business processing request includes at least a first business instruction, an identifier of the target communication protocol, and an identifier of the second client. The first plugin layer loads the client plugin of the target communication protocol according to the first mapping relationship between the maintained communication protocol identifier and the client plugin, and determines the first connection object for sending the first service processing request; The first transport layer, based on the target communication protocol, sends the first service processing request to the second connection object of the server through the first connection object, so that the server forwards the first service processing request to the second client; the second connection object is created by the server plugin corresponding to the target communication protocol.
2. The method according to claim 1, characterized in that, The first business processing request also includes a first business type identifier. The first client also deploys a request processing layer, which includes at least one request processing unit. Each request processing unit corresponds to a preset command identifier range, and the request processing unit is used to execute a preset processing command. The business layer calls the sending interface of the first interface layer to send the first business processing request to the first plugin layer, including: The business layer calls the sending interface to send the first business processing request to the request processing layer; The request processing layer determines the first request processing unit corresponding to the preset command identifier range into which the first service type identifier falls. The first request processing unit processes the first service processing request based on the preset processing command, and sends the processed first service processing request to the first plug-in layer through the sending interface.
3. The method according to claim 1, characterized in that, The method further includes: The first connection object receives first response information forwarded by the second connection object; the first response information is generated by the second client after executing the first service instruction in the first service processing request; The business layer obtains the first response information and determines the processing result of the first business instruction based on the first response information.
4. The method according to claim 3, characterized in that, The first service processing request further includes a first session identifier, and the first response information includes a second session identifier; The first connection object receives the first response information forwarded by the second connection object, including: The first connection object receives the first response information forwarded by the second connection object, and compares the first session identifier with the second session identifier; The business layer obtains the first response information by including: The business layer, in response to the fact that the first session identifier and the second session identifier are the same, calls the receiving interface of the first interface layer to obtain the first response information from the first connection object.
5. The method according to claim 3, characterized in that, The business layer obtains the first response information by including: The business layer receives the first response information through the listening callback function of the first interface layer. The listening callback function is triggered by the first connection object after receiving the first response information.
6. The method according to claim 1, characterized in that, The first mapping relationship is established in the following manner: The first plugin layer scans the plugin files in the first plugin directory, obtains the exported object representing the client plugin from the plugin files, and determines the communication protocol identifier supported by the client plugin based on the exported object. Establish the first mapping relationship between the client plugin and the corresponding communication protocol identifier.
7. The method according to claim 1, characterized in that, The step of determining the first connection object for sending the first service processing request includes: Query the second mapping relationship between the connection object identifier and the client connection object maintained by the client plugin of the target communication protocol; If the second mapping relationship is found, the first connection object used to send the first service processing request is determined based on the second mapping relationship.
8. The method according to claim 7, characterized in that, The method further includes: If the second mapping relationship is not found, the client plugin of the target communication protocol creates the first connection object and establishes the identifier of the first connection object and the second mapping relationship of the first connection object.
9. The method according to claim 1, characterized in that, The method further includes: The first plugin layer monitors the first plugin directory during operation; when a first newly added plugin file is detected in the first plugin directory, the newly added client plugin corresponding to the first newly added plugin file is loaded, and the newly added client plugin corresponds to a new communication protocol. In the first plugin layer, the correspondence between the newly added client plugin and the identifier of the newly added communication protocol is added to the first mapping relationship; The newly added client plugin creates a new client connection object corresponding to the new communication protocol, and establishes a second mapping relationship between the identifier of the new client connection object and the new client connection object.
10. A communication method, characterized in that, Applied to the server side, the server side is deployed with a centralized routing layer and a second communication middleware. The second communication middleware includes a second plug-in layer, a first transport layer and a second transport layer. The second plug-in layer includes server plug-ins corresponding to various communication protocols, as well as a second connection object and a third connection object created by the server plug-ins. The second connection object communicates and transmits data with the first connection object of the client through the first transport layer; the method includes: The first transport layer receives a first service processing request sent by the first connection object through the second connection object. The first service processing request includes at least a first service instruction, an identifier of the target communication protocol, and an identifier of the second client. The centralized routing layer determines the session corresponding to the second client based on the maintained third mapping relationship between client identifiers and client sessions; and determines the third connection object for forwarding the first service processing request based on the session corresponding to the second client. The second transport layer, based on the target communication protocol, sends the first service processing request to the fourth connection object of the second client through the third connection object, so that the second client executes the first service instruction; wherein, the third connection object communicates and transmits with the fourth connection object through the second transport layer; the fourth connection object is created by the client plugin of the target communication protocol located on the second client.
11. The method according to claim 10, characterized in that, The method further includes: The third connection object receives first response information sent by the fourth connection object. The first response information is generated by the second client after executing the first service instruction in the first service processing request. The centralized routing layer determines the session corresponding to the first client based on the identifier of the first client carried in the first response information and the third mapping relationship, and determines the second connection object for forwarding the first response information based on the session corresponding to the first client. The first transport layer sends the first response information to the first connection object through the second connection object.
12. The method according to claim 10, characterized in that, The centralized routing layer is used to maintain a fourth mapping relationship between client identifiers and client online status; the method further includes: When any client logs in or disconnects, the centralized routing layer updates the fourth mapping relationship and broadcasts the fourth mapping relationship to the online clients, so that the online clients update their locally maintained peer online status mapping table based on the fourth mapping relationship.
13. The method according to claim 10, characterized in that, The third mapping relationship is established in the following manner: A server-side plugin for any communication protocol, in response to a connection request from a client connection object for that communication protocol, generates a server-side connection object for that communication protocol. The centralized routing layer establishes the third mapping relationship between the server connection object corresponding to any one of the communication protocols and the client connection object corresponding to any one of the communication protocols.
14. The method according to claim 10, characterized in that, The method further includes: The second plugin layer monitors the second plugin directory during operation; when a second newly added plugin file is detected in the second plugin directory, the newly added server plugin corresponding to the second newly added plugin file is loaded, and the newly added server plugin corresponds to a new communication protocol. The newly added server-side plugin generates a new server-side connection object corresponding to the new communication protocol in response to the connection request of the new client connection object corresponding to the new communication protocol. The centralized routing layer adds the correspondence between the newly added server connection object and the newly added client connection object to the third mapping relationship.
15. A business processing system, characterized in that, The business processing system includes multiple clients and servers; Each of the aforementioned clients is deployed with a service layer and a first communication middleware, the first communication middleware including a first interface layer, a first plug-in layer and a first transport layer; The server is deployed with a centralized routing layer and a second communication middleware, the second communication middleware including a second plug-in layer, a first transport layer and a second transport layer; The first interface layer is used to provide a communication interface between the business layer and the first plug-in layer; The first plugin layer includes client plugins corresponding to various communication protocols, and a first connection object created by the client plugins. The first plugin layer is used to maintain a first mapping relationship between communication protocol identifiers and client plugins. The client plugin is used to maintain a second mapping relationship between connection object identifiers and client connection objects; The second plugin layer includes server-side plugins corresponding to various communication protocols, as well as a second connection object and a third connection object created by the server-side plugins; The first transport layer is used to send and receive data through the first connection object and the second connection object based on the corresponding communication protocol; The second transport layer is used to send and receive data through the third connection object and the first connection object based on the corresponding communication protocol; The centralized routing layer is used to maintain a third mapping relationship between client identifiers and client sessions.
16. The system according to claim 15, characterized in that, Each of the aforementioned clients is also deployed with a request processing layer, which includes at least one request processing unit. Each request processing unit corresponds to a command identifier range. Any request processing unit corresponding to any command identifier range is used to process a business processing request corresponding to any command identifier based on a preset processing command. The any command identifier is located in the any command identifier range.
17. A communication middleware, characterized in that, The communication middleware includes an interface layer, a plug-in layer, and a transport layer; The interface layer is used to provide a communication interface for interaction with the business layer; The plugin layer includes plugins corresponding to various communication protocols, and connection objects created by the plugins; the plugins include client plugins and server plugins, the client plugins are used to create a first connection object on the client, and the server plugins are used to create a second connection object on the server. The first connection object is used to communicate and transmit with the second connection object; The transport layer is used to realize communication transmission between the first connection object and the second connection object based on the communication protocol corresponding to the service layer.
