Game service request processing methods and devices, electronic devices, and storage media

By setting interface conversion rules on the game runtime component side, the standardized service interface and the game server interface are automatically converted, which solves the problem of service interface differences in the process of game overseas expansion, realizes interface standardization and reuse, and shortens the development cycle.

CN117717768BActive Publication Date: 2026-07-31SHENZHEN TENCENT NETWORK INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN TENCENT NETWORK INFORMATION TECH CO LTD
Filing Date
2022-09-09
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

During the process of game expansion overseas, the different needs of game services in different regions have led game developers to frequently modify service interfaces and protocols, thus extending the development cycle.

Method used

By setting interface conversion rules on the game runtime component side, it acts as a bridge between the third-party platform and the game server, automatically converting the standardized service interface and the game server interface to achieve interface parameter adaptation.

Benefits of technology

This reduces the frequency of game developers' operations on game-side service interfaces and protocols, shortens the development cycle, and achieves interface standardization and reuse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117717768B_ABST
    Figure CN117717768B_ABST
Patent Text Reader

Abstract

This application discloses a game service request processing method, apparatus, electronic device, and storage medium. The method includes: receiving a game service request sent by a third-party platform; parsing standardized service interface parameters contained in the game service request, and converting the standardized service interface parameters according to a preset interface conversion rule to obtain target interface parameters adapted to the game server, and forwarding the target interface parameters to the game server; after receiving response data returned by the game server for the target interface parameters, converting the response data according to the interface conversion rule to obtain target response data adapted to the third-party platform; and forwarding the target response data to the third-party platform. The embodiments of this application are adaptable to processing game service requests in overseas game distribution scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game development, specifically to a game service request processing method and apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Game overseas expansion refers to the phenomenon of developing a game in one region and releasing it in another region's game market, typically referring to different countries. Different regions often have different game service requirements. However, the game program has already developed its service interfaces and related protocols before being exported overseas, and the interface parameters of each service interface are inconsistent, with diverse fields. To meet the differentiated game service requirements resulting from overseas expansion, game developers currently need to frequently add, delete, modify, and redeploy the game's service interfaces and related protocols, leading to extended game development cycles. Summary of the Invention

[0003] To address the aforementioned technical problems, embodiments of this application provide a game service request processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.

[0004] According to one aspect of the embodiments of this application, a game service request processing method is provided. This method is applied to a game service system, which includes a game runtime component, a third-party platform and a game server respectively communicatively connected to the game runtime component, and the method is executed by the game runtime component. The method includes: receiving a game service request sent by the third-party platform; parsing standardized service interface parameters contained in the game service request, and converting the standardized service interface parameters according to a preset interface conversion rule to obtain target interface parameters adapted to the game server, and forwarding the target interface parameters to the game server; after receiving response data returned by the game server for the target interface parameters, converting the response data according to the interface conversion rule to obtain target response data adapted to the third-party platform; and forwarding the target response data to the third-party platform.

[0005] According to one aspect of the embodiments of this application, a game service request processing apparatus is provided. This apparatus is applied to a game service system, which includes a game runtime component and a third-party platform and a game server respectively communicatively connected to the game runtime component. The apparatus is configured on the game runtime component and includes: a request receiving module for receiving game service requests sent by the third-party platform; a first conversion processing module for parsing standardized service interface parameters contained in the game service request and converting the standardized service interface parameters according to a preset interface conversion rule to obtain target interface parameters adapted to the game server, and forwarding the target interface parameters to the game server; a second conversion processing module for converting response data returned by the game server for the target interface parameters according to the interface conversion rule after receiving the response data, to obtain target response data adapted to the third-party platform; and a data forwarding module for forwarding the target response data to the third-party platform.

[0006] In another exemplary embodiment, the game service request processing device further includes: a configuration file acquisition module, configured to acquire a configuration file corresponding to a standardized service interface sent by a component management terminal, wherein the configuration file contains interface parameters required to request the standardized service interface; and a rule construction module, configured to construct an interface conversion rule based on the interface parameters corresponding to the standardized service interface to convert the standardized service interface to an existing service interface in the game server.

[0007] In another exemplary embodiment, the rule construction module includes: a protocol configuration unit, configured to configure the interface protocol of the standardized service interface according to the interface parameters corresponding to the standardized service interface, and to configure the interface protocols of existing service interfaces in the game server, wherein each interface protocol contains preset field conversion rules, and the field set included in the interface protocol of the service interface is a superset of the field set included in the interface protocol of the standardized service interface; and a mapping establishment unit, configured to establish a mapping relationship between the interface protocol of the standardized service interface and the interface protocol of the service interface.

[0008] In another exemplary embodiment, the rule building module further includes a field configuration unit, used to obtain preset field conversion rules in each interface protocol by establishing a mapping relationship between input fields and output fields and configuring the field types of the input fields and the field types of the output fields during the configuration of each interface protocol.

[0009] In another exemplary embodiment, the rule building module further includes: a structured object configuration unit, used to obtain preset field conversion rules in each interface protocol by configuring a structured object and using attributes that support recursive expansion to represent the structured object during the configuration of each interface protocol.

[0010] In another exemplary embodiment, the first conversion processing module includes: a protocol determination unit, configured to determine the interface protocol of the standardized service interface based on the standardized service interface parameters; a protocol jump unit, configured to jump to execute the interface protocol of a target service interface in the game server based on the mapping relationship between the interface protocol of the standardized service interface and the interface protocols of existing service interfaces in the game server; and a protocol execution unit, configured to perform field conversion processing on the standardized service interface parameters according to preset field conversion rules in the interface protocol of the target service interface, so as to obtain target interface parameters adapted to the game server.

[0011] In another exemplary embodiment, the protocol execution unit includes: an expression generation subunit, configured to generate a JSON path expression based on the field conversion rules and the standardized service interface parameters, wherein the JSON path expression includes fields before and after conversion; a field processing subunit, configured to obtain the value of the fields before conversion using a retrieval function and the value of the fields after conversion using a setting function based on the JSON path expression; and an information determination subunit, configured to determine target interface parameters adapted to the game server based on the value of the fields after conversion.

[0012] According to one aspect of the embodiments of this application, an electronic device is provided, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device enables the game service request processing method as described above.

[0013] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, on which computer-readable instructions are stored, which, when executed by a computer's processor, cause the computer to perform the game service request processing method as described above.

[0014] According to one aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in the game service request processing method described above.

[0015] In the technical solution provided by the embodiments of this application, by setting the game runtime component as a communication bridge between the third-party platform and the game server, and by pre-configuring interface conversion rules on the game runtime component, the third-party platform only needs to call the standardized service interface uniformly provided by the game developer to obtain the required game services. The game runtime component automatically converts between the standardized service interface and the service interface already developed in the game server according to the pre-configured interface conversion rules. This eliminates the need for developers to frequently operate the service interface and related protocols on the game side, and can significantly reduce the game development cycle.

[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0018] Figure 1 This is a schematic diagram of one implementation environment involved in this application;

[0019] Figure 2 yes Figure 1 A schematic diagram of the backend architecture deployed in the game runtime component 120 in the implementation environment shown;

[0020] Figure 3 This is a flowchart illustrating a game service request processing method as shown in an exemplary embodiment of this application;

[0021] Figure 4 This is a schematic diagram of the interaction flow involved in the game service request processing method, as illustrated in an exemplary embodiment of this application;

[0022] Figure 5 This is a flowchart illustrating a game service request processing method, as shown in another exemplary embodiment of this application;

[0023] Figure 6 This is a schematic diagram illustrating the user interface provided by the component management terminal in an exemplary embodiment of this application;

[0024] Figure 7 This is an exemplary diagram illustrating the conversion relationship between input and output fields in this application;

[0025] Figure 8 Based on Figure 3 A flowchart of another exemplary game service request processing method proposed in the illustrated embodiment;

[0026] Figure 9 This is a schematic diagram of a DOM tree illustrating an exemplary embodiment of this application;

[0027] Figure 10 It is Figure 9 The diagram illustrates the effect of converting the DOM tree to a binary protocol.

[0028] Figure 11 This is a block diagram illustrating a game service request processing apparatus as shown in an exemplary embodiment of this application;

[0029] Figure 12 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation

[0030] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0031] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0032] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0033] In this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0034] As mentioned in the background section, in the context of game exports, different regions often have different game service needs, but there is currently no perfect solution to address the problem of differentiated game service needs caused by game exports.

[0035] For example, due to the extreme sensitivity of user data overseas, games released overseas are typically required to undergo compliance reviews, such as requiring the deletion of corresponding account and game character information when a user account is cancelled. However, because service interfaces and related protocols are already developed before games are released overseas, the interface parameters are inconsistent and the fields are diverse. For instance, the account deletion interface defined on the game side contains many fields, and the naming of these fields is irregular. For example, the field commonly used to define a user's game account is named "openid," representing the user's unique ID (Identity Document). However, the actual field names defined on the game side for user game accounts can be various, such as "PlayerID," "Uid," and "GOpenid." This means that game publishers overseas do not know how to call the game side's account deletion interface to delete cancelled accounts. Therefore, game developers need to redevelop a compliant account deletion interface on the game side so that game publishers overseas can call this specially developed account deletion interface to delete user game accounts.

[0036] For example, some games may use the TCP (Transmission Control Protocol) private protocol, but after the game is released overseas, the network conditions overseas cannot support the implementation of the TCP private protocol. Therefore, the game developers need to modify the relevant game protocols and re-release the game.

[0037] Furthermore, it should be mentioned that the number of service interfaces on the game side is usually very large. Therefore, in the scenario of game going global, there is a tendency to frequently add, delete, and modify the service interfaces and related protocols that have been developed before going global, which will obviously lead to an extension of the game development cycle.

[0038] To address the aforementioned issues arising from the overseas expansion of games, embodiments of this application propose a game service request processing method, a game service request processing apparatus, an electronic device, a computer-readable storage medium, and a computer program product. These embodiments will be described in detail below.

[0039] First see Figure 1 , Figure 1This is a schematic diagram of an implementation environment involved in this application. The implementation environment is a game service system, including a third-party platform 110, a game runtime component 120, and a game server 130. The game runtime component 120 establishes communication connections with the third-party platform 110 and the game server 130 respectively, so that the game runtime component 120 acts as a bridge between the third-party platform 110 and the game server 130.

[0040] Third-party platform 110 is a general term for game operation platforms, including but not limited to... Figure 1 The customer service platform, security platform, and payment platform shown here are not limited to the specific platform types included in the third-party platform 100.

[0041] The game runtime component 120 is equipped with services such as protocol proxy, protocol conversion, and protocol path management. These services specifically facilitate interface reuse or protocol conversion between the third-party platform 110 and the game server 130, thus enabling the game runtime component 120 to act as a bridge. For example... Figure 1 As shown, the third-party platform 110 initiates a game service request to the game runtime component 120 via HTTPS (Hypertext Transfer Protocol Secure). The game runtime component 120 uses a protocol proxy service to convert the received game service request into an HTTPS game service request adapted for the game server 130 before sending it to the game server 130. If the game server 130 does not support receiving HTTP requests but needs to receive TCP private protocol requests, the game runtime component 120 uses a protocol conversion service to convert the received game service request into a TCP private protocol request before sending it to the game server 130. If the game service interface in the game server 130 supports routing, the game runtime component 120 can further use a protocol routing service function on top of the protocol proxy service and protocol conversion service functions to implement the relevant interface routing in the game server 130 according to the request from the third-party platform 110.

[0042] Game server 130 is used to run the game program, that is... Figure 1 The in-game logic processing is shown below. It should be noted that this applies to the game's overseas expansion scenario. Figure 1 The game service system shown is deployed overseas, and the game program running in the game server 130 was developed before going overseas.

[0043] It should also be noted that the third-party platform 110, the game runtime component 120, and the game server 130 can be any terminal device that supports the installation of software programs, such as smartphones, tablets, laptops, and computers. They can also be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. There are no restrictions on these.

[0044] Please continue reading. Figure 2 , Figure 2 yes Figure 1 This diagram illustrates the backend architecture deployed in the game runtime component 120 within the implementation environment. This exemplary backend architecture clearly demonstrates the overall service functionality of the game runtime component 120.

[0045] like Figure 2 As shown, the backend architecture of the game runtime component 120 is a three-layer structure, including an access layer, a logic layer, and a storage layer. The access layer includes load balancing (LB) for various third-party platforms (used to distribute network services across multiple servers), and also primarily provides control functions for frequency limiting, access control, traffic forwarding, and routing forwarding. The logic layer includes the core functions of the game runtime component 120, namely protocol conversion and field mapping. Detailed implementation details are described in subsequent embodiments and will not be repeated here. The storage layer is mainly used to store configuration information, routing information, etc. Routing forwarding is configured between the access layer and the logic layer through a reliable configuration center. The logic layer also has a log monitoring center for reporting logs and monitoring information, and a management terminal for configuring specific rules for protocol conversion and field mapping. This essentially forms the overall architecture of the game runtime component 120.

[0046] It should be understood that in practical application scenarios, the components of the game runtime component's 120 backend architecture can be configured according to actual needs, for example, they may include more... Figure 2 The inclusion of more or fewer functional components does not imply a limitation on the backend architecture of the game runtime component 120.

[0047] Figure 3 This is a flowchart illustrating a game service request processing method as an exemplary embodiment of this application. This game service request processing method is applicable to... Figure 1 The implementation environment shown, and by Figure 1The game runtime component 120 in the implementation environment shown is specifically executed.

[0048] This game service request processing method can also be applied to other implementation environments and executed by terminal devices or servers in other implementation environments. This embodiment does not limit this, but it should be noted that other implementation environments should also have similar capabilities. Figure 1 The game runtime component 120, which acts as a bridge in the implementation environment shown, and the related equipment with such... Figure 1 The third-party platform 110 and the game server 130 in the implementation environment shown require interface conversion by the game runtime component 120 to conform to the application scenario of the game service request processing method.

[0049] The following will be based on Figure 1 The implementation environment shown is the implementation environment for this game service request processing method. This article provides a detailed description of the game service request processing method.

[0050] like Figure 3 As shown, in an exemplary embodiment, the game service request processing method includes steps S310-S340, which are described in detail below:

[0051] S310 receives game service requests sent by third-party platforms.

[0052] like Figure 1 As shown in the game service system, when a third-party component needs to request data services from the game server, it sends a game service request to the game runtime component. The game runtime component then responds to the game service request sent by the third-party platform via an interface.

[0053] S320 parses the standardized service interface parameters contained in the game service request, and performs conversion processing on the standardized service interface parameters according to the preset interface conversion rules to obtain the target interface parameters adapted to the game server, so as to forward the target interface parameters to the game server.

[0054] Considering that in the context of game overseas expansion, service interfaces and related protocols are already developed before the game goes global, and the interface parameters and fields of each service interface are inconsistent and diverse, the technical solution of this embodiment provides standardized service interface parameters to third-party platforms. This means providing a unified standardized service interface to third-party platforms, allowing them to request relevant game services by calling the standardized service interface. Therefore, the game service request received by the game runtime component contains the standardized service interface parameters corresponding to the standardized service interface. It should be noted that games typically have a large number of service interfaces with different functions. This embodiment can provide a standardized service interface for each function separately, or it can provide a unified standardized service interface for several functions; no limitation is imposed here.

[0055] The standardized service interface is not a pre-developed service interface by the game server. Therefore, third-party platforms cannot directly obtain game services from the game server based on game service requests. Instead, the game runtime component needs to parse the standardized service interface parameters contained in the game service request and convert them according to preset interface conversion rules to obtain target interface parameters adapted to the game server. Once the game runtime component converts the target interface parameters to the game server, it can then request and obtain game services from the game server based on those parameters.

[0056] In other words, this embodiment sets up a game runtime component as an interface communication bridge between the third-party platform and the game service side, and presets interface conversion rules in the game runtime component. This allows the game service request sent by the third-party platform to be converted into a game service request that the game service side can recognize and process. This conversion process is automatically executed by the game runtime component. Game developers do not need to add, delete, or modify the game service interface that was developed before going overseas, nor do they need to re-release the modified game program.

[0057] After receiving the response data returned by the game server for the target interface parameters, S330 converts the response data according to the interface conversion rules to obtain the target response data adapted to the third-party platform.

[0058] After the game server interface sends the target interface parameters to the game runtime component, it will respond to the request corresponding to the target interface parameters by returning the corresponding response data to the game runtime component. For the same reason mentioned above that interface parameter conversion is required, the response data cannot be directly recognized by the third-party platform as the response data corresponding to the game service request. Therefore, the game runtime component needs to convert the response data returned by the game server according to the preset interface conversion rules to obtain the target response data adapted to the third-party platform.

[0059] It's important to understand that converting response data into target response data is the reverse process of converting standardized service interface parameters into target interface parameters, but both conversion processes are based on preset interface conversion rules. In other words, the preset interface conversion rules include rules for mutual interface conversion, thus acting as a bridge between the game's runtime components.

[0060] S340 forwards the target response data to a third-party platform.

[0061] If the game runtime component forwards the converted target response data to the third-party platform, the third-party platform's interface can receive the response result corresponding to the game service request initiated by itself.

[0062] As can be seen from the above solution provided in this embodiment, since the game running component automatically converts between the standardized service interface and the service interface already developed in the game server according to the preset interface conversion rules, developers do not need to frequently operate the service interface and related protocols on the game side, which can greatly reduce the game development cycle.

[0063] It should also be noted that the game service request processing process revealed by the above technical solution can be represented as follows: Figure 4 As shown, during the entire process of a third-party platform requesting game services from the game server, the platform only needs to call the standardized service interface provided by the game server to obtain the corresponding game services. The game server is unaware of the existence of this standardized service interface, and the third-party platform only needs to call one interface. This can be understood as reusing the service interface already developed in the game server, achieving interface reuse and standardization. Furthermore, by providing a unified standardized service interface to the third-party platform, this embodiment can further reduce the integration cost for the platform.

[0064] Figure 5 This is a flowchart illustrating a game service request processing method, as shown in another exemplary embodiment of this application. Figure 5 As shown, the game service request processing method is in Figure 3 The illustrated embodiment also includes steps S510-S520, which are described in detail below:

[0065] S510 retrieves the configuration file corresponding to the standardized service interface sent by the component management terminal. The configuration file contains the interface parameters required to request the standardized service interface.

[0066] The component management end corresponds to in Figure 2The management interface set up in the logic layer of the game runtime component shown is used to configure the interface conversion rules. The component management interface can also be understood as the front-end corresponding to the game runtime component.

[0067] Since the standardized service interface provided to the outside world is a new interface relative to the game server, it is necessary to configure the standardized service interface in the game runtime component, and then build the corresponding interface conversion rules for converting the standardized service interface with the existing service interface in the game server.

[0068] Figure 6 This is a schematic diagram illustrating the user interface provided by the component management terminal in an exemplary embodiment of this application. Figure 6 The example component management terminal provides a user interface for configuring standardized service interfaces. This interface supports the selection of interface parameter configuration methods, configuration of interface input head and body parameters, and configuration of interface output head and body parameters. Clicking the "Save" button in the interface will generate the configuration file corresponding to the newly added standardized service interface.

[0069] The game runtime component, acting as the backend of the component management component, completes the relevant configurations for the standardized service interfaces in the component management component. It then receives the configuration file corresponding to the standardized service interface sent by the component management component. This configuration file contains the interface parameters for requesting the standardized service interface, for example... Figure 6 The interface input parameters and interface output parameters are shown.

[0070] S520, based on the interface parameters corresponding to the standardized service interface, constructs interface conversion rules to convert the standardized service interface to the existing service interface in the game server.

[0071] Once the game runtime component obtains the interface parameters corresponding to the standardized service interface, it can construct interface conversion rules to transform the standardized service interface into existing service interfaces in the game server. Interface conversion rules are essentially the methods for converting interface parameters between different service interfaces. Generally, interface conversion rules should have at least the following characteristics:

[0072] First, it can accurately describe the mapping of any field, including arrays and nested structures;

[0073] Second, the rules are simple and easy to understand;

[0074] Third, it is easy to maintain and expand.

[0075] Based at least on the above characteristics, this embodiment provides the following method for constructing interface conversion rules.

[0076] For example, considering that the basis for implementing the mutual conversion between interface parameters of different service interfaces is to establish an association between different service interfaces, the interface conversion rules can be constructed according to the following steps S521-S522:

[0077] S521, Configure the interface protocol of the standardized service interface according to the interface parameters corresponding to the standardized service interface, and configure the interface protocol of the existing service interface in the game server. Each interface protocol contains preset field conversion rules, and the field set contained in the interface protocol of the existing service interface in the game server is a superset of the field set contained in the interface protocol of the standardized service interface.

[0078] S522 establishes a mapping relationship between the interface protocol of the standardized service interface and the interface protocol of the existing service interface in the game server.

[0079] API requests typically consist of a protocol and fields, for example... Figure 2 The example of an "HTTPS+JSON" request format uses JSON (JavaScript Object Notation), a lightweight data exchange format, often referred to as a JSON string. Therefore, the interface conversion rules also need to include the conversion of the interface protocol and fields. In this embodiment, the interface protocol of the standardized service interface can be configured according to the interface parameters corresponding to the standardized service interface. Furthermore, since the interface parameters of existing service interfaces in the game server can be known in advance, the interface protocols of these existing service interfaces can be configured accordingly.

[0080] The following example illustrates the process of constructing the interface conversion rules shown above.

[0081] First, configure the 4097 protocol corresponding to the 4097 interface as follows:

[0082]

[0083] The configuration of the 100 interface and the corresponding 100 protocol are as follows:

[0084]

[0085]

[0086] The mapping relationship between the 4097 protocol and the 100 protocol is established as follows:

[0087] "map_cmd":{

[0088] "100":4097

[0089] }

[0090] As can be seen, the above interface conversion rules configure a 4097 protocol and a 100 protocol respectively, establishing a mapping relationship between the 4097 and 100 protocols. The 100 protocol represents the interface protocol corresponding to a standardized service interface named "Delete Account," while the 4097 protocol represents the interface protocol corresponding to an existing service interface in the game server named "Query Character Information." The field set of the 4097 protocol is a superset of the field set of the 100 protocol. Each interface protocol contains preset field conversion rules. For example, the 4097 and 100 protocols illustrate converting the field " / cmd" to the field " / head / cmd," enabling mutual conversion between request-corresponding interface parameters based on the mapping between interface protocols and the field conversion rules within the interface protocols.

[0091] Based on the example above, the game server is unaware of the 100 interface; however, for the third-party platform, a standardized 100 interface has been added, and calling the 100 interface can realize the function of deleting an account in the game; for the game runtime component, the 4097 interface is reused through field conversion and mapping relationships, thereby achieving the purpose of interface reuse and standardization.

[0092] It should also be noted that the preset field conversion rules in each interface protocol can be configured through the following process: establish the mapping relationship between input fields and output fields, and configure the field types of input fields and output fields.

[0093] For example Figure 7 As shown, Figure 7 This is an exemplary diagram illustrating the conversion relationship between input and output fields in this application. It shows that the input field "cmd":1" needs to be converted into the output "head's cmd object", the input field "a":"a"" needs to be converted into the output "body's a object", and the input field "b":"b"" needs to be converted into the output "body's b object". To meet this requirement, the first field conversion rule needs to be set as follows:

[0094] Map the " / cmd" field entered from the third-party platform to the " / head / cmd" field on the game server;

[0095] The input field's type is configured as "intype:":"int";

[0096] The output field type is configured as "outtype":":"int".

[0097] Set the second field conversion rule as follows:

[0098] Map the " / a" field input from the third-party platform to the ""field:":" / body / a"" field on the game server;

[0099] The input field's type is configured as "intype:":"string";

[0100] The output field type is configured as "outtype":":"string".

[0101] Set the third field conversion rule as follows:

[0102] Map the " / b" field input from the third-party platform to the ""field:":" / body / b"" field on the game server;

[0103] The input field's type is configured as "intype:":"string";

[0104] The output field type is configured as "outtype":":"string".

[0105] Therefore, the three field conversion rules above describe the mapping relationship between input and output fields in the game runtime component. It's important to understand that the types of input and output fields can also typically include Int8, Int32, Int64, float, double, etc., with the specific field type determined based on the actual application scenario. Furthermore, it's crucial to understand that the pre-defined field conversion rules in each interface protocol should be configured accordingly based on the actual interface protocol; the above is merely an illustrative explanation.

[0106] It's also worth mentioning that in real-world applications, the input or output of a request is typically structured. For example, a game character usually has multiple attributes, which are often expanded based on business requirements. To handle this expansion definition, field transformation rules also need to be configured with nested transformation rules, such as the fourth field transformation rule shown below:

[0107]

[0108] As can be seen, the fourth field conversion rule configures a structured object, using the "opname" and "optype" attributes to represent this structured object. "optype":2" indicates that this element is an array of objects, the contents of which are objects named RoleInfo. The RoleInfo objects can then be recursively expanded and their members processed. For example, the specific description of this structured object can be represented as follows:

[0109]

[0110] It should also be noted that in practical application scenarios, if the nesting of structured fields may be infinite, each RoleInfo object member can also be recursively expanded using the corresponding attributes to meet the needs of structured field processing in practical application scenarios. This embodiment does not restrict the nesting method of structured objects.

[0111] After the interface conversion rules are preset on the game runtime component side, these interface conversion rules will automatically convert game service requests initiated by third-party platforms, as well as automatically convert request response packets sent by the game server.

[0112] Please see Figure 8 , Figure 8 Based on Figure 3 A flowchart illustrating another exemplary game service request processing method proposed in the illustrated embodiment. This game service request processing method demonstrates... Figure 3 Step S320 in the illustrated embodiment further includes the following steps S321-S323, which are described in detail below:

[0113] S321, Determine the interface protocol of the standardized service interface based on the standardized service interface parameters.

[0114] As mentioned earlier, the pre-defined interface conversion rules in the game runtime component consist of three parts: configuring one interface protocol, configuring another interface protocol, and establishing a mapping relationship between the two interface protocols. Therefore, after parsing the standardized service interface parameters contained in the game service request sent by the third-party platform, the game runtime component can determine the corresponding interface protocol of the standardized service interface from the interface conversion rules.

[0115] S322, based on the mapping relationship between the interface protocol of the standardized service interface and the interface protocol of the existing service interface in the game server, jumps to execute the interface protocol of the target service interface in the game server.

[0116] Because the interface conversion protocol contains mapping relationships between different interface protocols, the game runtime component can jump to execute the interface protocol of the target service interface in the game server that is mapped to the interface protocol of the standardized service interface in the interface conversion rules, based on the corresponding mapping relationship.

[0117] S323, Perform field conversion processing on the standardized service interface parameters according to the preset field conversion rules in the interface protocol of the target service interface to obtain target interface parameters adapted to the game server.

[0118] As mentioned earlier, since the field conversion rules for each interface conversion protocol are already configured in the interface conversion rules, the game runtime component can perform field conversion processing on the standardized service interface parameters according to the preset field conversion rules in the interface protocol of the target service interface, thereby obtaining the target interface parameters adapted to the game server.

[0119] For example, the conversion of fields in a JSON string may include the following steps S3231-S3233:

[0120] S3231, Generate a JSON path expression based on field conversion rules and standardized service interface parameters. The JSON path expression contains the fields before and after conversion.

[0121] S3232, based on JSON path expressions, uses a get function to retrieve the value of the field before conversion and a set function to retrieve the value of the field after conversion;

[0122] S3233, determine the target interface parameters adapted to the game server based on the values ​​of the converted fields.

[0123] In the above process, by examining the mapping between parameters of input and output fields, such as mapping the " / a" field input from the third-party platform to the ""field:":" / body / a"" field from the game server, it can be simplified to the JSON path (a kind of information extraction library, a tool for extracting specified information from JSON documents, that is, used to extract data from JSON format) expression "a = body.a", which means assigning the value of the input a object element to the element a in the output body object.

[0124] To perform this transformation, the JSON string can be viewed as a DOM (Document Object Model) tree, for example... Figure 9 The tree structure shown allows JSON objects to be represented using tree paths, such as " / body / a" representing element 'a' within the `body` object. The `json path` utility can be used to arbitrarily get (get) or set (set) the value of a JSON object. For example, the `get(k1 / k2 / ... / kn)` or `set(k1 / k2 / ... / kn)` functions provided by `json path` can be used to get the value, where `k1 / k2 / ... / kn` represents the tree path and `k` represents a node in the tree. In other words, the process of converting fields based on the JSON path expression "a = body.a" is equivalent to two operations: `get(a)` to get the value and `set( / body / a)` to set the value.

[0125] If the game service interface in the game server supports routing, the routing table can be queried when using get(a) to retrieve the value. Routes composed of multiple fields can be separated by commas, thereby enabling routing based on the input data.

[0126] Therefore, this embodiment solves the problem of arbitrary field mapping by using the JSON path operation, that is, it uses the JSON path operation to map two JSON strings. It should also be noted that the type of the field to be converted needs to be checked before the conversion to ensure safe conversion.

[0127] Another example is when the game server uses a private TCP protocol. The field conversion process specifically involves the conversion between JSON strings and binary protocols, and may include the following steps S3235-S3236:

[0128] S3235, determine the field position and field length corresponding to the converted field;

[0129] S3236 generates target interface parameters adapted to the game server based on the field position and field length corresponding to the converted fields.

[0130] In the above process, considering that JSON strings are unordered while strings in binary protocols are ordered, the field conversion process between JSON strings and binary protocols will be different from the field conversion process between two JSON strings.

[0131] For example Figure 10 As shown, the binary protocol consists of a binary sequence of head + body, where the head sequence has a fixed length and the body sequence has a variable length. The length value of the body sequence is recorded by a field of the body sequence. Figure 10 The binary protocol shown is based on Figure 9 The tree structure shown illustrates the conversion process. Since the fields in the binary protocol are ordered, the position variable `pos` can be used to represent the position of the JSON field within that binary protocol, i.e., its position in the character sequence. Furthermore, the `type` variable contains the length `len` of the JSON field. This allows for field serialization even if the JSON string is unordered, based on the "pos + len" information. By iterating through and processing all fields to be converted, the final converted binary protocol can be obtained, thus ensuring reliable conversion.

[0132] Figure 11 This is a block diagram illustrating a game service request processing apparatus according to an exemplary embodiment of this application. The game service request processing apparatus is suitable for... Figure 1The implementation environment is shown, and specifically configured in... Figure 1 The game running component on end 120 in the implementation environment shown.

[0133] like Figure 11 As shown, the game service request processing device includes:

[0134] The request receiving module 1110 is used to receive game service requests sent by a third-party platform; the first conversion processing module 1120 is used to parse the standardized service interface parameters contained in the game service request, and convert the standardized service interface parameters according to the preset interface conversion rules to obtain target interface parameters adapted to the game server, so as to forward the target interface parameters to the game server; the second conversion processing module 1130 is used to convert the response data returned by the game server for the target interface parameters according to the interface conversion rules after receiving the response data, to obtain target response data adapted to the third-party platform; and the data forwarding module 1140 is used to forward the target response data to the third-party platform.

[0135] This game service request processing device sets up a game runtime component as a communication bridge between the third-party platform and the game server, and pre-configures interface conversion rules on the game runtime component. This allows the third-party platform to obtain the required game services simply by calling the standardized service interface provided by the game developer. The game runtime component automatically converts between the standardized service interface and the service interface developed in the game server according to the pre-configured interface conversion rules. This eliminates the need for developers to frequently operate on the game-side service interfaces and related protocols, and can significantly reduce the game development cycle.

[0136] In another exemplary embodiment, the game service request processing apparatus further includes:

[0137] The configuration file acquisition module is used to acquire the configuration file corresponding to the standardized service interface sent by the component management terminal. The configuration file contains the interface parameters required to request the standardized service interface. The rule construction module is used to construct interface conversion rules based on the interface parameters corresponding to the standardized service interface to convert the standardized service interface to the existing service interface in the game server.

[0138] In another exemplary embodiment, the rule building module includes:

[0139] The protocol configuration unit is used to configure the interface protocol of the standardized service interface according to the interface parameters corresponding to the standardized service interface, and to configure the interface protocol of the existing service interface in the game server. Each interface protocol contains preset field conversion rules, and the field set contained in the interface protocol of the service interface is a superset of the field set contained in the interface protocol of the standardized service interface. The mapping establishment unit is used to establish the mapping relationship between the interface protocol of the standardized service interface and the interface protocol of the service interface.

[0140] In another exemplary embodiment, the rule building module further includes:

[0141] The field configuration unit is used to establish a mapping relationship between input fields and output fields and configure the field types of input fields and output fields during the configuration of various interface protocols, so as to obtain the preset field conversion rules in each interface protocol.

[0142] In another exemplary embodiment, the rule building module further includes:

[0143] The structured object configuration unit is used to configure structured objects and represent them using attributes that support recursive expansion during the configuration of various interface protocols, so as to obtain the preset field conversion rules in each interface protocol.

[0144] In another exemplary embodiment, the first conversion processing module 1120 includes:

[0145] The protocol determination unit is used to determine the interface protocol of the standardized service interface based on the standardized service interface parameters; the protocol jump unit is used to jump to execute the interface protocol of the target service interface in the game server based on the mapping relationship between the interface protocol of the standardized service interface and the interface protocol of the existing service interface in the game server; the protocol execution unit is used to perform field conversion processing on the standardized service interface parameters according to the preset field conversion rules in the interface protocol of the target service interface to obtain the target interface parameters adapted to the game server.

[0146] In another exemplary embodiment, the protocol execution unit includes:

[0147] The expression generation subunit is used to generate a JSON path expression based on field conversion rules and standardized service interface parameters. The JSON path expression contains the fields before and after conversion. The field processing subunit is used to retrieve the values ​​of the fields before conversion using a retrieval function and the values ​​of the fields after conversion using a setting function based on the JSON path expression. The information determination subunit is used to determine the target interface parameters adapted to the game server based on the values ​​of the fields after conversion.

[0148] In another exemplary embodiment, the information determination subunit is used to determine the field position and field length corresponding to the converted field; and to generate target interface parameters adapted to the game server based on the field position and field length corresponding to the converted field.

[0149] It should be noted that the game service request processing device and the game service request processing method provided in the above embodiments belong to the same concept. The specific ways in which each module and unit performs operations have been described in detail in the method embodiments, and will not be repeated here. In practical applications, the game service request processing device provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above, and this is not a limitation here.

[0150] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the game service request processing method provided in the above embodiments.

[0151] Figure 12 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 12 The computer system 1200 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0152] like Figure 12 As shown, the computer system 1200 includes a Central Processing Unit (CPU) 1201, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1202 or programs loaded from storage portion 1208 into Random Access Memory (RAM) 1203, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 1203. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. An Input / Output (I / O) interface 1205 is also connected to bus 1204.

[0153] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to I / O interface 1205 as needed. Removable media 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1210 as needed so that computer programs read from them can be installed into storage section 1208 as needed.

[0154] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by central processing unit (CPU) 1201, it performs various functions defined in the system of this application.

[0155] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0157] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0158] Another aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the game service request processing method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.

[0159] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the game service request processing method provided in the various embodiments described above.

[0160] The above description is merely a preferred exemplary embodiment of this application and is not intended to limit the implementation of this application. Those skilled in the art can easily make corresponding modifications or alterations based on the main concept and spirit of this application. Therefore, the scope of protection of this application should be determined by the scope of protection claimed in the claims.

[0161] It should also be noted that, in the specific embodiments of this application, the game service requests, standardized service interface parameters, response data and other related data involved need to obtain user permission or consent when the above embodiments of this application are applied to specific products or technologies, and the collection, use and processing of related data need to comply with the relevant laws, regulations and standards of relevant countries and regions.

Claims

1. A game service request processing method characterized by comprising: Applied to a game service system, the game service system includes a game runtime component, a third-party platform and a game server respectively communicatively connected to the game runtime component, the method being executed by the game runtime component, the method comprising: Obtain the configuration file corresponding to the standardized service interface sent by the component management terminal. The configuration file contains the interface parameters required to request the standardized service interface. Based on the interface parameters corresponding to the standardized service interface, an interface conversion rule is constructed to convert the standardized service interface to the existing service interface in the game server. Receive game service requests sent by the third-party platform; The standardized service interface parameters contained in the game service request are parsed, and the standardized service interface parameters are converted according to the interface conversion rules to obtain the target interface parameters adapted to the game server, so as to forward the target interface parameters to the game server. After receiving the response data returned by the game server for the target interface parameters, the response data is converted according to the interface conversion rules to obtain target response data adapted to the third-party platform. The target response data is forwarded to the third-party platform; The step of constructing interface conversion rules based on the interface parameters corresponding to the standardized service interface to convert the standardized service interface to existing service interfaces in the game server includes: Configure the interface protocol of the standardized service interface according to the interface parameters corresponding to the standardized service interface, and configure the interface protocol of the existing service interface in the game server. Each interface protocol contains a preset field conversion rule, and the field set contained in the interface protocol of the service interface is a superset of the field set contained in the interface protocol of the standardized service interface. Establish a mapping relationship between the interface protocol of the standardized service interface and the interface protocol of the service interface.

2. The method according to claim 1, characterized in that, The method further includes: During the configuration of each interface protocol, a mapping relationship between input fields and output fields is established, and the field types of the input fields and the field types of the output fields are configured to obtain the preset field conversion rules in each interface protocol.

3. The method according to claim 1, characterized in that, The method further includes: In the process of configuring each interface protocol, a structured object is configured and a property that supports recursive expansion is used to represent the structured object in order to obtain the preset field conversion rules in each interface protocol.

4. The method according to claim 1, characterized in that, The process involves parsing the standardized service interface parameters contained in the game service request and converting these parameters according to preset interface conversion rules to obtain target interface parameters adapted to the game server, including: The interface protocol of the standardized service interface is determined based on the standardized service interface parameters; Based on the mapping relationship between the interface protocol of the standardized service interface and the interface protocol of the existing service interface in the game server, the system jumps to execute the interface protocol of the target service interface in the game server. The standardized service interface parameters are converted according to the preset field conversion rules in the interface protocol of the target service interface to obtain target interface parameters adapted to the game server.

5. The method according to claim 4, characterized in that, The step of performing field conversion processing on the standardized service interface parameters according to the preset field conversion rules in the interface protocol of the target service interface to obtain target interface parameters adapted to the game server includes: A JSON path expression is generated based on the field conversion rules and the standardized service interface parameters. The JSON path expression contains the fields before and after conversion. Based on the JSON path expression, a get function is used to retrieve the value of the field before conversion, and a set function is used to retrieve the value of the field after conversion; The target interface parameters adapted to the game server are determined based on the values ​​of the converted fields.

6. The method according to claim 5, characterized in that, The step of determining the target interface parameters adapted to the game server based on the values ​​of the converted fields includes: Determine the field position and field length corresponding to the transformed field; Based on the field position and field length corresponding to the converted fields, target interface parameters adapted to the game server are generated.

7. A game service request processing device, characterized in that, An application is made in a game service system, the game service system including a game runtime component, a third-party platform and a game server respectively communicatively connected to the game runtime component, the device being configured on the game runtime component, the device comprising: The configuration file acquisition module is used to acquire the configuration file corresponding to the standardized service interface sent by the component management terminal. The configuration file contains the interface parameters required to request the standardized service interface. The rule building module is used to build interface conversion rules based on the interface parameters corresponding to the standardized service interface, which convert the standardized service interface to the existing service interface in the game server. The request receiving module is used to receive game service requests sent by the third-party platform. The first conversion processing module is used to parse the standardized service interface parameters contained in the game service request, and convert the standardized service interface parameters according to the interface conversion rules to obtain target interface parameters adapted to the game server, so as to forward the target interface parameters to the game server. The second conversion processing module is used to convert the response data returned by the game server for the target interface parameters according to the interface conversion rules after receiving the response data, so as to obtain target response data adapted to the third-party platform. The data forwarding module is used to forward the target response data to the third-party platform; The rule construction module is further configured as follows: Configure the interface protocol of the standardized service interface according to the interface parameters corresponding to the standardized service interface, and configure the interface protocol of the existing service interface in the game server. Each interface protocol contains a preset field conversion rule, and the field set contained in the interface protocol of the service interface is a superset of the field set contained in the interface protocol of the standardized service interface. Establish a mapping relationship between the interface protocol of the standardized service interface and the interface protocol of the service interface.

8. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the game service request processing method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, It stores computer-readable instructions that, when executed by the computer's processor, cause the computer to perform the game service request processing method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the game service request processing method as described in any one of claims 1 to 6.