A data processing method, server, system and storage medium
By storing the matching relationship between the executor module and the information type in the server and sending it synchronously, combined with the real-time monitoring and processing of the thread pool module, the problem of low data processing efficiency of online game servers is solved, and faster data processing and game running speed are achieved.
Patent Information
- Application Number
- CN202111613188.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In existing technologies, the low data processing efficiency of online game servers leads to problems such as lag in games.
By storing the compatibility relationship between executor modules and information types in the server, the target information is synchronously sent to all compatible executor modules, and the thread pool module is used to monitor and process the information in real time.
It improved the server's data processing efficiency, reduced information processing latency, avoided game lag, and increased running speed.
Smart Images

Figure CN114404940B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and more specifically, to a data processing method, server, system, and storage medium. Background Technology
[0002] With the rapid development of the internet, many scenarios now involve large amounts of data. For example, in gaming, since most online games operate on global servers, the number of concurrent players is often very high. Therefore, improving data processing efficiency is a pressing issue. Summary of the Invention
[0003] This application provides a data processing method, server, system, and storage medium to at least partially solve the problem of low data processing efficiency in the prior art.
[0004] The embodiments of this application can be implemented as follows:
[0005] In a first aspect, this application provides a data processing method applied to a server, the server including multiple executor modules, the server storing the addresses of each executor module and the information types adapted to each executor module, the method including:
[0006] Obtain target information to be processed, wherein the target information carries the information type of the target information;
[0007] From the plurality of executor modules, all executor modules that are compatible with the information type of the target information are identified as the target executor modules;
[0008] The target information is sent to each of the target executor modules according to their addresses.
[0009] Optionally, sending the target information to each target executor module according to the address of each target executor module includes:
[0010] Based on the address of each target executor module, the target information is synchronously sent to each target executor module.
[0011] Optionally, the server stores the address of at least one remote server, and the method further includes:
[0012] The target information is sent to at least one of the remote servers based on the address of at least one of the remote servers.
[0013] Optionally, the server further includes a thread pool module, the thread pool module including at least one thread, each thread being matched with at least one of the executor modules, and the method further includes:
[0014] Based on the thread monitoring, it is determined whether the executor module matched with the thread has received the target information;
[0015] When the target information is detected, the information processing function corresponding to the information type of the target information is called to process the target information.
[0016] Optionally, the target information is game instructions that need to be executed by multiple executor modules.
[0017] Secondly, this application provides a data processing system, including multiple servers, which are connected in communication with each other. Each server includes multiple executor modules, and each server stores the address of each executor module and the information type adapted to each executor module.
[0018] Each server is used to acquire target information to be processed, the target information carrying the information type of the target information; and to determine all executor modules that are compatible with the information type of the target information from the plurality of executor modules, as the target executor modules;
[0019] Based on the addresses of each of the target executor modules, the target information is sent to each of the target executor modules; and the target information is sent to other servers that are communicatively connected to the server, so that the other servers can process the target information.
[0020] Optionally, the system further includes a network module for enabling communication between each of the servers; each of the servers stores the addresses of other servers.
[0021] Each of the servers is used to send the target information to other servers based on the addresses of other servers stored in the network module.
[0022] Optionally, each of the servers further includes:
[0023] A thread pool module, comprising at least one thread, each thread being matched with at least one executor module, for monitoring the matched executor module;
[0024] The server is also used to: monitor the executor module matched with the thread, and when the target information is detected, call the information processing function corresponding to the information type of the target information to process the target information according to the information type of the target information.
[0025] Thirdly, this application provides a server, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the methods described above.
[0026] Fourthly, this application provides a computer-readable storage medium, the computer-readable storage medium including a computer program, which, when executed, controls a server where the computer-readable storage medium is located to implement the steps of any of the methods described above.
[0027] The beneficial effects of the embodiments of this application include, for example:
[0028] By labeling the information type of the target information, the server can simultaneously send information to multiple executor modules that are compatible with a particular information type. This speeds up the server's data processing efficiency and improves its operating speed. Attached Figure Description
[0029] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 A schematic diagram of the structure of a server provided in this application;
[0031] Figure 2 A flowchart of a data processing method provided in this application;
[0032] Figure 3 A schematic diagram of the structure of an executor module provided in this application;
[0033] Figure 4 This application provides a schematic diagram of the structure of a thread pool module;
[0034] Figure 5 A schematic diagram of the data processing system provided in this application;
[0035] Figure 6 This is a schematic diagram of the server structure provided in this application;
[0036] Figure 7 This is a schematic diagram of the internal server interaction of the data processing system provided in this application;
[0037] Figure 8 This is a schematic diagram of the structure of the data processing system provided in the embodiments of this application;
[0038] Figure 9 This is another structural diagram of a data processing system provided in this application.
[0039] Icons: 100 - Server; 110 - Memory; 120 - Processor; 130 - Communication Module; 300 - Data Processing System; 3011 - Executor Module; 3012 - Network Module; 3013 - Thread Pool Module; 3113 - Thread. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0041] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0042] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0043] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.
[0044] The data processing method provided in this application can be applied to data interaction scenarios between servers and within each server in online games.
[0045] With the increasing number of internet users and the development of science and technology, online games are also evolving rapidly. From the initial single-player games on local area networks, to the later regional servers for online games, and now to nationwide and even global servers, the data processing pressure on online game servers is increasing. On the one hand, it's necessary to ensure the server's efficiency in processing in-game data to prevent lag and other issues during gameplay; on the other hand, it must be able to handle a massive number of game users.
[0046] In current technology, most online game servers use the dispatcher module to dispatch messages based on the address of the executor module contained in the received information. After receiving the next message, the dispatcher module is dispatched again based on the address of the executor module contained in that message. This method inevitably causes the dispatcher module to have a high information processing load and delays in sending and receiving information, which further manifests in problems such as frame drops and stuttering in the game.
[0047] Please refer to Figure 1 This is a block diagram of a server 100 provided in this application, including a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0048] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0049] The processor 120 is used to read / write data or programs stored in memory and to perform corresponding functions.
[0050] The communication module 130 is used to establish a communication connection between the server and other communication terminals through the network, and to send and receive data through the network.
[0051] It should be understood that, Figure 1The structure shown is only a schematic diagram of server 100; server 100 may also include components such as... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown, for example: server 100 may also include dispatcher module, executor module, etc. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.
[0052] like Figure 2 As shown, this application provides a data processing method, which mainly includes the following steps:
[0053] Step S101: Obtain target information to be processed, wherein the target information carries the information type of the target information;
[0054] Step S102: Determine all executor modules from the plurality of executor modules that are compatible with the information type of the target information, and use them as the target executor modules;
[0055] Step S103: Send the target information to each target executor module according to the address of each target executor module.
[0056] The target information in step S101 can be encapsulated into a dynamic memory block using a structure, which is destroyed after processing. Besides the content to be processed, the target information also includes its information type, which can be customized by the user during configuration, such as calculation type or broadcast type. The target information to be processed can be obtained from direct user input or from a user-created module used to send the target information to be processed.
[0057] In step S102, each server contains multiple executor modules, which can be the Actor model in a distributed concurrent programming paradigm. In the solution provided in this application, the internal structure of the Actor model includes a unique name (i.e., address), an email address for receiving target information, and its corresponding information type. For example... Figure 3 The diagram shown is a structural schematic of the executor module.
[0058] The information type that each executor module adapts to is stored on the server. After obtaining the target information, the server can filter out the executor modules that adapt to the information type of the target information from the executor modules and identify these executor modules as the target executor modules.
[0059] For example, if the target information is of type X, and there are three executor modules A, B, and C, where A is adapted to information types X, Y, and Z, B is adapted to information types X and Y, and Z is adapted to information types Y and Z, then when the server receives the target information, it will determine that A and B are the target executor modules from A, B, and C.
[0060] The server can also store the address of each executor module. After the target executor module is determined, the server can send the target information to the mailbox of the target executor module according to the address of the target executor module.
[0061] Using the example above, once the server determines that A and B are the target executor modules, it will send the target information to the email addresses of A and B based on their addresses.
[0062] Optionally, sending the target information to each target executor module according to the address of each target executor module includes: synchronously sending the target information to each target executor module according to the address of each target executor module.
[0063] In a preferred embodiment, when the server sends target information to the target executor module, it can adopt a method of sending the information synchronously to multiple target executor modules to improve the server's working efficiency.
[0064] Optionally, the server stores the address of at least one remote server, and the method further includes: sending the target information to at least one remote server according to the address of at least one remote server.
[0065] In a large-scale online game, multiple servers are often required. In the solution provided in this application, data can be transmitted between servers. Each server can store one or more remote server addresses. After receiving target information, the server can send the target information to the remote server according to the remote server addresses stored internally. This process can occur after the server sends the target information to the target executor module, before it, or synchronously. The operator can configure this according to the specific situation, and this application does not impose any limitations on it.
[0066] Optionally, the server further includes a thread pool module, which includes at least one thread, each thread being matched with at least one executor module. The method further includes: monitoring whether the executor module matched with the thread has received target information based on the thread; when the target information is detected, calling an information processing function corresponding to the information type of the target information to process the target information.
[0067] like Figure 4 The diagram shows the structure of the thread pool module. The thread pool module contains multiple threads, each matched with one or more executor modules, and continuously monitors whether its matched executor module has received the target information. When a thread detects that one or more matched executor modules have received the target information, it will call the corresponding information processing function to process the target information based on its information type.
[0068] Using the example above, if thread L matches executor module A, then L will monitor A's email in real time. When the server sends the target information to A's email, L will detect the target information and, based on the information type X of the target information, call the information processing function corresponding to X to process the target information.
[0069] Optionally, the target information is game instructions that need to be executed by multiple executor modules.
[0070] Based on the same inventive concept, this application also provides a data processing system 300, such as... Figure 5 As shown, it includes multiple servers 100, which are connected to each other. Each server 100 includes multiple executor modules 3011.
[0071] like Figure 6 As shown, each server 100 stores the address of each executor module 3011 and the information type adapted to each executor module 3011; each server 100 is used to obtain target information to be processed, the target information carrying the information type of the target information; all executor modules 3011 that are adapted to the information type of the target information are determined from the multiple executor modules 3011, as target executor modules; the target information is sent to each target executor module according to the address of each target executor module; and the target information is sent to other servers that are communicatively connected to server 100 so that the other servers can process the target information.
[0072] The data processing system 300 consists of multiple servers 100 that can communicate with each other, and each server 100 contains multiple executor modules 3011. Each server 100 stores the addresses of its various executor modules 3011, enabling it to send instructions or information to designated executor modules 3011. Each executor module 3011 has its own matched information type, and the compatibility relationship between each executor module 3011 and its matched information type is also stored in the server 100. When a server 100 obtains target information, it determines the target executor module based on the compatibility relationship between each executor module 3011 and its matched information type, and then sends the target information to the target executor module. Additionally, the server 100 also sends the target information to other servers with which it has a communication connection.
[0073] Optionally, the data processing system 300 further includes a network module 3012 for enabling communication between each server 100; each server 100 stores the addresses of other servers; each server 100 is used to send target information to other servers based on the stored addresses of other servers via the network module 3012.
[0074] like Figure 7 The diagram illustrates the interaction between each server 100 in the data processing system 300. In the data processing system 300, each server 100 stores the addresses of other servers 100 with which it needs to exchange information, and each server 100 communicates with each other through a network module 3012. When information exchange is needed, a server 100 sends information to other servers with which it has a communication connection via the network module 3012.
[0075] Optionally, such as Figure 8 As shown, each server 100 also includes a thread pool module 3013, each thread pool module 3013 including at least one thread 3113. Each thread 3113 is matched with one or more executor modules 3011 for monitoring the matched executor modules 3011. Specifically, the thread 3113 can continuously refresh to monitor the mailbox of the executor module 3011 in real time. The server 100 monitors the matched executor modules 3011 based on the thread 3113. When target information is detected, the server 100 calls the information processing function corresponding to the information type of the target information to process the target information.
[0076] Optionally, the executor module is an Actor model. Each Actor model encapsulates only its own data and does not share data. Each Actor model contains only private member variables and private member functions, with no externally exposed interfaces.
[0077] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods of the data processing method described above.
[0078] To better illustrate the solution of this application, the following example uses a system broadcast scenario in an online game to explain the solution:
[0079] In a certain online game, the system needs to broadcast to all servers, with the broadcast content being "XXX". For example... Figure 9 The diagram shows the system's structure. Administrators can send a target message to the dispatcher module by creating a module for sending information or by directly issuing a command. The target message content is "XXX" and the message type is "broadcast".
[0080] After obtaining the content and type of the target information, the dispatcher module, based on the information types matched by various executor modules stored in its database, finds the executor module that matches the "broadcast" information type and identifies it as the target executor module. Simultaneously, the dispatcher module, using the addresses of other servers stored in its database, sends the target information to the dispatcher modules on those other servers via the network module. The dispatcher modules on those other servers then determine the target executor module on their own servers in the same manner.
[0081] After identifying all target executor modules across all servers, all dispatcher modules synchronously send the target information content "XXX" to all target executor modules. It should be noted that "synchronous" here does not mean absolute synchronization, but rather that within the allowable error delay range, it is considered synchronous transmission.
[0082] The number of threads started in the thread pool module can be adjusted by the administrator based on actual needs. Each thread in the thread pool module continuously updates to monitor its matched executor module. When the target information sent by each dispatcher arrives at the mailbox of each executor module, the matched thread immediately detects the target information. If the thread analyzes the target information and determines that the information type is "broadcast," it calls the corresponding information processing function for "broadcast" information type to process the target information. Ultimately, players see a broadcast announcement in the game containing the content "XXX".
[0083] The technical solutions described in the embodiments of this application have at least the following technical effects or advantages:
[0084] 1. By storing the adaptation relationship between each executor module 3011 and the information type in the server 100, after the server 100 receives a certain target information, it can synchronously send all executor modules 3011 that are adapted to the information type of the target information according to the information type of the target information, thereby improving the data processing efficiency of the server 100 and speeding up the operation of the server 100.
[0085] 2. After receiving a target information, a server 100 in the data processing system 300 can send the target information to other servers 100. Other servers 100 can also synchronously send the target information to the executor module 3011 that is adapted to the information type according to the information type of the target information, which further speeds up the overall data processing efficiency of the data processing system 300.
[0086] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data processing method, characterized in that, The method is applied to a server, which includes multiple executor modules and multiple thread pool modules. Each thread pool module includes at least one thread, and each thread is matched with at least one executor module. The server stores the addresses of each executor module and the information types adapted to each executor module. Obtain target information to be processed, wherein the target information carries the information type of the target information; From the plurality of executor modules, all executor modules that are compatible with the information type of the target information are identified as the target executor modules; Based on the address of each target executor module, the target information is sent to each target executor module; Based on the thread monitoring, the executor module matched with the thread has received the target information; when the target information is detected, the information processing function corresponding to the information type of the target information is called to process the target information.
2. The method as described in claim 1, characterized in that, The step of sending the target information to each target executor module according to the address of each target executor module includes: Based on the address of each target executor module, the target information is synchronously sent to each target executor module.
3. The method as described in claim 2, characterized in that, The server stores the address of at least one remote server, and the method further includes: The target information is sent to at least one of the remote servers based on the address of at least one of the remote servers.
4. The method according to any one of claims 1 to 3, characterized in that, The target information is the game instructions that need to be executed by multiple of the aforementioned executor modules.
5. A data processing system, characterized in that, It includes multiple servers, which are connected to each other. Each server includes multiple executor modules and multiple thread pool modules. Each thread pool module includes at least one thread. Each thread is matched with at least one executor module and is used to monitor the matched executor module. Each server stores the address of each executor module and the information type adapted to each executor module. Each of the servers is used to obtain target information to be processed, wherein the target information carries the information type of the target information; From the plurality of executor modules, all executor modules that are compatible with the information type of the target information are identified as the target executor modules; Based on the address of each target executor module, the target information is sent to each target executor module; In addition, the target information is sent to other servers that are communicatively connected to the server, so that the other servers can process the target information; The server is also used to: monitor the executor module matched with the thread, and when the target information is detected, call the information processing function corresponding to the information type of the target information to process the target information according to the information type of the target information.
6. The system as described in claim 5, characterized in that, The system also includes a network module for enabling communication between each of the servers; each of the servers stores the addresses of other servers. Each of the servers is used to send the target information to other servers based on the addresses of other servers stored in the network module.
7. A server, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the method according to any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program, which, when executed, controls the server where the computer-readable storage medium is located to implement the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Information pushing method, server, multi-port repeater and storage medium
CN111400598A
Message distribution processing method, device, equipment, and storage medium
WO2020181913A1