Communication method of service framework, service framework of network communication, and storage medium

By introducing the gateway connection component service layer into the traditional network communication architecture, optimizing the connections and data transmission between services solves the problem of high development costs caused by too many connections in the traditional architecture, achieving efficient network communication and reducing costs.

CN119342091APending Publication Date: 2025-01-21QINGDAO HAIER TECH +2
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411425241.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The excessive connection between different services in traditional network communication architectures leads to high development costs.

Method used

This paper proposes a communication method of service framework, including external receiving component service layer, gateway connection component service layer and logical business service layer. It optimizes the connection and data transmission between services through technical means such as information configuration, load balancing and routing forwarding.

Benefits of technology

By reducing direct connections between services, development and maintenance costs are reduced, network communication efficiency is improved, and by introducing the gateway connection component service layer, efficient processing and forwarding of external network requests are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342091A_ABST
    Figure CN119342091A_ABST
Patent Text Reader

Abstract

The invention discloses a communication method of a service framework, a network communication service framework and a storage medium, and relates to the technical field of network communication, the network communication service framework comprises an external receiving component service layer, a gateway connection component service layer and a logic business service layer. The method comprises the following steps: receiving a processing request sent by a target object; information configuration is carried out on the processing request to obtain a service request, the information configuration at least comprises load balancing data corresponding to the data request and routing forwarding data corresponding to the data request, and the service request corresponds to logic service information; in response to the service request, generating target data corresponding to the logic service information; and feeding back the target data to the target object. By adopting the service framework and the communication method, the problem of relatively high development cost caused by excessive connections between different services in a communication framework is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of network communication, and in particular to a communication method of a service framework, a service framework for network communication, and a storage medium. Background Art

[0002] With the rapid development of Internet technology, the scale of the global network centered on the Internet has become quite large, and the transmission and exchange of information in the network has become increasingly frequent. However, the traditional network architecture can no longer meet the growing network needs. The traditional point-to-point or client / server architecture can no longer meet the network scenarios with large traffic and high concurrency. It is necessary to build a network architecture to support large-scale concurrent requests. The traditional communication architecture is usually directly connected, generally a two-layer system, divided into logical component services and external receiving component services. Each logical component service needs to establish a connection with other logical component services, which will cause a large amount of connection resource consumption, and there will be considerable losses in port setting maintenance and development costs. At the same time, it will also rely on a large number of middleware, resulting in a bloated communication framework and high development costs.

[0003] Therefore, no effective solution has been proposed for the problem in related technologies that there are too many connections between different services in the communication framework, resulting in high development costs. Summary of the invention

[0004] The embodiments of the present application provide a communication method of a service framework, a service framework for network communication, and a storage medium, so as to at least solve the problem in the related art that there are too many connections between different services in the communication framework, resulting in high development costs.

[0005] According to an embodiment of the present application, a communication method for a service framework is provided, which is applied to a service framework including an external receiving component service layer, a gateway connection component service layer, and a logical business service layer, including: receiving a processing request sent by a target object through external data; performing information configuration on the processing request to obtain a business request, wherein the information configuration includes at least: load balancing data corresponding to the data request, and routing forwarding data corresponding to the data request; responding to the business request, generating target data corresponding to the logical business information; and feeding back the target data to the target object.

[0006] In an exemplary embodiment, after receiving a processing request sent by a target object via external data, the method further includes: determining a plurality of logical business information corresponding to the processing request; matching corresponding target communication information and a target connection method for each of the plurality of logical business information, wherein the target communication information is used to indicate definition information of a currently used routing protocol, and the target connection method is at least one of the preset connection methods; and using the target communication information and the target connection method to transmit information for each of the logical business information.

[0007] In an exemplary embodiment, before feeding back the target data to the target object, the method also includes: identifying a first number of processing requests corresponding to the target data and a second number of business requests corresponding to the target data; and determining the number of connections existing in the current communication process based on the first number and the second number.

[0008] In an exemplary embodiment, after determining the number of connections existing in the current communication process based on the first number and the second number, the method also includes: when it is determined that the number of connections is greater than a preset threshold number, determining that the current gateway connection component service layer is overloaded, and sending a prompt message for adding a gateway to the management object of the service framework; when it is determined that the number of connections is less than or equal to the preset threshold number, determining that the current gateway connection component service layer is operating normally.

[0009] According to another embodiment of the embodiment of the present application, a service framework for network communication is also provided, and a communication method applied to the service framework includes: an external receiving component service layer, which establishes a long connection with the user object, is used to determine the logical business information corresponding to the processing request sent by the user object, and forwards the logical business information to the gateway connection component service layer; the gateway connection component service layer is connected to the external receiving component service layer, is used to receive the logical business information, and sends business requests to multiple logical services corresponding to the logical business information in the logical business service layer; the logical business service layer is connected to the gateway connection component service layer, is used to generate target data that meets the business request, and associates the target data with the business request and then feeds it back to the gateway connection component service layer.

[0010] In an exemplary embodiment, the external receiving component service layer includes: a first extension sub-service, used to add a component service to the service framework of the network communication; a first long connection sub-service, used to configure a preset connection mode between the external receiving component service and the user object, wherein the preset connection mode includes at least one of the following: a transmission control protocol connection mode, a network socket protocol connection mode, and a user datagram protocol connection mode.

[0011] In an exemplary embodiment, the gateway connection component service layer includes: a cache sub-service, which is used to synchronize the target processing requests exceeding the preset number to the associated cache space for temporary storage when the number of processing requests forwarded by the external receiving component service layer is greater than the preset number; a second extension sub-service, which is used to add a new gateway to the gateway connection component service layer through a preset target protocol, and control the load of the new gateway.

[0012] In an exemplary embodiment, the logical business service layer includes: a feedback sub-service, which is used to determine the business type of the business request and determine the data structure of the generated target data according to the business type; a communication sub-service, which is used to determine the target communication mode corresponding to the business request and feed back the target data to the gateway connection component service layer through the target communication mode, wherein the target communication mode includes at least one of the following: a first communication mode corresponding to a single request, a second communication mode corresponding to communication between a single logical service, a third communication mode corresponding to communication between multiple logical services, and a fourth push mode corresponding to push broadcast.

[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the communication method of the above-mentioned service framework when running.

[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the communication method of the service framework through the computer program.

[0015] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned service framework communication method embodiments are implemented.

[0016] In an embodiment of the present application, the network communication service framework provided includes: an external receiving component service layer, a gateway connection component service layer, and a logical business service layer: the above method includes: receiving a processing request sent by a target object; configuring information for the processing request to obtain a business request, wherein the information configuration includes at least: load balancing data corresponding to the data request, and routing forwarding data corresponding to the data request; responding to the business request, generating target data corresponding to the logical business information; and feeding back the target data to the target object. The use of the above service framework and communication method solves the problem of too many connections between different services in the communication framework, resulting in high development costs. Furthermore, by introducing the gateway connection component service layer, efficient processing and forwarding of external network requests is achieved, network communication efficiency is improved, and development and maintenance costs are reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 is a structural block diagram of a service framework of network communication according to an embodiment of the present application;

[0020] Figure 2 is a structural diagram of a traditional network communication framework according to an embodiment of the present application;

[0021] Figure 3 It is a schematic diagram of a service framework structure of a three-layer system network communication according to an embodiment of the present application;

[0022] Figure 4 It is a service framework data flow diagram of a three-layer system network communication according to an embodiment of the present application;

[0023] Figure 5 It is a hardware environment schematic diagram of a communication method of a service framework according to an embodiment of the present application;

[0024] Figure 6 is a flow chart of a communication method of a service framework according to an embodiment of the present application;

[0025] Figure 7 is a block diagram of a computer system structure of an electronic device according to an embodiment of the present application;

[0026] Figure 8 An electronic device is provided for implementing a communication method of a service framework according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] In this embodiment, a network communication service framework is provided. Figure 1 It is a structural block diagram of a service framework of network communication according to an embodiment of the present application; it includes:

[0030] The external receiving component service layer 12 is used to establish a long connection with the user object, to determine the logical business information corresponding to the processing request sent by the user object, and to forward the logical business information to the gateway connection component service layer;

[0031] The gateway connection component service layer 14 is used to connect with the external receiving component service layer, receive logical business information, and send business requests to multiple logical services corresponding to the logical business information in the logical business service layer;

[0032] The logical business service layer 16 is used to connect with the gateway connection component service layer, to generate target data that meets the business request, and to associate the target data with the business request and then feed it back to the gateway connection component service layer.

[0033] Through the above service framework, the external receiving component service layer establishes a long connection with the user object to determine the logical business information corresponding to the processing request sent by the user object, and forwards the logical business information to the gateway connection component service layer; the gateway connection component service layer is connected to the external receiving component service layer to receive the logical business information and send business requests to multiple logical services corresponding to the logical business information in the logical business service layer; the logical business service layer is connected to the gateway connection component service layer to generate target data that meets the business request, and associate the target data with the business request and then feed it back to the gateway connection component service layer. The above service framework is adopted to solve the problem of too many connections between different services in the communication framework, resulting in high development costs. Furthermore, by introducing the gateway connection component service layer, efficient processing and forwarding of external network requests is achieved, network communication efficiency is improved, and development and maintenance costs are reduced.

[0034] In an exemplary embodiment, the external receiving component service layer includes: a first extension sub-service, used to add a component service to the service framework of the network communication; a first long connection sub-service, used to configure a preset connection mode between the external receiving component service and the user object, wherein the preset connection mode includes at least one of the following: a transmission control protocol connection mode, a network socket protocol connection mode, and a user datagram protocol connection mode.

[0035] Optionally, the external receiving component service layer is mainly responsible for connecting with users (players), providing support for TCP, WebSocket, and UDP connection methods. It maintains a long connection with users, has built-in details such as communication and connection methods, and can dynamically expand services. It also forwards requests sent by users through proxy servers to the second layer through a custom routing protocol, and the gateway connects to the component service layer.

[0036] Optional, long connection refers to a connection method that maintains a connection with a user for a long time in network communication. Compared with short connection, long connection can save the time of handshake and disconnection at each connection, and improve communication efficiency. In practical applications, long connection is usually used to maintain a long connection with the user in order to transmit data in real time or maintain interaction status. For example, long connection is often used in instant messaging, online and other applications to achieve real-time communication.

[0037] Optional. TCP stands for Transmission Control Protocol. TCP is a connection-oriented, reliable, byte-stream-based transport layer communication protocol used to transmit data in the network. TCP ensures reliable data transmission through mechanisms such as connection establishment, data segmentation, confirmation, and retransmission. TCP is one of the most commonly used transmission protocols on the Internet and is often used for data transmission of application layer protocols such as HTTP, FTP, and SMTP.

[0038] Optional, the full name of WebSocket is WebSocket Protocol, which is interpreted as "Network Socket Protocol" in Chinese. WebSocket is a protocol for full-duplex communication on a single TCP connection, which allows real-time data transmission between the client and the server. Through WebSocket, the client and the server can send messages at different time points without waiting for the response of the other party. The emergence of WebSocket has greatly improved the real-time and interactivity of Web applications.

[0039] Optional. UDP stands for User Datagram Protocol. UDP is a connectionless transport layer protocol that provides a simple data transmission service without guaranteeing the reliability and order of data. UDP is suitable for application scenarios that have high real-time requirements and can tolerate a small amount of data loss, such as real-time transmission of audio and video.

[0040] In an exemplary embodiment, the gateway connection component service layer includes: a cache sub-service, which is used to synchronize the target processing requests exceeding the preset number to the associated cache space for temporary storage when the number of processing requests forwarded by the external receiving component service layer is greater than the preset number; a second extension sub-service, which is used to add a new gateway to the gateway connection component service layer through a preset target protocol, and control the load of the new gateway.

[0041] Optionally, the gateway connection component service layer can load balance the logical business service layer, so that even if a certain logical business service layer fails, it will not affect the entire system, and forward the business request of the external receiving component service layer to the logical business service layer, and finally forward the response of the logical business service layer to the external receiving component service layer. In this way, the business processing of the logical business service layer is not connected and processed between business layers, but is transferred through the gateway connection component service layer, which reduces internal links and processing consumption and improves processing efficiency.

[0042] In an exemplary embodiment, the logical business service layer includes: a feedback sub-service, which is used to determine the business type of the business request and determine the data structure of the generated target data according to the business type; a communication sub-service, which is used to determine the target communication mode corresponding to the business request and feed back the target data to the gateway connection component service layer through the target communication mode, wherein the target communication mode includes at least one of the following: a first communication mode corresponding to a single request, a second communication mode corresponding to communication between a single logical service, a third communication mode corresponding to communication between multiple logical services, and a fourth push mode corresponding to push broadcast.

[0043] Optionally, the logic business service layer focuses on the development and processing of logic business, and multiple business services themselves do not link and interact, but are proxy-associated through the gateway connection component service layer. The logic business service layer is also responsible for processing the user's request, forwarding it to the gateway connection component service layer, and then through the gateway connection component service layer to the external receiving component service layer, and finally returning the data to the user end.

[0044] In order to better understand the service framework of the above-mentioned network communication, the service framework of the above-mentioned network communication is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.

[0045] In related technologies, traditional communication architectures are usually directly connected, usually in a two-layer system, divided into logical component services and external receiving component services. Each logical component service needs to establish a connection with other logical component services, which will cause a large amount of connection resource consumption, and at the same time, there will be a considerable loss in port setting and maintenance, as well as development costs. At the same time, it will also rely on a large number of middleware, resulting in a bloated communication framework and high development costs. Figure 2 As shown, Figure 2 It is a structural diagram of a traditional network communication framework according to an embodiment of the present application.

[0046] In order to solve the above problems, the optional embodiment of the present application proposes a three-layer network communication service framework. Specifically, the communication framework of this technology is mainly based on the JAVA Netty communication service framework, and adds a layer of gateway connection component service to the original two-layer communication system architecture to form a three-layer network communication framework. The three-layer system architecture has a clear division of labor, allowing developers to focus on the development of logical business, reducing the connection between business logics and service losses such as heartbeats, and has its own cache service. There is no need to mount and use other middleware, and the cost of network communication development and maintenance is greatly reduced. It can be widely used in communication services such as the Internet of Things.

[0047] Optional, Figure 3 Schematic diagram of a service framework structure of a three-layer network communication according to an embodiment of the present application; Figure 3 As shown in the figure, the external receiving component service layer is the first layer, which is mainly used to receive external network requests; the gateway connection component service layer is the second layer, which is responsible for load balancing, data forwarding, and routing addressing, and supports multiple communication methods through custom routing protocols, and has a built-in cache service; the logical business service layer is the third layer, which communicates through the second layer and executes specific business logic processing.

[0048] Optionally, the gateway itself carries a cache mechanism, and can expand multiple gateways for load through the gossip protocol, greatly improving concurrent throughput. Among them, the cache mechanism includes data cache and state cache, which are used to improve data processing efficiency. The cache service can reduce the number of requests to the backend service and speed up the data response speed. It is suitable for scenarios where data is frequently read, such as online advertising systems, recommendation engines, and data analysis platforms, which significantly improves the system's responsiveness and data processing efficiency. In addition, the dynamic network status update achieved through the gossip protocol ensures the high availability and reliability of the system, making the above framework have significant advantages in large-scale distributed systems.

[0049] Optionally, the service framework of the above three-layer network communication has built-in various communication methods and routing addressing functions, and shields the development details, allowing users to focus on business logic processing. The framework provides various extension interfaces to facilitate user extension. Communication methods include single request, single logical service communication, multiple logical service mutual communication, push broadcast and other functions. Among them, the push broadcast function can push information to one or more users who are using the communication framework. The routing protocol supports google protobuf and extended jprotobuf. Through these functions and features, the communication framework can meet various communication needs and improve development efficiency.

[0050] Optionally, Google Protocol Buffers (protobuf for short) is a lightweight data exchange format developed by Google for structured data serialization. It can be used in a variety of application scenarios such as data storage and communication protocols. Protobuf has the characteristics of efficient encoding and decoding performance, cross-platform support and scalability, and is widely used in large-scale distributed systems. After protobuf defines the data structure, it generates codes in different programming languages, allowing different languages ​​to communicate with each other easily.

[0051] Optionally, jprotobuf is a framework for simplifying the serialization and deserialization of Java objects. It provides a simple and efficient way to define and use serialization and deserialization rules between Java objects. By using jprotobuf, developers can more easily convert Java objects into byte streams for network transmission or persistent storage. This framework also supports multiple serialization formats, such as JSON, XML, and Protocol Buffers, allowing developers to choose the most suitable serialization method according to their needs. In general, jprotobuf can help developers quickly and conveniently handle the serialization and deserialization of Java objects.

[0052] Optional, Figure 4 It is a service framework data flow diagram of a three-layer system network communication according to an embodiment of the present application; Figure 4 As you can see, the flow of data is divided into two processes:

[0053] (1) Data entry process: The external service layer (first layer) receives user request data and forwards the request data to the gateway service layer (second layer). The gateway service layer obtains the required data and passes the data to the logical business service layer (third layer).

[0054] (2) Data return process: The logical business service layer (third layer) receives data from the gateway service layer (second layer), then performs business logic processing and finally returns the processing results to the gateway service layer (second layer). The gateway service layer (second layer) then returns the results to the external service layer (first layer) and finally returns them to external users.

[0055] In summary, the overall data flow is: user request->external service layer (first layer)->gateway service layer (second layer)->logic business service layer (third layer)->gateway service layer (second layer)->external service layer (first layer)->user. In the entire data flow process, each component service layer cooperates to complete the work of receiving, processing and returning data, so as to realize the smooth progress of the entire business process.

[0056] It should be noted that when transferring data between different component service layers, it is necessary to ensure the accuracy and integrity of the data to avoid data loss or errors that cause system abnormalities. At the same time, it is necessary to ensure that the data format transferred between different component service layers is consistent to ensure that the data can be correctly parsed and processed. In addition, various abnormal situations may occur during the data flow process. It is necessary to establish a complete exception handling mechanism to capture and handle exceptions in a timely manner to ensure the stability and reliability of the system. Furthermore, it is also necessary to log and monitor during the data flow process to promptly discover and troubleshoot problems and ensure the controllability and maintainability of the system operation.

[0057] The above framework is based on the JAVA Netty communication service framework, and adds a layer of gateway connection component service to the original two-layer communication system architecture to form a three-layer network communication framework. By adding the gateway connection component service layer, the direct connection between the external receiving component service layer and the logical business service layer is reduced, and the communication architecture is optimized. Even if a service in the logical business service layer fails, it will not affect the normal operation of the entire framework. Not only does it achieve efficient processing and forwarding of external network requests, but it also significantly improves data processing speed and reduces network latency through the built-in cache service. The use of the JAVA Netty communication service framework and efficient data serialization protocol further optimizes the performance of network communication and improves user experience.

[0058] According to one aspect of an embodiment of the present application, a communication method of a service framework is provided. The communication method of the service framework is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the communication method of the service framework can be applied to Figure 5 The hardware environment shown is composed of a terminal device 502 and a server 504. Figure 5 is a schematic diagram of a hardware environment of a communication method of a service framework according to an embodiment of the present application, such as Figure 5 As shown, the server 504 is connected to the terminal device 502 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 504. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 504.

[0059] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 502 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing equipment, a smart dishwasher, a smart projection equipment, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart speaker, a smart fresh air equipment, a smart kitchen and bathroom equipment, a smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification equipment, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0060] The embodiment of the present application also provides a communication method of a service framework, which is applied to the service framework of network communication described in any one of the above items. Figure 6 : is a flow chart of a communication method of a service framework according to an embodiment of the present application, and the flow includes the following steps:

[0061] Step S602, receiving a processing request sent by the target object via external data;

[0062] Step S604, performing information configuration on the processing request to obtain a service request, wherein the information configuration at least includes: load balancing data corresponding to the data request and routing forwarding data corresponding to the data request;

[0063] Step S606, responding to the service request and generating target data corresponding to the logical service information;

[0064] Step S608: Feedback the target data to the target object.

[0065] Through the above steps, the processing request sent by the target object through external data is received; the information of the processing request is configured to obtain a business request, wherein the information configuration at least includes: load balancing data corresponding to the data request, and routing forwarding data corresponding to the data request; in response to the business request, the target data corresponding to the logical business information is generated; and the target data is fed back to the target object. Furthermore, by introducing the gateway connection component service layer, efficient processing and forwarding of external network requests is achieved, network communication efficiency is improved, and development and maintenance costs are reduced.

[0066] In an exemplary embodiment, after receiving a processing request sent by a target object via external data, the method further includes: determining a plurality of logical business information corresponding to the processing request; matching corresponding target communication information and a target connection method for each of the plurality of logical business information, wherein the target communication information is used to indicate definition information of a currently used routing protocol, and the target connection method is at least one of the preset connection methods; and using the target communication information and the target connection method to transmit information for each of the logical business information.

[0067] Optionally, in a multiplayer online battle game, a player initiates a request, and the request will correspond to multiple logical business information, such as player movement, attack and other operations. For these logical business information, the system will determine the target game player communication information and connection method corresponding to each logical business information based on the player ID and game rules. For example, player A initiates an attack request, and the system determines the attack target as player B according to the game rules. The system will match the communication information of player A and player B, and select the best connection method for information transmission. At the same time, the system will define information based on the currently used routing protocol to ensure the security and stability of information transmission. Finally, player A's attack information will be transmitted to player B through the system to ensure the interactive effect and experience in the game. Through such a process, information transmission between different players in the game can be realized, and the fluency and accuracy of the game can be guaranteed.

[0068] In an exemplary embodiment, before feeding back the target data to the target object, the method also includes: identifying a first number of processing requests corresponding to the target data and a second number of business requests corresponding to the target data; and determining the number of connections existing in the current communication process based on the first number and the second number.

[0069] It can be understood that in the above embodiment, if the first number of processing requests corresponding to the target data is 100, and the second number of service requests corresponding to the target data is 50. Based on the first number and the second number, it is determined that the number of connections existing in the current communication process is 150. Determining the number of connections existing in the current communication process can help monitor the performance and stability of the system and promptly discover and solve connection problems.

[0070] In an exemplary embodiment, after determining the number of connections existing in the current communication process based on the first number and the second number, the method also includes: when it is determined that the number of connections is greater than a preset threshold number, determining that the current gateway connection component service layer is overloaded, and sending a prompt message for adding a gateway to the management object of the service framework; when it is determined that the number of connections is less than or equal to the preset threshold number, determining that the current gateway connection component service layer is operating normally.

[0071] Exemplarily, the preset threshold number is 100 connections, and the current number of connections is 120. The system will detect the overload at this time and send a prompt message to the management object of the service framework to add a gateway to increase system resources to handle additional connection requests. The management object can adjust the system configuration in time according to the prompt information, increase the number of gateways, and ensure the normal operation of the system. In addition, if the number of connections is 80, which is less than the preset threshold number of 100, the system will determine that the current gateway connection component service layer is operating normally and no additional processing is required. This can avoid unnecessary waste of resources and system expansion.

[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0073] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0074] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0075] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0076] S1, receiving a processing request sent by a target object through external data;

[0077] S2, performing information configuration on the processing request to obtain a service request, wherein the information configuration at least includes: load balancing data corresponding to the data request and routing forwarding data corresponding to the data request;

[0078] S3, responding to the business request and generating target data corresponding to the logical business information;

[0079] S4, feeding back the target data to the target object.

[0080] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0081] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0082] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0083] S1, receiving a processing request sent by a target object through external data;

[0084] S2, performing information configuration on the processing request to obtain a service request, wherein the information configuration at least includes: load balancing data corresponding to the data request and routing forwarding data corresponding to the data request;

[0085] S3, responding to the business request and generating target data corresponding to the logical business information;

[0086] S4, feeding back the target data to the target object.

[0087] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0088] Figure 7 The computer system structure block diagram for implementing the electronic device of the embodiment of the present application is schematically shown. It should be noted that: Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application. Figure 7 As shown, the computer system 500 includes a central processing unit 701 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 702 (ROM) or the program loaded from the storage part 708 to the random access memory 503 (RAM). Various programs and data required for system operation are also stored in the random access memory 703. The central processing unit 701, the read-only memory 702 and the random access memory 703 are connected to each other through a bus 704. An input / output interface 705 (Input / Output interface, i.e., I / O interface) is also connected to the bus 704.

[0089] The following components are connected to the input / output interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.

[0090] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processor 701, various functions defined in the system of the present application are executed.

[0091] According to another aspect of the embodiment of the present application, a communication electronic device for implementing the above service framework is also provided. Figure 8 As shown, the electronic device includes a memory 802 and a processor 804. The memory 802 stores a computer program, and the processor 804 is configured to execute the steps in any of the above method embodiments through the computer program.

[0092] Optionally, in this embodiment, the electronic device may be located in at least one of a plurality of network devices of a computer network. A person skilled in the art may understand that Figure 8 The structure shown is for illustration only, and the electronic device may also be a device including the above-mentioned flash memory. Figure 8 The structure of the electronic device is not limited. Figure 8 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 8 Different configurations are shown.

[0093] Among them, the memory 802 can be used to store software programs and modules, such as the communication of the service framework in the embodiment of the present application and the program instructions / modules corresponding to the device. The processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, that is, to achieve the above-mentioned communication. The memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 802 may further include a memory remotely located relative to the processor 804, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 802 can specifically be, but is not limited to, used for information such as logs containing modeling data. As an example, such as Figure 8 As shown, the memory 802 may include but is not limited to the modules in the service framework. In addition, it may also include but is not limited to other module units in the service framework device, which will not be described in detail in this example.

[0094] Optionally, the transmission device 806 is used to receive or send data via a network. Specific examples of the network may include wired networks and wireless networks. In one example, the transmission device 806 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 806 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0095] In addition, the electronic device further includes: a display 808; and a connection bus 810, which is used to connect various module components in the electronic device.

[0096] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0097] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0098] The embodiments of the present application also provide a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.

[0099] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0100] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0101] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A communication method for a service framework, characterized in that: The service framework applied to the external receiving component service layer, the gateway connection component service layer, and the logical business service layer includes: Receive the processing request sent by the target object; Performing information configuration on the processing request to obtain a service request, wherein the information configuration at least includes: load balancing data corresponding to the data request, routing forwarding data corresponding to the data request, and the service request corresponds to the logical service information; In response to the business request, generating target data corresponding to the logical business information; The target data is fed back to the target object.

2. The communication method of the service framework according to claim 1, characterized in that: After receiving the processing request sent by the target object through external data, the method further includes: Determine multiple logical business information corresponding to the processing request; Matching corresponding target communication information and target connection mode for each of the plurality of logical service information, wherein the target communication information is used to indicate definition information of a currently used routing protocol, and the target connection mode is at least one of the preset connection modes; The target communication information and the target connection mode are used to transmit each logical service information.

3. The communication method of the service framework according to claim 2, characterized in that: Before feeding back the target data to the target object, the method further includes: identifying a first number of processing requests corresponding to the target data and a second number of business requests corresponding to the target data; The number of connections existing in the current communication process is determined based on the first number and the second number.

4. The communication method of the service framework according to claim 3, characterized in that: After determining the number of connections existing in the current communication process based on the first number and the second number, the method further includes: when it is determined that the number of connections is greater than a preset threshold number, determining that the current gateway connection component service layer is overloaded, and sending a prompt message for adding a gateway to the management object of the service framework; When it is determined that the number of connections is less than or equal to a preset threshold number, it is determined that the current gateway connection component service layer operates normally.

5. A service framework for network communication, characterized in that: A communication method applied to a service framework as claimed in any one of claims 1 to 4, comprising: The external receiving component service layer establishes a long connection with the user object to determine the logical business information corresponding to the processing request sent by the user object, and forwards the logical business information to the gateway connection component service layer; The gateway connection component service layer is connected to the external receiving component service layer, and is used to receive logical business information and send business requests to multiple logical services corresponding to the logical business information in the logical business service layer; The logical business service layer is connected to the gateway connection component service layer, and is used to generate target data that meets the business request, and associate the target data with the business request and then feed it back to the gateway connection component service layer.

6. The network communication service framework according to claim 5, characterized in that: The external receiving component service layer includes: A first extended sub-service, used to add a component service to the service framework of the network communication; The first long connection sub-service is used to configure a preset connection mode between the external receiving component service and the user object, wherein the preset connection mode includes at least one of the following: a transmission control protocol connection mode, a network socket protocol connection mode, and a user datagram protocol connection mode.

7. The network communication service framework according to claim 5, characterized in that: The gateway connection component service layer includes: The cache sub-service is used to synchronize the target processing requests exceeding the preset number to the associated cache space for temporary storage when the number of processing requests forwarded by the external receiving component service layer is greater than the preset number; The second extended sub-service is used to add a new gateway to the gateway connection component service layer through a preset target protocol, and control the new gateway to load.

8. The network communication service framework according to claim 5, characterized in that: The logical business service layer includes: A feedback sub-service, used to determine the service type of the service request, and determine the data structure of the generated target data according to the service type; The communication sub-service is used to determine the target communication mode corresponding to the business request, and feed back the target data to the gateway connection component service layer through the target communication mode, wherein the target communication mode includes at least one of the following: a first communication mode corresponding to a single request, a second communication mode corresponding to communication between a single logical service, a third communication mode corresponding to communication between multiple logical services, and a fourth push mode corresponding to push broadcast.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 4 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 4 through the computer program.

Citation Information

Patent Citations

  • Online game system and accessing method and client communication method thereof

    CN101521683A

  • Processing system and processing method of online game business operating instructions

    CN101635721A

  • Data processing system and method, client, and server

    CN107645508A

  • Live broadcast service system, live broadcast method and server

    CN113132745A

  • Request processing method and device, gateway equipment, back-end server and storage medium

    CN118101762A