CN112891928A - Data processing method, storage medium and electronic device - Google Patents

Data processing method, storage medium and electronic device Download PDF

Info

Publication number
CN112891928A
CN112891928A CN202110144057.9A CN202110144057A CN112891928A CN 112891928 A CN112891928 A CN 112891928A CN 202110144057 A CN202110144057 A CN 202110144057A CN 112891928 A CN112891928 A CN 112891928A
Authority
CN
China
Prior art keywords
data
request
data processing
sdk
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110144057.9A
Other languages
Chinese (zh)
Other versions
CN112891928B (en
Inventor
郝庭毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110144057.9A priority Critical patent/CN112891928B/en
Publication of CN112891928A publication Critical patent/CN112891928A/en
Application granted granted Critical
Publication of CN112891928B publication Critical patent/CN112891928B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • A63F13/358Adapting the game course according to the network or server load, e.g. for reducing latency due to different connection speeds between clients
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the application discloses a data processing method, a storage medium and electronic equipment. The method comprises the following steps: receiving a data processing request sent by an API on user equipment through a data receiving end of game host equipment, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request; the control data receiving end requests the SDK to execute a data processing request based on the SDK RPC interface; sending a data processing result of the SDK executing the data processing request to a fixed port of the loopback network card through a UDP interface; and then controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card and sending the data processing result to an API on the user equipment. The embodiment of the application can reduce the data acquisition cost of the game service, simultaneously does not block the operation of the game process, reduces the request delay of the player and improves the data acquisition efficiency of the game.

Description

Data processing method, storage medium and electronic device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method, a storage medium, and an electronic device.
Background
For game application, delay is an important index for evaluating game experience of a player, and design processes such as synchronous operation of a game main process and time-consuming logic optimization are reduced as much as possible in modern game engine design. At present, the following two methods are generally adopted for collecting data such as service indexes in games:
in the first mode, data to be collected is written into a log in an asynchronous input/output (IO) mode, and then extracted through a system log (syslog) of the system. The problem of this method is that when the load of the game application is high or a large amount of logs are generated, the IO overhead of the disk is greatly increased, and a large amount of read-write operations affect the utilization rate of the CPU, thereby affecting the game service and causing delay.
In a second mode, similar to the collection of Prometheus, Prometheus is an open source service monitoring system and a time sequence database, and exposes a data interface in an http service mode. And when data acquisition is needed, the client actively accesses the http interface and pulls the data. The method has two problems, one is that the http method has high data transmission cost and can block the game main process; and secondly, when a new index needs to be acquired, the new index needs to be registered in cooperation with a service discovery mechanism, so that the operation complexity is high and the development cost is high.
Therefore, the prior art has defects and needs to be improved and developed.
Disclosure of Invention
The embodiment of the application provides a data processing method, a storage medium and an electronic device, which can reduce the data acquisition overhead of game services, simultaneously do not block the operation of a game process, reduce the request delay of a player and improve the data acquisition efficiency of a game.
The embodiment of the application provides a data processing method, is applied to the electronic equipment as game host equipment, electronic equipment disposes the data acquisition communicator SDK of data receiving terminal and implantation game process, dispose remote procedure call RPC interface in the SDK, the method includes:
receiving a data processing request sent by an Application Programming Interface (API) on user equipment through the data receiving end, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request;
controlling the data receiving end to request the SDK to execute the data processing request based on the RPC interface of the SDK;
sending a data processing result of the SDK executing the data processing request to a fixed port of a loopback network card through a UDP interface;
and controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card and sending the data processing result to an API (application program interface) on the user equipment.
An embodiment of the present application further provides a data processing method, which is applied to an electronic device serving as a user equipment, where the electronic device is configured with an application programming interface API, and the method includes:
controlling the API to respond to touch operation input by a user to generate a data processing request, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request;
sending the data processing request to a game host device;
and receiving a data processing result returned by the game host equipment after responding to the data processing request.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, where the computer program is suitable for being loaded by a processor to execute the data processing method according to any of the above embodiments.
An embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores a computer program, and the processor executes the data processing method according to any of the above embodiments by calling the computer program stored in the memory.
According to the data processing method, the storage medium and the electronic device provided by the embodiment of the application, the data processing request sent by the API on the user equipment is received through the data receiving end of the game host equipment, and the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request; the control data receiving end requests the SDK to execute a data processing request based on the SDK RPC interface; sending a data processing result of the SDK executing the data processing request to a fixed port of the loopback network card through a UDP interface; and then controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card and sending the data processing result to an API on the user equipment. The embodiment of the application can reduce the data acquisition cost of the game service, simultaneously does not block the operation of the game process, reduces the request delay of the player and improves the data acquisition efficiency of the game.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a data processing system according to an embodiment of the present application.
Fig. 2 is a first flowchart of a data processing method according to an embodiment of the present disclosure.
Fig. 3 is a second flowchart of the data processing method according to the embodiment of the present application.
Fig. 4 is a schematic diagram of a first structure of a data processing apparatus according to an embodiment of the present application.
Fig. 5 is a second schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
First, some terms or expressions appearing in the course of describing the embodiments of the present application are explained as follows:
berkeley Pack Filter (BPF): the interface is a raw interface of a data link layer on a UNIX-like system and provides the receiving and sending of raw link layer packets. The user-mode process may provide a filter to declare which packets it wants to receive. By such filtering, copying of other packets from the operating system kernel to the user mode that are not useful to the user mode program can be avoided, thereby greatly improving performance.
Remote Procedure Call (RPC): is a computer communication protocol. The protocol allows a program running on one computer to call a sub-program of another address space (typically a computer of an open network) without the programmer having to additionally program this interaction, just as calling a local program, and without having to pay attention to details.
Application Programming Interface (API): providing an interface for user programming is a predefined function that aims to provide applications and developers the ability to access a set of routines based on certain software or hardware without having to access source code or understand the details of the internal working mechanisms.
User Data Protocol (UDP): a connectionless unreliable transport layer protocol, which is commonly used in online games that are sensitive to latency.
Software Development Kit (SDK): the SDK is a collection of program interfaces, documents, and development tools. For example, a complete SDK should include the following: interface files and library files, help documentation, development examples, utilities. The interface file and the library file are used for packaging and protecting the bottom layer code and providing an interface for calling the bottom layer code for a user; the help document is used for explaining the functions of the interface file and the library file, and introducing related development tools, operation examples and the like; the development example is a DEMO showing which is made and also comprises source codes; the utility tools are tools for assisting users in secondary development, such as secondary development wizards, API search tools, software packaging tools, and the like. In the embodiment of the application, the SDK is a data acquisition communicator implanted in a game process, and communicates in an RPC protocol manner.
tick: is a common function of game logic executed by a game process in a game engine. This function periodically executes some in-game fixed logic, similar to a clock "tick".
Loopback network card (Loopback adaptor): the lo network card is a special network interface, is not connected with any actual equipment, and is completely realized by software. Such as Microsoft Loopback network card (Microsoft Loopback Adapter), like a virtual network card, can be installed on a Windows network that has no network card or is to be used for testing multiple host environments. The lo network card is a virtual network card, and sends data to the lo network card, and compared with sending data to a real network card, the lo network card has the advantages that data transmission can be completed only through processing of a kernel protocol stack, namely from an application layer to a session layer and then to a network layer, and transmission cost is reduced without passing through a transmission layer and a physical layer.
etcd: is a distributed, highly available, consistent key-value store database.
iowait: is used to indicate the time that the system waits for IO, and is often used to reflect the system IO pressure.
The embodiment of the application provides a data processing method, a storage medium and electronic equipment, wherein an implanted SDK is adopted, and an RPC interface is exposed after the SDK is implanted into a game process; the SDK provides data interaction service for a data receiving end through an RPC interface, wherein the RPC interface comprises a data request interface and a newly-added acquisition index interface, and the data receiving end requests the SDK to perform corresponding data acquisition through the RPC interface; after the SDK collects data, the data is sent to a fixed port of a Loopback network card (Loopback adaptor) of a local host (localhost) through a non-blocking UDP interface; the data receiving end receives data from the fixed port of the lo network card, for example, the data receiving end receives data from the fixed port of the lo network card through the BPF. The acquisition logic is executed during each game main process tick, a data interface is exposed outwards in an RPC mode, and data is sent in a non-blocking UDP mode, so that the cost is lower compared with the process data acquisition and sending in an http mode; in addition, because the RPC interface exposed to the outside also comprises a newly-added acquisition index interface, when a new index needs to be acquired, each SDK can automatically acquire data according to the data processing request through the data processing request, so that the introduction of a service discovery mechanism is avoided, and the development and deployment cost is reduced; meanwhile, data are sent through the non-blocking UDP interface, compared with a log writing mode, the disk overhead is smaller, IO delay is lower, a data receiving mode realized through the BPF is completely independent of a game process, the read-write capability of the data receiving mode does not have any influence on the game process, the IO overhead during data acquisition can be greatly reduced, the processing time delay is reduced, and the player experience is optimized.
The embodiment of the application provides a data processing method, a storage medium and electronic equipment. Specifically, the data processing method of the embodiment of the present application may be executed by an electronic device, where the electronic device may be a terminal or a server. The terminal may be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like, and may further include a client, which may be a game application client, a browser client carrying a game program, or an instant messaging client, and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a data processing system according to an embodiment of the present disclosure. The embodiment of the present application provides a data processing system, which includes a game host device 10, a cache device 20, and a user device 30.
The game host equipment 10 is internally provided with an SDK (software development kit), an lo network card and a data receiving end, a game application is arranged on the game host equipment 10, the SDK is a data acquisition communicator implanted into a game process, and the SDK carries out communication through an RPC (remote procedure control) interface; the data receiving end is a data collection process running independently, filters out the required data from the fixed port of the lo network card, for example, filters out the required data from the fixed port of the lo network card through BPF, and is responsible for interacting with the API in the cache device 20 and the user equipment 30.
Where each game application is deployed on a plurality of independent game host devices 10, the game host devices 10 may also be referred to as hosts of the game applications, and the game host devices 10 may be servers or terminals installed with the game applications.
The cache device 20 is responsible for caching the data collected by the data receiving end on each game host device 10, so as to avoid multiple executions of the same request in a short time and reduce the pressure of the game process. The API in the user device 30 is used to communicate with the data receiving end on each game host device 10 to initiate a data collection request.
The terminal that the user device 30 can be used by the user may be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a PC, a PDA, and the like, and the terminal may further include a client, which may be a game application client, a browser client carrying a game program, or an instant messaging client, and the like. The user equipment 30 is provided with an API, for example, the API may be presented in a UI interface form, a user may perform some touch operations through the UI interface, and an interface call initiated through the UI interface immediately initiates a request to the API.
For example, the game host device 10 and the user device 30 may be the same device or different devices. The caching device 20 may be any device with data caching capabilities. For example, the cache device 20 and the game host device 10 may be the same device or different devices; for example, the caching device 20 and the user device 30 may be the same device or different devices.
Specifically, the main interaction flow of the data processing system is as follows:
(1) the API on the user device 30 generates a data processing request in response to a touch operation input by a user, where the data processing request includes at least one of a data acquisition request and a new acquisition index request.
For example, the user device 30 is provided with an API, the API is exposed in the form of a UI interface, the user can call the API through a touch operation input on the UI interface, and the API generates a data processing request in response to the touch operation input on the UI interface.
(2) The data processing request is sent to the game host apparatus 10.
(3) Receiving, by a data receiving end on the game host device 10, a data processing request sent by an API on the user device, where the data processing request includes at least one of a data acquisition request and a new acquisition indicator request.
(4) The game host device 10 controls the data receiving end to request the SDK to execute the data processing request based on the RPC interface of the SDK.
(5) The game host device 10 sends the data processing result of the data processing request executed by the SDK to the fixed port of the loopback card through the UDP interface.
(6) And controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card through the BPF, and sending the data processing result to the API on the user equipment 10.
(7) The API on the user device 30 receives the data processing result returned by the game host device 10 in response to the data processing request.
In some embodiments, when the data processing request is a data acquisition request, the specific interaction flow of the data processing system is as follows:
(1) the user initiates a data acquisition request through the API on the user device 30, where the data acquisition request includes a target process corresponding to target data to be acquired, a target entity to be acquired, and an acquisition index of the target entity. The entity refers to an abstract concrete object inside the game, for example, if a player is an entity type, each player is an entity; if a monster is an entity type, then each monster is an entity; the target entity is the entity to be collected. The index refers to index information of an entity, such as the level, blood volume, money and the like of a player; the acquisition index is the index to be acquired.
(2) The cache device 20 obtains a data acquisition request sent by an API on the user device 30, where the data acquisition request is used to instruct the cache device 20 to search whether target data corresponding to the data acquisition request exists in cache data. According to the data acquisition request, the cache device 20 searches whether target data corresponding to the data acquisition request exists in cache data, and sends a search result to an API on the user device 30. And if the search result is that the target data corresponding to the data acquisition request exists in the cache data, sending the search result carrying the target data to an API on the user equipment 30. And if the search result is that the target data corresponding to the data acquisition request does not exist in the cache data, sending the search result carrying the prompt information of the target data not existing to the API on the user equipment 30. That is, whether target data corresponding to the data acquisition request exists in the cache data is searched in the cache device 30, and if the target data exists, the target data is directly returned to the user.
For example, the API on the user device 30 may interact directly with the cache device 20, the API on the user device 30 directly sends the data collection request to the cache device 20, and then the cache device 20 directly returns the search result in response to the data collection request to the API on the user device 30.
For example, an API on the user device 30 may indirectly interact with the cache device 20 through a data receiving end on the game host device 10, the API on the user device 30 sends a data acquisition request to the data receiving end on the game host device 10, the data receiving end on the game host device 10 obtains the data acquisition request sent by the API, then the data receiving end on the game host device 10 sends the obtained data acquisition request to the cache device 20, the cache device 20 obtains the data acquisition request sent by the API on the user device 30 through the data receiving end on the game host device 10, then, according to the data acquisition request, whether target data corresponding to the data acquisition request exists in the cache data is searched, and a search result is sent to the API on the user device 30 through the data receiving end on the game host device 10.
(3) If the API on the user device 30 receives the search result carrying the prompt information that the target data does not exist, a data processing request is initiated to all the game host devices 10, where the data processing request carries the data acquisition request, and the data receiving end on the game host device 10 where the game process related to the data acquisition request is located receives and responds to the data acquisition request. That is, after the API receives the data acquisition request, if corresponding target data is not searched in the cache device 20, a data processing request is initiated for all hosts, and the data receiving end of the host where the game process related to the data acquisition request is located will receive the data acquisition request.
For example, the game host devices that establish a communication connection with the user device 30 include a game host a, a game host B, and a game host C, each of which has three game processes thereon: for example, if the target data to be searched by the user is money data of player X in game process 2 in game host a, it is checked whether the target data exists in the cache data in cache device 20, and if the target data does not exist in the cache data. A data processing request is initiated, when the game process 2 of the game host a matches the data acquisition request in the data processing request, that is, the game process 2 of the game host a finds that the request object in the data acquisition request is itself, the game process 2 of the game host a responds, and the other processes ignore the data processing request.
(4) The data receiving end on the game host device 10 obtains the data acquisition request sent by the API, and sends the data acquisition request to the RPC interface of the SDK in the target process.
(5) And after receiving the data acquisition request, the RPC interface acquires target data each time when the target process executes the target function. For example, each time the target process executes the tick function, the target data is collected according to the data collection request.
Specifically, the acquiring of the target data according to the data acquisition request includes:
A. and when the RPC interface of the SDK receives the data acquisition request sent by the data receiving end, executing acquisition logic and acquiring target data.
B. After the SDK acquires target data corresponding to the data acquisition request, carrying out asynchronous non-blocking data transmission through UDP to transmit the target data to the lo network card; the transmission opposite end of the SDK is an lo network card and a fixed port number, and meanwhile, the SDK does not need to wait for result return and carry out error processing in the data transmission process. The non-blocking in the asynchronous non-blocking refers to non-blocking UDP, and the asynchronous means that the whole data transmission and acquisition process is asynchronous and synchronous waiting is not needed. Compared with a log acquisition mode, IO delay is lower, meanwhile, the sending result of the UDP interface does not need to be monitored and processed, namely, the SDK sends data through the non-blocking UDP, meanwhile, whether the data sending result is successful or not does not need to be concerned, retransmission is not needed, other logics can be continuously executed after the related send function is called, and the data sending result does not need to be waited. When the load of the game process is high, the probability of delay is higher, and at this time, if a log collection mode is adopted, the system wait IO time (iowait) of the CPU is greatly increased, which affects the user experience. In another case, when the game has an abnormal problem, the log amount is greatly increased, and at this time, if a log collection mode is adopted, the influence of the abnormal problem on the game process is increased, and the complexity of log processing is increased. According to the embodiment of the application, the data is sent through the non-blocking UDP interface, so that the influence on data acquisition when the load of a game process is high or problems occur can be minimized. For example, compared with a log collection mode, although a linux system supports asynchronous IO, log writing at least requires two system calls, namely write and fsync, so as to ensure that the log falls to a disk, and writing a disk necessarily brings IO overhead and affects CPU occupation of a game process; compared with the http mode, although the http mode has class libraries supported by asynchronous http, the http protocol is relatively complex, three-way handshake, retransmission and other operations are carried out on the dependent TCP, and compared with the UDP mode, the http mode has relatively high cost and relatively weak transmission capability; therefore, compared with the existing log collection mode and http mode, the method and the device for collecting the log can reduce the request delay of the player.
C. And the data receiving end intercepts the target data received by the lo network card and the fixed port number through BPF and restores a data packet of the target data. The target data are intercepted through the BPF technology, on one hand, the acquisition efficiency of the target data can be improved, the possibility of target data loss or abnormity is reduced, on the other hand, under the cloud native network isolation scene, the data flow path can be reduced, and the bandwidth is saved.
(6) After receiving the target data, the data collection end sends the target data to the cache device 20 for caching, and sends the target data to the API on the user device 30, so as to complete the data collection request of this time.
In the actual scene, when a game problem is solved, a plurality of users often request the same target data at short intervals, and the acquired target data is cached in the cache device 20, so that the data acquisition times of the game process can be reduced, and the acquisition overhead of the game process is further reduced.
In some embodiments, when the data processing request is a new acquisition indicator request, the specific interaction flow of the data processing system is as follows:
(1) the user initiates a new acquisition indicator request through the API on the user device 30, where the new acquisition indicator request includes a new acquisition indicator and an entity type to be added. Each entity in the game process can contain a great number of indexes, all the indexes cannot be collected every time, so that the cost is high, in order to dynamically add or delete the collected index data, an interface can be exposed, and the SDK can collect new indexes through the interface.
(2) The API on the user device 30 initiates a data processing request to all the game host devices 10, and each game host device 10 receives the data processing request, where the data processing request carries the new acquisition indicator request. That is, the API sends a data processing request to all hosts, and the data collection side of each host receives the data processing request.
(3) The data collection side sends the data processing request to the RPC interface of the SDK of each game process among all game processes in the game host device 10.
(4) And when the RPC interface of the SDK of each game process receives the data processing request, calling a newly added acquisition index logic corresponding to the newly added acquisition index request in the SDK of each game process to enable the newly added acquisition index to take effect so as to ensure that the newly added acquisition index can be accessed in the next acquisition to complete the newly added acquisition index request.
Because the SDK is internally provided with newly-increased acquisition index logic, namely service registration logic, components such as ETCD (electronic toll collection) and the like do not need to be additionally deployed, the monitoring dependence of an external interface is reduced, and the development and deployment cost is saved.
The data processing system provided by the embodiment of the application receives a data processing request sent by an API on user equipment through a data receiving end of game host equipment, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request; the control data receiving end requests the SDK to execute a data processing request based on the SDK RPC interface; sending a data processing result of the SDK executing the data processing request to a fixed port of the loopback network card through a UDP interface; and then controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card and sending the data processing result to an API on the user equipment. The embodiment of the application can reduce the data acquisition cost of the game service, simultaneously does not block the operation of the game process, reduces the request delay of the player and improves the data acquisition efficiency of the game.
To further explain the embodiments of the present application, the data processing method of the present application will be described below from the game host device side and the user device side, respectively.
Referring to fig. 2, fig. 2 is a first flowchart of a data processing method according to an embodiment of the present disclosure. The embodiment of the application provides a data processing method, which is applied to electronic equipment as game host equipment, wherein the electronic equipment is provided with a data receiving end and a data acquisition communicator SDK implanted into a game process, and a Remote Procedure Call (RPC) interface is arranged in the SDK. Optionally, the electronic device may be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a PC, and a PDA. The specific process of the method can be as follows:
step 201, receiving a data processing request sent by an API on user equipment through the data receiving end, where the data processing request includes at least one of a data acquisition request and a new acquisition index request.
For example, the user device 30 is provided with an API, the API is exposed in the form of a UI interface, the user can call the API through a touch operation input on the UI interface, and the API generates a data processing request in response to the touch operation input on the UI interface. The API on the user device 30 then transmits the data processing request to the data receiving terminal on the game host device 10, so that the game host device 10 receives the data processing request transmitted by the API on the user device through the data receiving terminal.
Step 202, controlling the data receiving end to request the SDK to execute the data processing request based on the RPC interface of the SDK.
In some embodiments, when the data processing request is a data acquisition request, the controlling the data receiving end to request the SDK to execute the data processing request based on an RPC interface of the SDK includes:
controlling the data receiving end to request the SDK to execute the data acquisition request based on an RPC interface of the SDK, wherein the data acquisition request comprises a target process corresponding to target data to be acquired, a target entity to be acquired and an acquisition index of the target entity;
and controlling the SDK to collect target data according to the data collection request so as to obtain a data processing result containing the target data.
In some embodiments, before the controlling the data receiving end requests the SDK to execute the data collection request based on an RPC interface of the SDK, the method further includes:
judging whether a target game process related to the target process in the data acquisition request exists in all game processes in the electronic equipment;
and if the target game process related to the target process in the data acquisition request exists in all game processes in the electronic equipment, controlling the data receiving end to request the SDK to execute the data acquisition request based on the RPC interface of the SDK.
In some embodiments, after the determining whether a target game process related to the target process in the data collection request exists in all game processes in the electronic device, the method further includes:
and if the target game process related to the target process in the data acquisition request does not exist in all game processes in the electronic equipment, prohibiting the data receiving end from responding to the data acquisition request.
In some embodiments, the controlling the data receiving end to request the SDK to execute the data collection request based on an RPC interface of the SDK includes:
determining a target game process corresponding to the target process in the data acquisition request from all game processes in the electronic equipment;
controlling the data receiving end to request the SDK of the target game process to execute the data acquisition request based on an RPC interface of the SDK of the target game process;
the controlling the SDK to collect the target data according to the data collection request to obtain a data processing result including the target data includes:
and controlling the SDK of the target game process to acquire target data according to the data acquisition request so as to obtain a data processing result which comprises the target data and corresponds to the SDK of the target game process.
When the data processing request is a data acquisition request, the embodiment of the technical solution corresponding to step 202 may refer to the embodiment corresponding to the data processing system, and is not described in detail herein.
In some embodiments, when the data processing request is a new acquisition indicator request, the controlling the data receiving end to request the SDK to execute the data processing request based on an RPC interface of the SDK includes:
controlling the data receiving end to request the SDK of each game process to execute the newly increased acquisition index request based on the RPC interface of the SDK of each game process in all game processes in the electronic equipment, wherein the newly increased acquisition index request comprises a newly increased acquisition index and an entity type to be newly increased;
and calling newly-added acquisition index logic corresponding to the newly-added acquisition index request in the SDK of each game process to enable the newly-added acquisition index to take effect so as to obtain a data processing result which corresponds to the SDK of each game process and contains effective information of the newly-added acquisition index.
When the data processing request is a data acquisition request, the embodiment of the technical solution corresponding to step 202 may refer to the embodiment corresponding to the data processing system, and is not described in detail herein.
Step 203, sending the data processing result of the data processing request executed by the SDK to the fixed port of the loopback network card through the UDP interface.
In some embodiments, the UDP interface is a non-blocking UDP interface, and the data processing result of the data processing request executed by the SDK is sent to the fixed port of the loopback network card through the non-blocking UDP interface.
In some embodiments, the UDP interface is an asynchronous non-blocking UDP interface, and the data processing result of the data processing request executed by the SDK is sent to the fixed port of the loopback network card through the asynchronous non-blocking UDP interface.
The transmission opposite end of the SDK is an lo network card and a fixed port number, and meanwhile, the SDK does not need to wait for result return and carry out error processing in the data transmission process. The non-blocking in the asynchronous non-blocking refers to non-blocking UDP, and the asynchronous means that the whole data transmission and acquisition process is asynchronous and synchronous waiting is not needed. Compared with a log acquisition mode, IO delay is lower, meanwhile, the sending result of the UDP interface does not need to be monitored and processed, namely, the SDK sends data through the non-blocking UDP, meanwhile, whether the data sending result is successful or not does not need to be concerned, retransmission is not needed, other logics can be continuously executed after the related send function is called, and the data sending result does not need to be waited. When the load of the game process is high, the probability of delay is higher, and at this time, if a log collection mode is adopted, the system wait IO time (iowait) of the CPU is greatly increased, which affects the user experience. In another case, when the game has an abnormal problem, the log amount is greatly increased, and at this time, if a log collection mode is adopted, the influence of the abnormal problem on the game process is increased, and the complexity of log processing is increased. According to the embodiment of the application, the data is sent through the non-blocking UDP interface, so that the influence on data acquisition when the load of a game process is high or problems occur can be minimized. For example, compared with a log collection mode, although a linux system supports asynchronous IO, log writing at least requires two system calls, namely write and fsync, so as to ensure that the log falls to a disk, and writing a disk necessarily brings IO overhead and affects CPU occupation of a game process; compared with the http mode, although the http mode has class libraries supported by asynchronous http, the http protocol is relatively complex, three-way handshake, retransmission and other operations are carried out on the dependent TCP, and compared with the UDP mode, the http mode has relatively high cost and relatively weak transmission capability; therefore, compared with the existing log collection mode and http mode, the method and the device for collecting the log can reduce the request delay of the player.
And 204, controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card and sending the data processing result to an API (application program interface) on the user equipment.
For example, by intercepting the target data through the BPF technology, on one hand, the acquisition efficiency of the target data can be improved, and the possibility of target data loss or abnormality can be reduced, and on the other hand, in a cloud native network isolation scenario, the data flow path can be reduced, and the bandwidth can be saved.
In some embodiments, when the data processing result includes the target data, after the controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card, the method further includes:
and sending the target data to a cache device for caching through the data receiving end.
In the actual scene, when a game problem is solved, a plurality of users often request the same target data at short intervals, and the acquired target data is cached in the cache device 20, so that the data acquisition times of the game process can be reduced, and the acquisition overhead of the game process is further reduced.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
The data processing method provided by the embodiment of the application is applied to electronic equipment serving as game host equipment, the electronic equipment is provided with a data receiving end and a data acquisition communicator SDK implanted into a game process, a Remote Procedure Call (RPC) interface is configured in the SDK, a data processing request sent by an Application Program Interface (API) on user equipment is received through the data receiving end, and the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request; the control data receiving end requests the SDK to execute a data processing request based on the SDK RPC interface; sending a data processing result of the SDK executing the data processing request to a fixed port of the loopback network card through a UDP interface; and then controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card and sending the data processing result to an API on the user equipment. The embodiment of the application can reduce the data acquisition cost of the game service, simultaneously does not block the operation of the game process, reduces the request delay of the player and improves the data acquisition efficiency of the game.
Referring to fig. 3, fig. 3 is a second flow chart of the data processing method according to the embodiment of the present application. The embodiment of the application provides a data processing method, which is applied to electronic equipment serving as user equipment, wherein the electronic equipment is configured with an Application Programming Interface (API). Optionally, the electronic device may be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a PC, and a PDA. The specific process of the method can be as follows:
step 301, controlling the API to respond to a touch operation input by a user to generate a data processing request, where the data processing request includes at least one of a data acquisition request and a new acquisition index request.
Step 302, sending the data processing request to a game host device.
In some embodiments, when the data processing request is a data acquisition request, the sending the data processing request to a game host device includes:
sending the data acquisition request to all game host equipment, wherein the data acquisition request comprises a target process corresponding to target data to be acquired, a target entity to be acquired and an acquisition index of the target entity;
the receiving of the data processing result returned by the game host device after responding to the data processing request includes:
and receiving a data processing result returned by the game host equipment where the game process related to the data acquisition request is located after responding to the data processing request, wherein the data processing result comprises the acquired target data.
In some embodiments, before said sending said data collection request to all game host devices, further comprising:
sending the data acquisition request to cache equipment, wherein the data acquisition request is used for indicating the cache equipment to search whether target data corresponding to the data acquisition request exists in cache data or not;
and receiving a search result returned by the cache device, and sending the data acquisition request to all game host devices according to whether the search result is really sent or not.
The receiving the search result returned by the cache device, and sending the data acquisition request to all game host devices according to whether the search result really sends the data acquisition request to all game host devices includes:
in some embodiments, if the received search result returned by the cache device is that the prompt message of the target data does not exist, the data acquisition request is sent to all game host devices; or
And if the received search result returned by the cache device is the target data, forbidding sending the data acquisition request to all game host devices.
In some embodiments, when the data processing request is a new acquisition indicator request, the sending the data processing request to a game host device includes:
sending the newly increased acquisition index request to all game host equipment, wherein the newly increased acquisition index request comprises newly increased acquisition indexes and entity types to be newly increased;
the receiving of the data processing result returned by the game host device after responding to the data processing request includes:
and receiving data processing results returned by all game host equipment after responding to the data processing requests, wherein the data processing results comprise effective information of the newly-added acquisition indexes.
Step 303, receiving a data processing result returned by the game host device after responding to the data processing request.
When the data processing request is a data acquisition request, the received data processing result returned by the game host device contains acquired target data.
When the data processing request is a newly added acquisition index request, the received data processing result returned by the game host equipment contains effective information of the newly added acquisition index
All the above technical solutions may be combined arbitrarily to form an optional embodiment of the present application, and details which are not described in detail in this embodiment may be referred to related descriptions of other embodiments, and are not described herein again.
The data processing method provided by the embodiment of the application is applied to electronic equipment serving as user equipment, the electronic equipment is provided with an Application Programming Interface (API), and a data processing request is generated by controlling the API to respond to touch operation input by a user and comprises at least one of a data acquisition request and a newly-added acquisition index request; sending the data processing request to a game host device; and receiving a data processing result returned by the game host equipment after responding to the data processing request. The embodiment of the application can reduce the data acquisition cost of the game service, simultaneously does not block the operation of the game process, reduces the request delay of the player and improves the data acquisition efficiency of the game.
In order to better implement the data processing method of the embodiment of the application, the embodiment of the application further provides a data processing device applied to electronic equipment serving as game host equipment, the electronic equipment is provided with a data receiving end and a data acquisition communicator SDK implanted into a game process, and a Remote Procedure Call (RPC) interface is arranged in the SDK. Referring to fig. 4, the data processing apparatus 400 may include a first receiving module 401, a control module 402, a first sending module 403, and a processing module 404.
The first receiving module 401 is configured to receive, through the data receiving end, a data processing request sent by an application programming interface API on user equipment, where the data processing request includes at least one of a data acquisition request and a newly-added acquisition indicator request;
the control module 402 is configured to control the data receiving end to request the SDK to execute the data processing request based on an RPC interface of the SDK;
the first sending module 403 is configured to send a data processing result of the SDK executing the data processing request to a fixed port of a loopback network card through a UDP interface;
the processing module 404 is configured to control the data receiving end
And receiving the data processing result from the fixed port of the loopback network card, and sending the data processing result to an API (application program interface) on the user equipment.
In some embodiments, when the data processing request is a data collection request, the control module 402 includes:
the first control unit is used for controlling the data receiving end to request the SDK to execute the data acquisition request based on an RPC interface of the SDK, wherein the data acquisition request comprises a target process corresponding to target data to be acquired, a target entity to be acquired and an acquisition index of the target entity;
and the second control unit is used for controlling the SDK to collect the target data according to the data collection request so as to obtain a data processing result containing the target data.
In some embodiments, the control module 402 further comprises:
the judging unit is used for judging whether a target game progress related to the target progress in the data acquisition request exists in all game progresses in the electronic equipment;
the first control unit is used for controlling the data receiving end to request the SDK to execute the data acquisition request based on an RPC interface of the SDK if a target game process related to a target process in the data acquisition request exists in all game processes in the electronic equipment.
In some embodiments, the first control unit is configured to determine, from all game processes in the electronic device, a target game process corresponding to a target process in the data acquisition request, and control the data receiving end to request the SDK of the target game process to execute the data acquisition request based on an RPC interface of the SDK of the target game process;
and the second control unit is used for controlling the SDK of the target game process to acquire target data according to the data acquisition request so as to obtain a data processing result which corresponds to the SDK of the target game process and contains the target data.
In some embodiments, the processing module 404 is configured to control the data receiving end to send the target data to a cache device for caching through the data receiving end after receiving the data processing result from the fixed port of the loopback network card.
In some embodiments, the first control unit is further configured to prohibit the data receiving end from responding to the data acquisition request if a target game process related to a target process in the data acquisition request does not exist in all game processes in the electronic device.
In some embodiments, when the data processing request is a new acquisition indicator request, the control module 402 includes:
a third control unit, configured to control the data receiving end to request the SDK of each game process in all game processes in the electronic device to execute the newly added acquisition indicator request based on an RPC interface of the SDK of each game process, where the newly added acquisition indicator request includes a newly added acquisition indicator and an entity type to be newly added;
and the processing unit is used for calling the newly-added acquisition index logic corresponding to the newly-added acquisition index request in the SDK of each game process so as to enable the newly-added acquisition index to take effect, so as to obtain a data processing result which corresponds to the SDK of each game process and contains effective information of the newly-added acquisition index.
In some embodiments, the UDP interface is a non-blocking UDP interface, and the first sending module 403 is configured to send a data processing result of the data processing request executed by the SDK to a fixed port of a loopback network card through the non-blocking UDP interface.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
In the data processing apparatus 400 provided in this embodiment of the application, a first receiving module 401 receives, based on the data receiving end, a data processing request sent by an application programming interface API on a user equipment, where the data processing request includes at least one of a data acquisition request and a newly-added acquisition indicator request; the control module 402 controls the data receiving end to request the SDK to execute the data processing request based on the RPC interface of the SDK; the first sending module 403 sends the data processing result of the data processing request executed by the SDK to the fixed port of the loopback network card through the UDP interface; the processing module 404 controls the data receiving end to receive the data processing result from the fixed port of the loopback network card, and sends the data processing result to the API on the user equipment. The embodiment of the application can reduce the data acquisition cost of the game service, simultaneously does not block the operation of the game process, reduces the request delay of the player and improves the data acquisition efficiency of the game.
The embodiment of the application also provides a data processing device, which is applied to electronic equipment serving as user equipment, wherein the electronic equipment is provided with an Application Programming Interface (API). Referring to fig. 5, the data processing apparatus 500 may include a generating module 501, a second sending module 502, and a second receiving module 503.
The generating module 501 is configured to control the API to generate a data processing request in response to a touch operation input by a user, where the data processing request includes at least one of a data acquisition request and a new acquisition index request;
the second sending module 502 is configured to send the data processing request to a game host device;
the second receiving module 503 is configured to receive a data processing result returned by the game host device after responding to the data processing request.
When the data processing request is a data acquisition request, the sending the data processing request to game host equipment includes:
sending the data acquisition request to all game host equipment, wherein the data acquisition request comprises a target process corresponding to target data to be acquired, a target entity to be acquired and an acquisition index of the target entity;
the receiving of the data processing result returned by the game host device after responding to the data processing request includes:
and receiving a data processing result returned by the game host equipment where the game process related to the data acquisition request is located after responding to the data processing request, wherein the data processing result comprises the acquired target data.
In some embodiments, the second sending module 502 is configured to, before sending the data acquisition request to all game host devices, send the data acquisition request to a cache device, where the data acquisition request is used to instruct the cache device to search for whether target data corresponding to the data acquisition request exists in cache data;
the second receiving module 503 is further configured to receive a search result returned by the cache device, and determine whether to send the data acquisition request to all game host devices according to the search result.
In some embodiments, the second receiving module 503 is further configured to receive a search result returned by the cache device, and send the data collection request to all game host devices according to whether the search result really sends the data collection request to all game host devices, including:
if the received search result returned by the cache device is that the prompt message of the target data does not exist, the data acquisition request is sent to all game host devices; or
And if the received search result returned by the cache device is the target data, forbidding sending the data acquisition request to all game host devices.
In some embodiments, when the data processing request is a new acquisition indicator request, the second sending module 502 is configured to send the new acquisition indicator request to all game host devices, where the new acquisition indicator request includes a new acquisition indicator and an entity type to be added;
the second receiving module 503 is configured to receive a data processing result returned by all the game host devices after responding to the data processing request, where the data processing result includes effective information of the newly added acquisition indicator.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
The data processing apparatus 500 provided in the embodiment of the application, controls the API to respond to the touch operation input by the user through the generating module 501, and generates a data processing request, where the data processing request includes at least one of a data acquisition request and a newly-added acquisition index request; the second sending module 502 sends the data processing request to a game host device; the second receiving module 503 receives a data processing result returned by the game host device after responding to the data processing request. The embodiment of the application can reduce the data acquisition cost of the game service, simultaneously does not block the operation of the game process, reduces the request delay of the player and improves the data acquisition efficiency of the game.
Correspondingly, an embodiment of the present application further provides an electronic device, where the electronic device may be a terminal, and the terminal may be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like. As shown in fig. 6, fig. 6 is a schematic structural diagram of an electronic device provided in the embodiment of the present application. The electronic device 600 includes a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, and a computer program stored on the memory 602 and executable on the processor. The processor 601 is electrically connected to the memory 602. Those skilled in the art will appreciate that the electronic device configurations shown in the figures do not constitute limitations of the electronic device, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
The processor 601 is a control center of the electronic device 600, connects various parts of the whole electronic device 600 by using various interfaces and lines, performs various functions of the electronic device 600 and processes data by running or loading software programs and/or modules stored in the memory 602, and calling data stored in the memory 602, thereby performing overall monitoring of the electronic device 600.
In this embodiment of the application, the processor 601 in the electronic device 600 loads instructions corresponding to processes of one or more applications into the memory 602, and the processor 601 executes the applications stored in the memory 602 according to the following steps, so as to implement various functions:
receiving a data processing request sent by an Application Programming Interface (API) on user equipment through the data receiving end, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request; controlling the data receiving end to request the SDK to execute the data processing request based on the RPC interface of the SDK; sending a data processing result of the SDK executing the data processing request to a fixed port of a loopback network card through a UDP interface; and controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card and sending the data processing result to an API (application program interface) on the user equipment.
Optionally, the processor 601 in the electronic device 600 further loads instructions corresponding to processes of one or more application programs into the memory 602 according to the following steps, and the processor 601 runs the application programs stored in the memory 602, so as to implement various functions:
controlling the API to respond to touch operation input by a user to generate a data processing request, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request; sending the data processing request to a game host device; and receiving a data processing result returned by the game host equipment after responding to the data processing request.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 6, the electronic device 600 further includes: a touch display screen 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. The processor 601 is electrically connected to the touch display screen 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The touch display screen 603 can be used for displaying a graphical user interface and receiving operation instructions generated by a user acting on the graphical user interface. The touch display screen 603 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 601, and can receive and execute commands sent by the processor 601. The touch panel may overlay the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 601 to determine the type of the touch event, and then the processor 601 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 603 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display screen 603 can also be used as a part of the input unit 606 to implement an input function.
The rf circuit 604 may be used for transceiving rf signals to establish wireless communication with a network device or other electronic devices via wireless communication, and for transceiving signals with the network device or other electronic devices.
The audio circuit 605 may be used to provide an audio interface between the user and the electronic device through a speaker, microphone. The audio circuit 605 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal 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 605 and converted into audio data, which is then processed by the audio data output processor 601, and then transmitted to another electronic device via the rf circuit 604, or output to the memory 602 for further processing. The audio circuit 605 may also include an earbud jack to provide communication of peripheral headphones with the electronic device.
The input unit 606 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 607 is used to power the various components of the electronic device 600. Optionally, the power supply 607 may be logically connected to the processor 601 through a power management system, so as to implement functions of managing charging, discharging, and power consumption management through the power management system. The power supply 607 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 6, the electronic device 600 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute the steps in any data processing method provided by the present application. For example, the computer program may perform the steps of:
receiving a data processing request sent by an Application Programming Interface (API) on user equipment through the data receiving end, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request; controlling the data receiving end to request the SDK to execute the data processing request based on the RPC interface of the SDK; sending a data processing result of the SDK executing the data processing request to a fixed port of a loopback network card through a UDP interface; and controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card and sending the data processing result to an API (application program interface) on the user equipment.
For example, the computer program may further perform the steps of:
controlling the API to respond to touch operation input by a user to generate a data processing request, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request; sending the data processing request to a game host device; and receiving a data processing result returned by the game host equipment after responding to the data processing request.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
As the computer program stored in the storage medium can execute the steps in any data processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any data processing method provided in the embodiments of the present application can be achieved.
The foregoing detailed description has provided a data processing method, a storage medium, and an electronic device according to embodiments of the present application, and specific examples have been applied in the present application to explain the principles and implementations of the present application, and the descriptions of the foregoing embodiments are only used to help understand the methods and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (15)

1. A data processing method is applied to electronic equipment serving as game host equipment, and is characterized in that the electronic equipment is provided with a data receiving end and a data acquisition communicator SDK implanted into a game process, a Remote Procedure Call (RPC) interface is arranged in the SDK, and the method comprises the following steps:
receiving a data processing request sent by an Application Programming Interface (API) on user equipment through the data receiving end, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request;
controlling the data receiving end to request the SDK to execute the data processing request based on the RPC interface of the SDK;
sending a data processing result of the SDK executing the data processing request to a fixed port of a loopback network card through a UDP interface;
and controlling the data receiving end to receive the data processing result from the fixed port of the loopback network card and sending the data processing result to an API (application program interface) on the user equipment.
2. The data processing method of claim 1, wherein when the data processing request is a data acquisition request, the controlling the data receiving end to request the SDK to execute the data processing request based on an RPC interface of the SDK comprises:
controlling the data receiving end to request the SDK to execute the data acquisition request based on an RPC interface of the SDK, wherein the data acquisition request comprises a target process corresponding to target data to be acquired, a target entity to be acquired and an acquisition index of the target entity;
and controlling the SDK to collect target data according to the data collection request so as to obtain a data processing result containing the target data.
3. The data processing method of claim 2, wherein before the controlling the data receiving end requests the SDK to perform the data collection request based on an RPC interface of the SDK, further comprising:
judging whether a target game process related to the target process in the data acquisition request exists in all game processes in the electronic equipment;
and if the target game process related to the target process in the data acquisition request exists in all game processes in the electronic equipment, controlling the data receiving end to request the SDK to execute the data acquisition request based on the RPC interface of the SDK.
4. The data processing method of claim 3, wherein the controlling the data receiving end to request the SDK to execute the data collection request based on an RPC interface of the SDK comprises:
determining a target game process corresponding to the target process in the data acquisition request from all game processes in the electronic equipment;
controlling the data receiving end to request the SDK of the target game process to execute the data acquisition request based on an RPC interface of the SDK of the target game process;
the controlling the SDK to collect the target data according to the data collection request to obtain a data processing result including the target data includes:
and controlling the SDK of the target game process to acquire target data according to the data acquisition request so as to obtain a data processing result which comprises the target data and corresponds to the SDK of the target game process.
5. The data processing method of claim 4, wherein after controlling the data receiving to receive the data processing result from the fixed port of the loopback network card, the method further comprises:
and sending the target data to a cache device for caching through the data receiving end.
6. The data processing method according to claim 3, wherein after the determining whether the target game process related to the target process in the data collection request exists in all game processes in the electronic device, the method further comprises:
and if the target game process related to the target process in the data acquisition request does not exist in all game processes in the electronic equipment, prohibiting the data receiving end from responding to the data acquisition request.
7. The data processing method of claim 1, wherein when the data processing request is a new acquisition indicator request, the controlling the data receiving end to request the SDK to execute the data processing request based on an RPC interface of the SDK comprises:
controlling the data receiving end to request the SDK of each game process to execute the newly increased acquisition index request based on the RPC interface of the SDK of each game process in all game processes in the electronic equipment, wherein the newly increased acquisition index request comprises a newly increased acquisition index and an entity type to be newly increased;
and calling newly-added acquisition index logic corresponding to the newly-added acquisition index request in the SDK of each game process to enable the newly-added acquisition index to take effect so as to obtain a data processing result which corresponds to the SDK of each game process and contains effective information of the newly-added acquisition index.
8. The data processing method of claim 1, wherein the UDP interface is a non-blocking UDP interface, and the sending the data processing result of the data processing request executed by the SDK to the fixed port of the loopback network card through the UDP interface comprises:
and sending a data processing result of the SDK executing the data processing request to a fixed port of a loopback network card through a non-blocking UDP interface.
9. A data processing method applied to an electronic device as a user device, wherein the electronic device is configured with an application programming interface API, the method comprising:
controlling the API to respond to touch operation input by a user to generate a data processing request, wherein the data processing request comprises at least one of a data acquisition request and a newly-added acquisition index request;
sending the data processing request to a game host device;
and receiving a data processing result returned by the game host equipment after responding to the data processing request.
10. The data processing method of claim 9, wherein when the data processing request is a data acquisition request, the sending the data processing request to a game host device comprises:
sending the data acquisition request to all game host equipment, wherein the data acquisition request comprises a target process corresponding to target data to be acquired, a target entity to be acquired and an acquisition index of the target entity;
the receiving of the data processing result returned by the game host device after responding to the data processing request includes:
and receiving a data processing result returned by the game host equipment where the game process related to the data acquisition request is located after responding to the data processing request, wherein the data processing result comprises the acquired target data.
11. The data processing method of claim 10, before said sending the data collection request to all game host devices, further comprising:
sending the data acquisition request to cache equipment, wherein the data acquisition request is used for indicating the cache equipment to search whether target data corresponding to the data acquisition request exists in cache data or not;
and receiving a search result returned by the cache device, and sending the data acquisition request to all game host devices according to whether the search result is really sent or not.
12. The data processing method of claim 11, wherein the receiving the search result returned by the cache device and sending the data collection request to all game host devices according to whether the search result really sends the data collection request to all game host devices comprises:
if the received search result returned by the cache device is that the prompt message of the target data does not exist, the data acquisition request is sent to all game host devices; or
And if the received search result returned by the cache device is the target data, forbidding sending the data acquisition request to all game host devices.
13. The data processing method of claim 9, wherein when the data processing request is a new acquisition indicator request, the sending the data processing request to a game host device comprises:
sending the newly increased acquisition index request to all game host equipment, wherein the newly increased acquisition index request comprises newly increased acquisition indexes and entity types to be newly increased;
the receiving of the data processing result returned by the game host device after responding to the data processing request includes:
and receiving data processing results returned by all game host equipment after responding to the data processing requests, wherein the data processing results comprise effective information of the newly-added acquisition indexes.
14. A computer-readable storage medium, characterized in that it stores a computer program adapted to be loaded by a processor to perform the data processing method of any of claims 1-8 or to perform the data processing method of any of claims 9-13.
15. An electronic device, characterized in that the electronic device comprises a memory in which a computer program is stored and a processor which executes the data processing method of any one of claims 1-8 or the data processing method of any one of claims 9-13 by calling the computer program stored in the memory.
CN202110144057.9A 2021-02-02 2021-02-02 Data processing method, storage medium and electronic device Active CN112891928B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110144057.9A CN112891928B (en) 2021-02-02 2021-02-02 Data processing method, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110144057.9A CN112891928B (en) 2021-02-02 2021-02-02 Data processing method, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112891928A true CN112891928A (en) 2021-06-04
CN112891928B CN112891928B (en) 2024-07-09

Family

ID=76121527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110144057.9A Active CN112891928B (en) 2021-02-02 2021-02-02 Data processing method, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112891928B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170157512A1 (en) * 2015-12-06 2017-06-08 Sliver VR Technologies, Inc. Methods and systems for computer video game streaming, highlight, and replay
CN108170611A (en) * 2018-01-23 2018-06-15 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN108280026A (en) * 2018-01-23 2018-07-13 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN111265852A (en) * 2020-01-08 2020-06-12 广东小天才科技有限公司 Low-delay information transmission method and device based on UDP (user Datagram protocol)
CN111770043A (en) * 2019-04-01 2020-10-13 网易(杭州)网络有限公司 Game data communication method, device, storage medium and electronic equipment
CN112245907A (en) * 2020-11-10 2021-01-22 网易(杭州)网络有限公司 Game data acceleration method, storage medium, electronic device and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170157512A1 (en) * 2015-12-06 2017-06-08 Sliver VR Technologies, Inc. Methods and systems for computer video game streaming, highlight, and replay
CN108170611A (en) * 2018-01-23 2018-06-15 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN108280026A (en) * 2018-01-23 2018-07-13 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN111770043A (en) * 2019-04-01 2020-10-13 网易(杭州)网络有限公司 Game data communication method, device, storage medium and electronic equipment
CN111265852A (en) * 2020-01-08 2020-06-12 广东小天才科技有限公司 Low-delay information transmission method and device based on UDP (user Datagram protocol)
CN112245907A (en) * 2020-11-10 2021-01-22 网易(杭州)网络有限公司 Game data acceleration method, storage medium, electronic device and system

Also Published As

Publication number Publication date
CN112891928B (en) 2024-07-09

Similar Documents

Publication Publication Date Title
US10824449B2 (en) Application running method and device
EP3402160B1 (en) Service processing method and apparatus
CN108595218B (en) Method and device for loading dynamic library of system
US10152660B2 (en) Smart card read/write method and apparatus
EP3937016A1 (en) Memory management method and apparatus
CN106502703B (en) Function calling method and device
US9535666B2 (en) Dynamic agent delivery
CN108090345B (en) Linux system external command execution method and device
CN112162795B (en) Plug-in starting method and device, computer equipment and storage medium
CN114040025B (en) Method and device for controlling switching network environment and electronic equipment
CN112313627B (en) Mapping mechanism of event to serverless function workflow instance
CN111330280A (en) Data processing method and device in game, storage medium and electronic equipment
CN115145806A (en) Data acquisition method and device and computer readable storage medium
CN115469937A (en) Plug-in operation method and device, electronic equipment and storage medium
CN104679239A (en) Terminal input method
CN114327087A (en) Input event processing method and device, electronic equipment and storage medium
CN111262737B (en) Port configuration management method and device, storage medium and terminal
CN112891928B (en) Data processing method, storage medium and electronic device
EP4102361A2 (en) Method and apparatus for managing functions of a query engine
CN114095533B (en) Cloud game account login method and device, computer equipment and storage medium
CN113392120A (en) Method and device for acquiring execution information of SQLite
CN112799857B (en) Application access method, device, terminal and storage medium
CN112333787B (en) Data transmission method, device, storage medium, terminal and network access point equipment
CN114328272B (en) Application testing method, device and system and electronic equipment
CN114168332A (en) Task processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant