Information processing method and device, storage medium and electronic equipment
By communicating in the local area network of the server cluster, the real-time synchronization of friend change information is solved, and the problem of high pressure for querying friend information in games with large users is achieved, fast and real-time friend information transmission is achieved, and information processing efficiency is improved.
Patent Information
- Application Number
- CN202510505507.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-06-06
AI Technical Summary
In the game with a large number of users, a large number of users perform friends information query and other operations at the same time, resulting in high pressure on the server, which may lead to delays and inaccurate updates of friends information, affecting the efficiency of information processing.
By communicating in the local area network of the server cluster, the target friend player account of the current player account is determined, and through the subscription instruction information mechanism, the friend change information is synchronized in real time, thereby improving the efficiency of friend information transmission.
It realizes fast and real-time synchronization of player's friend change information, reduces server pressure, and improves the accuracy and efficiency of friend information transmission.
Smart Images

Figure CN120094215A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an information processing method, device, storage medium and electronic device. Background Art
[0002] With the rapid development of life and technology, people often use game applications for entertainment. In games, users often need to query friends' information. In existing information processing methods, the query request of the client is often forwarded from the game server (GameServer) to the service module (FriendService) for friend-related content, so that the corresponding friend information is pulled out by FriendService according to the friend list information and returned to the client for display.
[0003] In the process of research and practice of existing technologies, it was found that for some games with a large number of users, a large number of users simultaneously performing different friend interaction operations such as friend information query will cause great pressure on the server, and it is very likely to cause update delays in friend information with high real-time requirements, such as the current online status of friends, resulting in inaccurate acquisition of friend information and poor information processing efficiency. Summary of the invention
[0004] The embodiments of the present application provide an information processing method, device, storage medium and electronic device, which can realize fast and real-time synchronization of information about changes in a player's friends, thereby improving the efficiency of friend information transmission.
[0005] The present application embodiment provides an information processing method, which is applied to a first server where a current player account is located, the first server belongs to a server cluster, and the servers in the server cluster communicate via a local area network configured for the server cluster, the method comprising:
[0006] In the case where the current player account logs into the target game, determining a target friend player account in the target game that is online with the current player account, the second server where the target friend player account is located is a server of the server cluster;
[0007] Sending subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed;
[0008] The player change information is received and sent to the first client corresponding to the current player account.
[0009] Accordingly, an embodiment of the present application provides an information processing device, which is applied to a first server where a current player account is located, the first server belongs to a server cluster, and the servers in the server cluster communicate through a local area network configured for the server cluster, including:
[0010] A determination unit, configured to determine, when the current player account logs into the target game, a target friend player account in the target game that is online, wherein the second server where the target friend player account is located is a server of the server cluster;
[0011] a sending unit, configured to send subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed;
[0012] The synchronization unit is used to receive the player change information and send it to the first client corresponding to the current player account.
[0013] In addition, the embodiment of the present application also provides another information processing method, the method comprising:
[0014] Receiving a request for obtaining online friend mailbox information for the current player account sent by the first server;
[0015] Obtaining online friend mailbox information corresponding to the current player account, wherein the online friend mailbox information is used to determine a target friend player account of the current player account that is online;
[0016] The online friend mailbox information is sent to the first server, so that the first server determines the target friend player account of the current player account that is online based on the online friend mailbox information, and the second server where the target friend player account is located is a server of the server cluster. Subscription indication information for the target friend player account is sent to the second server through the first mailbox object of the current player account to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed, receive the player change information, and send it to the first client corresponding to the current player account.
[0017] Accordingly, an embodiment of the present application further provides an information processing device, including:
[0018] A receiving unit, configured to receive a request for obtaining online friend mailbox information for a current player account sent by the first server;
[0019] An acquisition unit, configured to acquire online friend mailbox information corresponding to the current player account, wherein the online friend mailbox information is used to determine a target friend player account of the current player account that is in an online state;
[0020] An information sending unit is used to send the online friend mailbox information to the first server, so that the first server determines the target friend player account of the current player account that is online based on the online friend mailbox information, and the second server where the target friend player account is located is a server of the server cluster. Subscription indication information for the target friend player account is sent to the second server through the first mailbox object of the current player account to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed, receive the player change information, and send it to the first client corresponding to the current player account.
[0021] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for loading by a processor to execute the steps in any information processing method provided in the embodiment of the present application.
[0022] In addition, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the information processing method provided in the embodiment of the present application.
[0023] An embodiment of the present application also provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps in the information processing method provided in the embodiment of the present application.
[0024] The embodiment of the present application is applied to the first server where the current player account is located, the first server belongs to a server cluster, and the servers in the server cluster communicate through the local area network configured for the server cluster. When the current player account logs in to the target game, the target friend player account of the current player account in the target game is determined, and the second server where the target friend player account is located is a server of the server cluster; through the first mailbox object of the current player account, the subscription indication information for the target friend player account is sent to the second server to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes; the player change information is received and sent to the first client corresponding to the current player account. In this way, the player change information of the target friend player account in the online state of the current player account is transmitted to the first server where the current player account is located through the first mailbox object and the second mailbox object communicating in the local area network of the server cluster, and the player change information can be transmitted quickly and in real time between the first server of the current player account and the second server of the target friend player account based on the intranet of the server cluster, so as to achieve fast and real-time synchronization to the client of the current player account, and improve the friend information transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 This is a schematic diagram of an implementation scenario of an information processing method provided in an embodiment of the present application;
[0027] Figure 2 It is a flowchart of an information processing method provided by an embodiment of the present application;
[0028] Figure 3a It is a schematic diagram of an information processing flow of an information processing method provided in an embodiment of the present application;
[0029] Figure 3b It is a schematic diagram of updating friend information of an information processing method provided in an embodiment of the present application;
[0030] Figure 4a is another information processing flow diagram of an information processing method provided by an embodiment of the present application;
[0031] Figure 4bIt is another information processing flow diagram of an information processing method provided in an embodiment of the present application;
[0032] Figure 4c It is a specific framework schematic diagram of an information processing method provided in an embodiment of the present application;
[0033] Figure 5 is another flowchart of an information processing method provided by an embodiment of the present application;
[0034] Figure 6 is a schematic diagram of the structure of an information processing device provided in an embodiment of the present application;
[0035] Figure 7 is another structural schematic diagram of the information processing device provided in an embodiment of the present application;
[0036] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 those skilled in the art without creative work are within the scope of protection of this application.
[0038] The embodiments of the present application provide an information processing method, device, storage medium and electronic device. The information processing device can be integrated in an electronic device, and the electronic device can be a server or a terminal.
[0039] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. Terminals may include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Terminals and servers can be directly or indirectly connected via wired or wireless communications, and this application does not limit this.
[0040] See also Figure 1 , taking the example of an information processing device integrated into an electronic device, Figure 1A schematic diagram of an implementation scenario of the information processing method provided in an embodiment of the present application, wherein the electronic device can, when the current player account logs in to the target game, determine a target friend player account in the target game where the current player account is online, and the second server where the target friend player account is located is a server of the server cluster; send subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes; receive the player change information and send it to the first client corresponding to the current player account.
[0041] It should be noted that Figure 1 The implementation environment scenario diagram of the information processing method shown is only an example. The implementation environment scenario of the information processing method described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. It is known to those skilled in the art that with the evolution of data processing and the emergence of new business scenarios, the technical solution provided by the present application is also applicable to similar technical problems.
[0042] The solutions provided by the embodiments of the present application are specifically described by the following embodiments. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0043] This embodiment will be described from the perspective of an information processing device. The information processing device may be integrated into an electronic device. The electronic device may be a terminal and / or a server, and this application does not limit this.
[0044] See also Figure 2 , Figure 2 : is a flow chart of an information processing method provided by an embodiment of the present application. The information processing method is applied to the first server where the current player account is located, the first server belongs to a server cluster, and the servers in the server cluster communicate via a local area network configured for the server cluster, and the method includes:
[0045] In step 101, when the current player account logs into the target game, a target friend player account in the target game that is online with the current player account is determined.
[0046] Among them, the second server where the target friend player account is located is a server of the server cluster.
[0047] Among them, the current player account can be a player account managed by the first server, and the first server establishes a communication connection with the client corresponding to the current player account, and the first server realizes information interaction between the client of the current player account and the client of the friend player account of the current player account in the target game. The friend player account can be a player account with which the current player account has a friend relationship. The target game can be a game to which the current player account belongs. The server cluster can be a cluster where the game server (GameServer) of the target game is located, and the game server can also be called a game lobby server or a role server. The game server can be used to receive and process modules of conventional requests from clients. The servers in the server cluster can be in the same computer room. The servers in the server cluster can communicate through the local area network configured for the server cluster, so that the servers in the server cluster can communicate based on the intranet of the server cluster. Compared with the cross-cluster communication method, communication based on the intranet of the server cluster can improve the real-time nature of information transmission.
[0048] The target friend player account may be a player account that is online among the friend player accounts of the current player account in the target game. The second server may be a server where the target friend player account is located, that is, the client corresponding to the target friend account establishes a network connection with the second server. The second server is a server in a server cluster.
[0049] Optionally, since the client of the target friend player account and the client of the current player account may establish a network connection with the same server, the first server and the second server may be the same server or different servers.
[0050] Among them, when the current player account logs in to the target game, there can be multiple ways to determine the target friend player account that is online in the target game. For example, when the current player account logs in to the target game, the first microservice can be used to obtain friend list data; based on the friend list data, a request for obtaining online friend mailbox information is sent to the second microservice; the online friend mailbox information returned by the second microservice is received; and the target friend player account that is online in the current player account is determined based on the online friend mailbox information.
[0051] The first microservice may be a microservice module (FriendService) for processing all friend-related content in the target game, and may be deployed in multiple processes for load balancing. The friend list data may be data indicating a friend player account in a friend list of the current player account, and the second microservice may be a high-frequency information query microservice (AvatarBriefInfoService), which may be used to query high-frequency information related to friends. The online friend mailbox information acquisition request may be a request for acquiring online friend mailbox information. The online friend mailbox information may be used to store the mailbox object information of the target friend player account whose current player account is online, and the mailbox object information may be the mailbox information of the mailbox object, and the mailbox information may include the object identifier of the mailbox object.
[0052] Optionally, in the first server, relevant data can be stored for each player account (Avatar), for example, it can include the player's friend data (represented by friend_data) and the player's friend application list (apply_friend_data). These data are stored in the Avatar, and their life cycle is from the player's login to offline. The first microservice FriendService is the data center that manages the friend data of all players. The data stored in the memory of the first server can include application lists, friend lists, blacklists, friend recommendations, close relationships, etc., which can all be a data structure of a page replacement algorithm (Least Recently Used, LRU). This data will give priority to data that has been used recently and has a high frequency of use. Avatar will initiate operations such as adding, querying, changing, and deleting to FriendService. The data in FriendService is trustworthy. Avatar will unconditionally believe the data sent by FriendService to prevent data inconsistency.
[0053] Optionally, the mailbox object (Mailbox) can be an object encapsulated based on the underlying information processing method provided in the embodiment of the present application. The mailbox object can contain at least three elements: an Internet Protocol (IP) address, a port number (Port) and an object identifier (Entity_id). It can communicate directly with other mailbox objects based on the IP and Port information in the Mailbox. The object identifier Entity_id can be understood as the unique identifier of the mailbox object. There can be multiple mailbox objects corresponding to the same IP address or Port.
[0054] Among them, the IP address and port of the mailbox object belong to the server cluster. Therefore, the mailbox objects can communicate with each other within the local area network of the server cluster, thereby transmitting friend information based on the mailbox object, realizing fast and real-time updating of friend information and improving the efficiency of friend information transmission.
[0055] In a specific embodiment, please refer to Figure 3a , Figure 3a This is a schematic diagram of the information processing flow of an information processing method provided by an embodiment of the present application, wherein Avatar1 and Avatar2 represent player accounts. For example, Avatar1 can represent the current player account, which is maintained by the first server, and Avatar2 can represent the friend player account corresponding to the current player account, which is maintained by the second server. When the player logs in, the first server will call the relevant interface (Init friendsystem) to request to initialize the friend list, thereby triggering a friend list acquisition (GetFriendList) request to the first microservice FriendService to automatically obtain the friend list data of the current player account. FriendService will first obtain the friend list data corresponding to the current player in the memory cache (i.e., friend_list_cache). If it is not in the memory, it will be read from the distributed document storage database (MongoDB) and then stored in the memory of the first microservice. The first server managing Avatar1 can request to initialize the friend list callback and receive the friend list data returned by the first microservice. After obtaining the friend list data, the first server of Avatar1 will query the online players in the friend list of the current player. For example, by calling the online friend mailbox information acquisition interface (batch_get_online_friend_mailbox), an online friend mailbox information acquisition request is sent to the second microservice to request batch acquisition of online friends' mailbox information, so as to return the online friend mailbox information to the first server through the second microservice. In this step, for the online friend player account, the mailbox information of the corresponding mailbox (equivalent to an address that can establish a direct connection) will be returned, which will be uniformly stored in the online friend mailbox information storage space (online_friend_mailbox) of the first server. The mailbox object mailbox allows high-speed intranet communication between the player account and the client of the online friend player account. For offline friend players, the last offline time of the offline friend can be returned.
[0056] After the first server obtains the mailbox information of all online friends of the current player account, it can initiate an online notification (on_friend_online) to the second mailbox object of all online friends through the first mailbox object corresponding to the current player account, that is, to notify online friends that they are online, and then the second server of online friends will return a monitoring message (add_hall_subscriber) through the second mailbox object to notify the current player account to monitor its own information changes, so as to realize the subscription of the current player account and the friend player account. Subsequently, the information synchronization interface (sync_online_avatar_info) can be used to synchronize status changes with each other, such as the change information from the idle state to the game state of the friend, which can be notified to each other in real time, so as to realize fast, real-time and efficient information synchronization between online friends.
[0057] In step 102, subscription indication information for the target friend player account is sent to the second server through the first mailbox object of the current player account, so as to trigger the second server to send player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed.
[0058] The first mailbox object may be a mailbox object corresponding to the current player account, the subscription indication information is used to instruct the second mailbox object corresponding to the target friend player account to subscribe to the current player account, and the second mailbox object may be a mailbox object corresponding to the target friend player account. The player change information may be information about changes to the target friend player account.
[0059] There are many ways to send subscription indication information for a target friend player account to the second server through the first mailbox object of the current player account. For example, the second mailbox object information corresponding to the target friend player account can be determined; and the subscription indication information for the target friend player account can be sent to the second mailbox object of the target friend player account in the second server based on the second mailbox object information through the first mailbox object of the current player account.
[0060] The second mailbox object information may be information indicating the mailbox object corresponding to the target friend player account, that is, the mailbox information of the second mailbox object.
[0061] There are many ways to determine the second mailbox object information corresponding to the target friend player account. For example, the second mailbox object information corresponding to the target friend player account can be extracted from the online friend mailbox information.
[0062] In this way, since the current player account will request the second microservice to obtain the online friend email information when logging in, the email information stored in the online friend email information can be used to determine in real time the target friend player account in the online state corresponding to the current player account, and obtain the email information of the second email object corresponding to the online target friend player account. Based on the email information of the second email object, information can be transmitted to the second server corresponding to the target friend player account in real time and quickly, so as to realize real-time friend information update when the friend player account information changes, thereby improving the efficiency of friend information update and transmission.
[0063] In one embodiment, when the target friend player account corresponding to the current player account goes offline, the second server can send an offline notification to the first mailbox object through the second mailbox object, so that the first server can receive the friend offline notification message sent by the second server through the second mailbox object through the first mailbox object; and delete the second mailbox object information in the online friend mailbox information.
[0064] Among them, the friend offline notification message can be a message sent by the second mailbox object, which is used to indicate that the corresponding target friend player account is offline. In this way, by using the mailbox information of the second mailbox object stored in the online friend mailbox information, the target friend player account in the online state corresponding to the current player account can be obtained in real time and accurately, so as to perform real-time communication with the second mailbox object corresponding to the online target friend player account based on the mailbox information stored therein, and realize real-time synchronization of friend information.
[0065] Optionally, there may be multiple ways to send subscription indication information for a target friend player account to the second mailbox object of the target friend player account in the second server through the first mailbox object of the current player account based on the second mailbox object information. For example, when the first client triggers a view event for the friend list of the current player account, the subscription indication information for the target friend player account may be sent to the second mailbox object of the target friend player account in the second server through the first mailbox object of the current player account based on the second mailbox object information.
[0066] The first client may be a client logged in by the current player account.
[0067] In this way, for the query and update of online friends' information in the target game, an online friend list and a corresponding mailbox can be maintained for each player in the server cluster. Players subscribe to all online friends through the mailbox. When the information of online friends changes, the friend information can be updated directly through the mailbox. Since the information transmitted through the mailbox only circulates within the game lobby server of the target game and takes the intranet dedicated line of the server cluster, the real-time performance is very high and the communication cost is very low. In addition, the subscription mode between mailbox objects is only enabled when the player account opens the friend list. When the player closes the friend list, since the player does not need to view the friend information at this time and no longer needs to update the friend information in real time, the subscription mode between mailbox objects can be turned off to save the performance of friend information transmission. When the player opens the friend list again, the above process is repeated.
[0068] In one embodiment, please refer to Figure 3b , Figure 3b It is a schematic diagram of friend information update of an information processing method provided by an embodiment of the present application. For information query and update of online friends, an embodiment of the present application provides a mailbox-based real-time status subscription system to realize real-time update of online friend information, wherein the server in the server cluster maintains an online friend list and a corresponding mailbox for each player account, and the player subscribes to all online friends. When the information of the online friend changes, the friend information is directly updated through the mailbox. Since the information transmitted through the mailbox only circulates within the role server and takes the intranet dedicated line of the server cluster, the real-time performance is very high and the cost is very low, so that the information in the role server is synchronized in real time when the attribute of the target friend player account changes. For information query of offline friends, due to the limitation of the friend interface that displays the friend list, the friend list actually seen by the player needs to turn the page, so the offline friends of the current player account can be sorted in the friend list according to the last offline time. For example, a separate memory database (Redis) can be used to record the last offline time of each player in this season, so that when the friend list is initialized, the offline friends in the friend list can be sorted, thereby realizing paging and pulling of the friend list, avoiding pulling all friend information at once, reducing server load, and improving the efficiency of friend information synchronization.
[0069] Optionally, for the friend information of the player's offline friends, the offline friend information acquisition interface (do_init_friend_detail_offline) can be used to obtain the offline friend information. At the same time, the three-layer information storage mechanism provided by the second microservice AvatarBriefInfoService can be used to efficiently query the friend information. For example, please continue to refer to Figure 3aWhen the friend interface of the current player account turns to offline friends, the offline friend information can be initialized, and a list of offline friends can be given to obtain the corresponding friend information from the second microservice in batches. For example, the three-layer information storage mechanism provided by the second microservice AvatarBriefInfoService can be used to perform efficient friend information query. Since the number of friends displayed on a single page in the player's friend list is limited, the offline friends can be sorted according to the offline time of the obtained offline friends, and the information of offline friends can be obtained in batches, and only the information of offline friends currently displayed on the friend list page can be requested. In this way, the server load pressure can be reduced, and the problem of players being unable to obtain friend information in a timely manner can be avoided.
[0070] Since player information is generally stored in the form of key-value pairs, the data sharing and centralization characteristics of microservices can be used to use a three-layer information storage mechanism to query high-frequency player information. Specifically, when a request for player friend information is made to the second microservice, there can be four query steps, namely, first querying the microservice memory LRU of the second microservice, if no result is found, then continue to try to query Redis, and if no relevant information is found, query the Mongo database. Among them, the microservice memory LRU refers to the data in the server memory, which can be directly accessed and is the most efficient way to obtain data, but the storage space is small. Redis is a hot data access database with a large storage space and relatively high data acquisition efficiency. Mongo is a cold data access database with the largest storage space, but the data acquisition rate is relatively slow. In this way, querying offline friend information based on a multi-layer cache mechanism can improve the efficiency of information query for high-frequency information access to offline friends.
[0071] Among them, LRU can refer to a cache elimination algorithm for managing data items in the cache. MongoDB can be an open source cross-platform document database management system that uses document storage and has a flexible data model and powerful query capabilities. MongoDB is often used in scenarios such as big data storage, real-time analysis, content management, and user data management. Redis can be an open source in-memory database that can be used as a database, cache, and message middleware. Redis supports a variety of data structures, such as strings, hash tables, lists, collections, etc., and also has publish / subscribe, persistence, transactions, and other functions.
[0072] In one embodiment, please refer to Figure 4a , Figure 4aIt is another information processing flow diagram of an information processing method provided by an embodiment of the present application. Since the friend information of the current player account can only be displayed when the player opens the friend list, it is only necessary to perform real-time synchronization of friend information when the first client opens the friend list. In other words, when the first client opens the friend list, it is necessary to subscribe to the target friend player account through the first mailbox object. When the first client closes the friend list, the real-time synchronization of friend information can be turned off. At this time, the information change will not be transmitted until the next time the player opens the friend list. The real-time synchronization will be turned on again. This closing and opening is achieved by updating the friend list interface (update_friend_list). This interface will start a timer to turn off the real-time synchronization after 10 seconds. When the client opens the friend interface, it will request this interface every 2 seconds, and constantly refresh the countdown. When the client closes the friend interface, it stops calling this interface, then the subscription mode will be automatically turned off after 10 seconds, thereby stopping the real-time synchronization of information.
[0073] If the player Avatar1 closes the friend list for a period of time and then opens it again, the first server will initiate a call to the online friend latest information acquisition interface (do_init_friend_detail_online) to obtain the latest information of all online friends corresponding to the current player account.
[0074] Optionally, when the friend corresponding to the current player account goes offline, the second server will call the online friend interface (on_friend_online) through the mailbox to notify the other party that he is offline. At this time, the first server will delete the mailbox information of the corresponding friend's mailbox from the online friend mailbox information (online_friend_mailbox).
[0075] Optionally, if the information of the current player account changes, the change information of the current player account can be sent to the second mailbox object corresponding to the target friend player account through the first mailbox object, so as to synchronize the change information of the current player account to the second client corresponding to the target friend player account.
[0076] The change information may be information about changes in the current player account, and the second client may be a client logged in by the target friend player account.
[0077] In one embodiment, please refer to Figure 4b , Figure 4bIt is another information processing flow diagram of an information processing method provided by an embodiment of the present application. The player's changed information can be divided into brief information and detailed information. The update synchronization of brief information and detailed information can be maintained separately, and the maintenance process can be the same. For example, when the information (brief information or detailed information) of the current player account Avatar1 changes, the information synchronization interface (try_sync_avatar_info) can be called. This step will synchronize the changed information to the shard server, that is, the second microservice AvatarBriefInfoService that maintains the information of all players. At the same time, it can be broadcast (subscribe_broadcast) to all friends who have subscribed to themselves, that is, the friend information change interface (on_friend_attr_change) of the second mailbox object of the target friend player account is called through the mailbox object mailbox, so as to synchronize the changed information to the online friend player account through the mailbox object.
[0078] In a specific embodiment, please refer to Figure 4c , Figure 4c It is a specific framework schematic diagram of an information processing method provided by an embodiment of the present application, and the figure shows the process of a player initiating a query for friend information. Among them, the request initiator (generally the Avatar of GameServer) initiates a query request to the second microservice (AvatarBriefInfoService), and slices (shard) according to the object identifier (avatar_id) of the requested Avatar. After receiving the query request, the second microservice first searches in the microservice memory LRU. If it cannot be found, it will request the mailbox management microservice (AvatarProxyService) of the mailbox object that manages the Avatar to obtain the mailbox information of the requested Avatar. If it succeeds, it means that the requested Avatar is online, and the first mailbox object initiates a request for synchronization information to the mailbox object of the requested Avatar. If the player is not online, the second microservice will query Redis, and then query the Mongo database after the query fails. This information query method can avoid a large amount of table reading pressure piling up on the database and improve the efficiency of information query.
[0079] There are two ways to maintain the information in the microservice memory LRU cache and Redis: full update of information and single-point update. AvatarBriefInfoService only maintains information of specific fields. In order to reduce the size of serialized data, a list can be used for full update. Avatar and the second microservice need to agree on the length and order of the information list. Avatar notifies the microservice of the corresponding shard when a large number of its own attributes change during login, reconnection, settlement, etc. After receiving the information list, the second microservice assembles the data in the list into a dictionary (dict) in the agreed order and stores it in its own LRU cache and Redis cache. Full update can also occur when the cache misses. After the second microservice queries the corresponding field from the Mongo database, it stores the query result in the LRU.
[0080] Single-point updates can be used to update a few fields that change frequently, such as battle status, the serial number of the space where the Avatar is located, etc. It is also necessary to determine in advance the fields that can be updated at a single point. These fields should be a subset of the fields maintained by the second microservice. When notifying an update, a shorter dict is generally sent. After the second microservice receives the notification, if the notifier's avatar_id is in its own cache, the cache value can be modified, otherwise it can be discarded.
[0081] Since the microservice adopts the asynchronous writing method of coroutine, all calls that need to wait for asynchronous results (such as requesting online player synchronization information, pulling Redis, querying Mongo, etc.) can be suspended and waited, and the central processing unit (CPU) of the second microservice will execute other coroutines until there is a result returned, which can also save development time and does not need to consider a large number of calls and callbacks. A simple AvatarBriefInfoService implementation can maintain only 5 fields, and a single-point update only allows the update of 3 fields, including three main entry functions: request query, full update, and single-point update.
[0082] The second microservice AvatarBriefInfoService can also be more flexibly extended. For example, an online friend information cache (online_lru) can be cached separately to record the information of online friends. When the Avatar requests an update, it can be judged whether the friend is online based on the player's battle status (pvp_status). If online, add the friend to online_lru, and if offline, remove (pop) it.
[0083] Optionally, a subscription model can be used. A dictionary of {subscriber id: {subscriber 1-> mailbox 1, subscriber 2-> mailbox 2}} can be maintained in the second microservice. When the subscriber updates the information, the subscriber is notified of the information update. This method is suitable for projects where friends bear part of the information query pressure, and can also be used in similar scenarios that are sensitive to changes in specific object attributes. In this way, the attribute change information of the Avatar can be synchronized to other objects that need to be notified with near real-time efficiency.
[0084] In step 103, player change information is received and sent to the first client corresponding to the current player account.
[0085] The first client may be the client logged in by the current player account. In this way, based on the first mailbox object corresponding to the current player account and the second mailbox object corresponding to the target friend player account, communication can be performed within the local area network corresponding to the server cluster, so that the player change information of online friends can be quickly and in real time transmitted based on the intranet communication, and the friend change information can be quickly and in real time updated in the first client where the current player account is located, thereby improving the friend information transmission efficiency.
[0086] As the scale of the game market continues to expand, games have become a part of social interaction. For games with a large number of users, a large number of users performing different friend interaction operations at the same time will cause great pressure on the server. Among them, high-frequency player information query and friend system are common business modules in the game backend. The information processing requirements of these modules are generally asynchronous, and the business logic is relatively complex, involving asynchronous calls, exception handling, data storage and other issues. There will also be requirements such as line division, expansion and contraction in the online environment. The existing friend information query method often forwards the query request initiated by the client from GameServer to FriendService, and then pulls the FriendInfo of the corresponding friend according to the friend list information through FriendService and returns it to the client for display. However, for some games with a large number of users, a large number of users performing different friend interaction operations such as friend information query at the same time will cause great pressure on the server, which is very likely to cause the friend's current online status and other friend information with high real-time requirements to be updated. Delay, resulting in inaccurate friend information acquisition, making information processing efficiency poor.
[0087] For this reason, the embodiment of the present application can realize a friend system that can satisfy a large number of players online at the same time, can withstand high concurrent requests, and ensure data real-time, security, and accuracy by providing an information processing method. While meeting the needs, it is also possible to take into account server performance and cost, as well as the labor cost of later maintenance, so as to provide game players with a better game social environment. Specifically, in the friend system framework provided by the embodiment of the present application, various operations are usually asynchronous, and an asynchronous processing mechanism is needed to process a large number of requests to avoid blocking the main thread. At the same time, the information query efficiency of high-frequency access is improved through a multi-layer cache mechanism. For some data with high real-time requirements, it can be directly communicated within the server cluster to avoid the time consumption of information flowing back and forth. At the same time, the storage and processing capabilities of the database can be expanded by using sub-libraries and sub-tables. In addition, the friend system needs to have high availability, which can be achieved through multi-copy deployment, load balancing and other technologies. The friend system needs to ensure data security and needs to use encryption technology and access authorization mechanisms to protect user data.
[0088] Among them, high-frequency information query needs to be able to obtain the player's information with near real-time efficiency, and can also be changed in time when the player's information changes. It is generally used to display whether the player is online in real time, the nickname and avatar of the small avatar, etc. The friend system generally has at least three requests: application, consent, and rejection. If there are requirements such as blacklists and maximum number restrictions, additional logical judgments need to be added to these requests. In this way, based on the information processing method and friend system provided in the embodiment of the present application, players can interact, communicate and cooperate with friends more conveniently, improve the sociality and fun of the game, thereby improving user retention rate and satisfaction. The friend system can use technologies such as caching technology, distributed storage and load balancing to effectively reduce the pressure and load of the server and improve the stability and performance of the system. In addition, the friend system can use technologies such as asynchronous processing, multi-threading and distributed computing to improve the concurrent processing capability and response speed of the system, thereby improving the performance and efficiency of the system. Then, the friend system can use encryption technology, access authorization and data backup technology to ensure the security and reliability of user data and prevent data leakage and loss. In addition, the friend system can adopt technologies such as automated deployment, monitoring and troubleshooting to reduce the workload and error rate of operation and maintenance personnel, improve the maintainability and reliability of the system, and effectively improve information processing efficiency.
[0089] As can be seen from the above, the embodiment of the present application is applied to the first server where the current player account is located, the first server belongs to the server cluster, and the servers in the server cluster communicate through the local area network configured for the server cluster. When the current player account logs in to the target game, the target friend player account in the target game is determined, and the second server where the target friend player account is located is the server of the server cluster; through the first mailbox object of the current player account, the subscription indication information for the target friend player account is sent to the second server to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes; receive the player change information and send it to the first client corresponding to the current player account. In this way, through the first mailbox object and the second mailbox object communicating in the local area network of the server cluster, the player change information of the target friend player account in the online state of the current player account is transmitted to the first server where the current player account is located, and the player change information can be realized based on the intranet of the server cluster. Fast and real-time transmission between the first server of the current player account and the second server of the target friend player account, thereby realizing fast and real-time synchronization to the client of the current player account, improving the efficiency of friend information transmission.
[0090] In order to better implement the above method, the embodiment of the present application also provides another information processing method, which can be integrated in a computer device, and the computer device can be a server, for example, it can be a server corresponding to the second microservice.
[0091] For a better description of the embodiments of this application, please refer to Figure 5 , Figure 5 This is another flow chart of the information processing method provided in the embodiment of the present application. The specific process is as follows:
[0092] In step 201, a request for obtaining online friend mailbox information for a current player account is received from a first server.
[0093] Among them, the online friend mailbox information acquisition request can be a request for acquiring online friend mailbox information, and the online friend mailbox information can be the mailbox object information of the friend player account of the current player account that is in an online state, and the mailbox object information can be the mailbox information of the mailbox object, and the mailbox information can include information such as the object identifier of the mailbox object.
[0094] In step 202, the online friend email information corresponding to the current player account is obtained.
[0095] Among them, the online friend email information is used to determine the target friend player account that is online for the current player account.
[0096] In one embodiment, the second microservice can request the mailbox management microservice (AvatarProxyService) to obtain the mailbox information of the mailbox object corresponding to the target friend player account based on the target friend player account that is online in the current player account, so as to obtain the online friend mailbox information corresponding to the current player account. Among them, AvatarProxyService can be a service for providing a mailbox query for a certain player account.
[0097] In step 203, the online friend mailbox information is sent to the first server.
[0098] Among them, sending the online friend mailbox information to the first server can enable the first server to determine the target friend player account that is online in the current player account based on the online friend mailbox information. The second server where the target friend player account is located is a server in the server cluster. Subscription indication information for the target friend player account is sent to the second server through the first mailbox object of the current player account to trigger the second server to send player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes, receive the player change information, and send it to the first client corresponding to the current player account.
[0099] Optionally, when receiving an information query request for offline friends sent by the first server, offline friend information query can be performed based on the three-layer cache mechanism. Specifically, an offline friend information query request for the current player account sent by the first server can be received, and the offline friend information query request carries the account identifier corresponding to the offline friend account of the current player account; based on the account identifier, the offline friend information corresponding to the offline friend account is searched in the internal cache; if the offline friend information is not found, the offline friend information corresponding to the offline friend account is searched in the hot data storage database; if the offline friend information is not found, the offline friend information corresponding to the offline friend account is searched in the cold data storage database; the queried offline friend information is sent to the first server to display the offline friend information in the first client of the current player account.
[0100] Among them, the offline friend information query request can be a request for querying offline friend information. The offline friend account can be a player account of an offline friend of the current player account, and the account identifier can be an identifier of the player account, which can uniquely identify a player account. The offline friend information can be the information of the offline friend that needs to be queried. The internal cache can be a storage space in the second microservice memory for storing friend information, for example, it can be a microservice memory LRU. The hot data storage database can be a database for storing hot data, for example, it can be a memory database, for example, a Redis database. The cold data storage database can be a database for storing cold data, for example, it can be a Mongo database.
[0101] In one embodiment, since player information is generally stored in the form of key-value pairs, the data sharing and centralized characteristics of microservices can be utilized to use a three-layer information storage mechanism to query high-frequency information of players. Specifically, when the first server initiates an offline friend information query request to the second microservice, the second microservice can have four query steps, namely, first query the microservice memory LRU of the second microservice, if the query fails, continue to try to query the Redis database, and if the offline friend information cannot be queried, query the Mongo database. Among them, the microservice memory LRU refers to the data in the server memory, which can be directly accessed and is the most efficient way to obtain data, but the storage space is small. Redis is a hot data access database with a large storage space and relatively high data acquisition efficiency. Mongo is a cold data access database with the largest storage space, but the rate of acquiring data is relatively slow. In this way, querying offline friend information based on a multi-layer cache mechanism can improve the efficiency of information query for high-frequency information access to offline friends.
[0102] As can be seen from the above, the embodiment of the present application receives a request for obtaining online friend mailbox information for the current player account sent by the first server; obtains the online friend mailbox information corresponding to the current player account, and the online friend mailbox information is used to determine the target friend player account of the current player account that is online; sends the online friend mailbox information to the first server, so that the first server determines the target friend player account of the current player account that is online based on the online friend mailbox information, and the second server where the target friend player account is located is a server of the server cluster, and sends subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes, receives the player change information, and sends it to the first client corresponding to the current player account. In this way, the player change information of the target friend player account in the online state of the current player account is transmitted to the first server where the current player account is located through the first mailbox object and the second mailbox object that communicate in the local area network of the server cluster. The player change information can be quickly and in real time transmitted between the first server of the current player account and the second server of the target friend player account based on the intranet of the server cluster, thereby realizing fast and real-time synchronization to the client of the current player account, thereby improving the efficiency of friend information transmission.
[0103] In order to better implement the above method, an embodiment of the present invention further provides an information processing device, which can be integrated in an electronic device, and the electronic device can be a server.
[0104] For example, Figure 6 As shown, it is a structural schematic diagram of the information processing device provided in an embodiment of the present application, which is applied to the first server where the current player account is located. The first server belongs to a server cluster. The servers in the server cluster communicate through a local area network configured for the server cluster. The information processing device may include a determining unit 301, a sending unit 302 and a synchronization unit 303, as follows:
[0105] A determination unit 301 is used to determine a target friend player account in the target game where the current player account is online when the current player account logs into the target game, and the second server where the target friend player account is located is a server of the server cluster;
[0106] The sending unit 302 is used to send subscription indication information for a target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed;
[0107] The synchronization unit 303 is used to receive player change information and send it to the first client corresponding to the current player account.
[0108] In some embodiments, the sending unit 302 is configured to:
[0109] Determine the second mailbox object information corresponding to the target friend player account;
[0110] Based on the second mailbox object information, the first mailbox object of the current player account sends subscription indication information for the target friend player account to the second mailbox object of the target friend player account in the second server.
[0111] In some embodiments, the sending of subscription indication information for the target friend player account to the second mailbox object of the target friend player account in the second server through the first mailbox object of the current player account based on the second mailbox object information is specifically used for:
[0112] When the first client triggers a viewing event for the friend list of the current player account, subscription indication information for the target friend player account is sent to the second mailbox object of the target friend player account in the second server through the first mailbox object of the current player account based on the second mailbox object information.
[0113] In some embodiments, the determining unit 301 is configured to:
[0114] When the current player account logs in to the target game, obtain the friend list data from the first microservice;
[0115] Based on the friend list data, send a request to the second microservice for obtaining online friend mailbox information;
[0116] Receive the online friend mailbox information returned by the second microservice;
[0117] Determine the target friend player account that is online based on the online friend email information.
[0118] In some embodiments, the second mailbox object information corresponding to the target friend player account is determined specifically for:
[0119] Extract the second mailbox object information corresponding to the target friend player account from the online friend mailbox information.
[0120] In some embodiments, the information processing device further includes an offline updating unit, which is used to:
[0121] Receiving, through the first mailbox object, a friend offline notification message sent by the second server through the second mailbox object;
[0122] Delete the second mailbox object information of the second mailbox object in the online friend mailbox information.
[0123] In some embodiments, the information processing device further includes a change information synchronization unit, which is used to:
[0124] If the information of the current player account changes, the change information of the current player account is sent to the second mailbox object corresponding to the target friend player account through the first mailbox object, so as to synchronize the change information of the current player account to the second client corresponding to the target friend player account.
[0125] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.
[0126] From the above, it can be seen that the embodiment of the present application is applied to the first server where the current player account is located, the first server belongs to a server cluster, and the servers in the server cluster communicate through the local area network configured for the server cluster. The determination unit 301 determines the target friend player account in the target game where the current player account is online when the current player account logs in to the target game, and the second server where the target friend player account is located is a server of the server cluster; the sending unit 302 sends subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes; the synchronization unit 303 receives the player change information and sends it to the first client corresponding to the current player account. In this way, the player change information of the target friend player account in the online state of the current player account is transmitted to the first server where the current player account is located through the first mailbox object and the second mailbox object that communicate in the local area network of the server cluster. The player change information can be quickly and in real time transmitted between the first server of the current player account and the second server of the target friend player account based on the intranet of the server cluster, thereby realizing fast and real-time synchronization to the client of the current player account, thereby improving the efficiency of friend information transmission.
[0127] Correspondingly, an embodiment of the present application further provides an information processing apparatus, which can be integrated in a computer device, and the computer device can be a server.
[0128] For example, Figure 7As shown, it is another structural schematic diagram of the information processing device provided in an embodiment of the present application. The information processing device may include a receiving unit 401, an acquiring unit 402 and an information sending unit 403, as follows:
[0129] The receiving unit 401 is used to receive a request for obtaining online friend mailbox information for a current player account sent by a first server;
[0130] An acquisition unit 402 is used to acquire online friend mailbox information corresponding to the current player account, and the online friend mailbox information is used to determine a target friend player account that is online for the current player account;
[0131] The information sending unit 403 is used to send the online friend mailbox information to the first server, so that the first server determines the target friend player account that is online in the current player account based on the online friend mailbox information. The second server where the target friend player account is located is a server of the server cluster. The subscription indication information for the target friend player account is sent to the second server through the first mailbox object of the current player account to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed, receive the player change information, and send it to the first client corresponding to the current player account.
[0132] In some embodiments, the information processing device further includes an offline friend information obtaining unit, which is used to:
[0133] Receiving an offline friend information query request for the current player account sent by the first server, where the offline friend information query request carries an account identifier corresponding to the offline friend account of the current player account;
[0134] Based on the account ID, search for offline friend information corresponding to the offline friend account in the internal cache;
[0135] If no offline friend information is found, query the offline friend information corresponding to the offline friend account in the hot data storage database;
[0136] If no offline friend information is found, query the offline friend information corresponding to the offline friend account in the cold data storage database;
[0137] The queried offline friend information is sent to the first server so as to display the offline friend information in the first client of the current player account.
[0138] As can be seen from the above, the embodiment of the present application receives an online friend mailbox information acquisition request for the current player account sent by the first server through the receiving unit 401; the acquisition unit 402 acquires the online friend mailbox information corresponding to the current player account, and the online friend mailbox information is used to determine the target friend player account of the current player account that is online; the information sending unit 403 sends the online friend mailbox information to the first server, so that the first server determines the target friend player account of the current player account that is online based on the online friend mailbox information, and the second server where the target friend player account is located is a server of the server cluster, and sends subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes, receive the player change information, and send it to the first client corresponding to the current player account. In this way, the player change information of the target friend player account in the online state of the current player account is transmitted to the first server where the current player account is located through the first mailbox object and the second mailbox object that communicate in the local area network of the server cluster. The player change information can be quickly and in real time transmitted between the first server of the current player account and the second server of the target friend player account based on the intranet of the server cluster, thereby realizing fast and real-time synchronization to the client of the current player account, thereby improving the efficiency of friend information transmission.
[0139] The present application also provides an electronic device, such as Figure 8 As shown, it shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, and the electronic device may be a server. Specifically:
[0140] The electronic device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0141] The processor 501 is the control center of the electronic device 500. It uses various interfaces and lines to connect various parts of the entire electronic device 500, executes various functions of the electronic device 500 and processes data by running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the electronic device 500 as a whole.
[0142] In the embodiment of the present application, the processor 501 in the electronic device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:
[0143] When the current player account logs in to the target game, determine the target friend player account in the target game where the current player account is online, and the second server where the target friend player account is located is a server of the server cluster; send subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account to trigger the second server to send player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed; receive the player change information and send it to the first client corresponding to the current player account.
[0144] This solution can be applied to the first server where the current player account is located. The first server belongs to a server cluster. The servers in the server cluster communicate through the local area network configured for the server cluster. When the current player account logs in to the target game, the target friend player account of the current player account in the target game is determined. The second server where the target friend player account is located is a server of the server cluster; the subscription indication information for the target friend player account is sent to the second server through the first mailbox object of the current player account to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes; the player change information is received and sent to the first client corresponding to the current player account. In this way, the player change information of the target friend player account in the online state of the current player account is transmitted to the first server where the current player account is located through the first mailbox object and the second mailbox object communicating in the local area network of the server cluster, so that the player change information can be transmitted quickly and in real time between the first server of the current player account and the second server of the target friend player account based on the intranet of the server cluster, so as to achieve fast and real-time synchronization to the client of the current player account, and improve the efficiency of friend information transmission.
[0145] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0146] Optional, such as Figure 8As shown, the electronic device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Figure 8 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0147] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.
[0148] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals between the network device or other electronic devices.
[0149] The audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another electronic device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earplug jack to provide communication between an external headset and an electronic device.
[0150] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0151] The power supply 507 is used to supply power to various components of the electronic device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0152] although Figure 8 Not shown, the electronic device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0153] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. It should be noted that the electronic device provided in the embodiment of the present application and the information processing method in the above embodiment belong to the same concept. The specific implementation process is detailed in the above method embodiment, which will not be repeated here.
[0154] As can be seen from the above, the electronic device provided by the embodiment of the present application can be applied to the first server where the current player account is located, the first server belongs to the server cluster, and the servers in the server cluster communicate through the local area network configured for the server cluster. When the current player account logs in to the target game, the target friend player account in the target game is determined, and the second server where the target friend player account is located is the server of the server cluster; through the first mailbox object of the current player account, the subscription indication information for the target friend player account is sent to the second server to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes; receive the player change information and send it to the first client corresponding to the current player account. In this way, through the first mailbox object and the second mailbox object communicating in the local area network of the server cluster, the player change information of the target friend player account in the online state of the current player account is transmitted to the first server where the current player account is located, and the player change information can be realized based on the intranet of the server cluster. Fast and real-time transmission between the first server of the current player account and the second server of the target friend player account, thereby realizing fast and real-time synchronization to the client of the current player account, improving the friend information transmission efficiency.
[0155] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0156] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any information processing method provided in the embodiment of the present application. For example, the computer program can execute the following steps:
[0157] In the case where the current player account logs into the target game, determining a target friend player account in the target game in which the current player account is online, the second server where the target friend player account is located is a server of the server cluster;
[0158] Sending subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed;
[0159] Receive player change information and send it to the first client corresponding to the current player account.
[0160] This solution can be applied to the first server where the current player account is located. The first server belongs to a server cluster. The servers in the server cluster communicate through the local area network configured for the server cluster. When the current player account logs in to the target game, the target friend player account of the current player account in the target game is determined. The second server where the target friend player account is located is a server of the server cluster; the subscription indication information for the target friend player account is sent to the second server through the first mailbox object of the current player account to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account changes; the player change information is received and sent to the first client corresponding to the current player account. In this way, the player change information of the target friend player account in the online state of the current player account is transmitted to the first server where the current player account is located through the first mailbox object and the second mailbox object communicating in the local area network of the server cluster, so that the player change information can be transmitted quickly and in real time between the first server of the current player account and the second server of the target friend player account based on the intranet of the server cluster, so as to achieve fast and real-time synchronization to the client of the current player account, and improve the efficiency of friend information transmission.
[0161] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0162] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0163] Since the computer program stored in the computer-readable storage medium can execute the steps in any information processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any information processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0164] Among them, according to one aspect of the present application, a computer program product is provided, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes the methods provided in the various optional implementations provided in the above embodiments.
[0165] The above is a detailed introduction to an information processing method, device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An information processing method, characterized in that: Applied to a first server where the current player account is located, the first server belongs to a server cluster, and the servers in the server cluster communicate via a local area network configured for the server cluster, the method comprising: In the case where the current player account logs into the target game, determining a target friend player account in the target game that is online with the current player account, the second server where the target friend player account is located is a server of the server cluster; Sending subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed; The player change information is received and sent to the first client corresponding to the current player account.
2. The information processing method according to claim 1, characterized in that: The sending, through the first mailbox object of the current player account, subscription indication information for the target friend player account to the second server includes: Determine the second mailbox object information corresponding to the target friend player account; Based on the second mailbox object information, the subscription indication information for the target friend player account is sent to the second mailbox object of the target friend player account in the second server through the first mailbox object of the current player account.
3. The information processing method according to claim 2, characterized in that: The sending, through the first mailbox object of the current player account based on the second mailbox object information, subscription indication information for the target friend player account to the second mailbox object of the target friend player account in the second server includes: When the first client triggers an event to view the friend list of the current player account, subscription indication information for the target friend player account is sent to the second mailbox object of the target friend player account in the second server through the first mailbox object of the current player account based on the second mailbox object information.
4. The information processing method according to claim 2, characterized in that: In the case where the current player account logs into the target game, determining a target friend player account in the target game where the current player account is online includes: When the current player account logs in to the target game, obtain the friend list data from the first microservice; Based on the friend list data, send an online friend mailbox information acquisition request to the second microservice; Receive the online friend mailbox information returned by the second microservice; A target friend player account in an online state of the current player account is determined based on the online friend mailbox information.
5. The information processing method according to claim 4, characterized in that: The determining of the second mailbox object information corresponding to the target friend player account includes: The second mailbox object information corresponding to the target friend player account is extracted from the online friend mailbox information.
6. The information processing method according to claim 5, characterized in that: The method further comprises: Receiving, through the first mailbox object, a friend offline notification message sent by the second server through the second mailbox object; The second mailbox object information of the second mailbox object in the online friend mailbox information is deleted.
7. The information processing method according to claim 1, characterized in that: The method further comprises: If the information of the current player account changes, the change information of the current player account is sent to the second mailbox object corresponding to the target friend player account through the first mailbox object, so as to synchronize the change information of the current player account to the second client corresponding to the target friend player account.
8. An information processing method, characterized in that: include: Receiving a request for obtaining online friend mailbox information for the current player account sent by the first server; Obtaining online friend mailbox information corresponding to the current player account, wherein the online friend mailbox information is used to determine a target friend player account of the current player account that is online; The online friend mailbox information is sent to the first server, so that the first server determines the target friend player account of the current player account that is online based on the online friend mailbox information, and the second server where the target friend player account is located is a server of the server cluster. Subscription indication information for the target friend player account is sent to the second server through the first mailbox object of the current player account to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed, receive the player change information, and send it to the first client corresponding to the current player account.
9. The information processing method according to claim 8, characterized in that: The method further comprises: receiving an offline friend information query request for the current player account sent by the first server, wherein the offline friend information query request carries an account identifier corresponding to an offline friend account of the current player account; Based on the account identifier, searching for offline friend information corresponding to the offline friend account in an internal cache; If the offline friend information is not found, query the offline friend information corresponding to the offline friend account in the hot data storage database; If the offline friend information is not found, query the offline friend information corresponding to the offline friend account in the cold data storage database; The offline friend information found is sent to the first server so as to be displayed in the first client of the current player account.
10. An information processing device, characterized in that: Applied to a first server where the current player account is located, the first server belongs to a server cluster, and the servers in the server cluster communicate via a local area network configured for the server cluster, including: A determination unit, configured to determine, when the current player account logs into the target game, a target friend player account in the target game that is online, wherein the second server where the target friend player account is located is a server of the server cluster; a sending unit, configured to send subscription indication information for the target friend player account to the second server through the first mailbox object of the current player account, so as to trigger the second server to send the player change information to the first server through the second mailbox object of the target friend player account when the player information of the target friend player account is changed; The synchronization unit is used to receive the player change information and send it to the first client corresponding to the current player account.
11. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: It comprises a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any method described in claims 1 to 9.