A method and system for generating target data in a distributed manner

Through the method of distributed architecture and file fingerprint comparison, the problem of traditional guide tool taking too long to generate data in medium and large game projects is solved, and the target data generation time is significantly shortened and the development efficiency is improved.

CN114053720BActive Publication Date: 2025-04-25TUYOO GAMES +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111346051.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-15
Publication Date
2025-04-25
Estimated Expiration
2041-11-15

Smart Images

  • Figure CN114053720B_ABST
    Figure CN114053720B_ABST
Patent Text Reader

Abstract

The present application provides a method and system for generating target data in a distributed manner, in which a distributed server is used to share the task of generating target data, and a method of comparing file fingerprints is further used to incrementally generate target data, which greatly shortens the time consumption of generating data. After the target data is generated, the target data itself is not directly returned to the client, but is verified again on the client through a description information method, and the required target data is obtained only after the verification is passed. By means of incremental generation and file fingerprint comparison, unnecessary steps in the data generation process are greatly reduced, thereby reducing the time consumption in the generation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and system for generating target data in a distributed manner, a computing device, and a computer-readable storage medium. Background Art

[0002] In the current game development process, the format of configuration data such as game planning data is mainly tabular data, which is usually generated by planners through Excel. When using these configuration data in the game, the Excel table will not be read, but the corresponding target data and code will be generated through the table export tool for loading and use when the game is running. For medium and large game projects, as the project develops, the configuration data may be as high as tens of MB in the later stage of the project. It may take tens of seconds or even longer to completely generate the target data using the table export tool. For medium and large projects with a large number of R&D personnel, the time wasted using traditional table export tools to generate target data is very considerable. Summary of the invention

[0003] In view of this, embodiments of the present application provide a method and system for generating configuration data in a distributed manner, a computing device, and a computer-readable storage medium to address the technical deficiencies in the prior art.

[0004] According to a first aspect of an embodiment of the present application, a method for generating target data in a distributed manner is provided, characterized by comprising:

[0005] The client receives an instruction to generate target data, and obtains a file fingerprint of the configuration data according to an identifier of the configuration data included in the instruction;

[0006] The client evenly distributes the file fingerprint to multiple data generation requests according to the number of servers and submits them to multiple servers respectively;

[0007] The server searches the cache for the corresponding target data based on the received file fingerprint. If so, it returns the description information of the target data.

[0008] If the corresponding target data does not exist, the server further checks whether there is a file required to generate the target data in the cache. If so, the server generates the target data and description information of the target data; if not, the server obtains the file required to generate the target data from the client, and then generates the target data and description information of the target data;

[0009] The client receives the description information of the target data sent by the server and performs verification. If the verification condition is met, the target data is obtained according to the description information.

[0010] According to a second aspect of an embodiment of the present application, a method for generating target data in a distributed manner is provided, which is used for a client and implements corresponding functions on the client.

[0011] According to a third aspect of an embodiment of the present application, a method for generating target data in a distributed manner is provided, which is used for a server and implements corresponding functions on the server side.

[0012] According to a fourth aspect of an embodiment of the present application, a system for generating target data in a distributed manner is provided, comprising a client and a server, for executing the aforementioned method.

[0013] According to a fifth aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the method for distributed generation of target data when executing the instructions.

[0014] According to a sixth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the method for distributed generation of target data are implemented.

[0015] In the embodiment of the present application, firstly, multiple servers are set up through a distributed architecture, and multiple generation requests are evenly distributed to these servers; secondly, when generating target data, the server only regenerates the changed configuration data, and transforms the complete data generation method into incremental generation, which greatly shortens the generation time. At the same time, the client does not directly obtain all the generation results, but only obtains the generated file description information. By comparison, only the newly added or changed files are downloaded, which also greatly shortens the time to update the generation results. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a structural block diagram of a computing device provided in an embodiment of the present application;

[0017] Figure 2 is a flow chart of a method for generating target data in a distributed manner provided by an embodiment of the present application;

[0018] Figure 3 is a schematic diagram of a structure definition file for describing a configuration data structure provided by an embodiment of the present application;

[0019] Figure 4 is a flow chart of a method for distributed generation of target data on a client provided by an embodiment of the present application;

[0020] Figure 5 It is a flowchart of a method for distributed generation of target data on a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0022] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0023] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "in response to determination".

[0024] In the present application, a method and apparatus for generating target data in a distributed manner, a computing device, and a computer-readable storage medium are provided, which are described in detail one by one in the following embodiments.

[0025] Figure 1 The structure block diagram of a computing device 100 according to an embodiment of the present application is shown. The components of the computing device 100 include but are not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.

[0026] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0027] In one embodiment of the present application, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0028] The computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 100 may also be a mobile or stationary server.

[0029] The processor 120 may execute Figure 2 The steps in the method of distributed generation of target data are shown. Figure 2 A flowchart of a method for distributed generation of target data according to an embodiment of the present application is shown, including steps 202 to 210.

[0030] Step 202: The client receives an instruction to generate target data, and obtains a file fingerprint of the configuration data according to an identifier of the configuration data in the instruction;

[0031] In a specific implementation, after the planner updates the configuration data, an instruction to generate target data is issued, and the instruction includes the identifier of the configuration data that needs to be converted; the client obtains the file fingerprint of the configuration data based on these identifiers.

[0032] Furthermore, the above instruction includes identification of multiple or all configuration data, such as the name or ID of the configuration data. During the development process, planners will frequently modify multiple configuration data and check the running results of the modified data. Since the distributed method for generating target data provided by the embodiment of the present application greatly improves the speed of generating data, there is no need to worry about the problem of too long time spent on generating data. Therefore, the instruction can be issued for multiple or even all configuration data in the project, realizing the one-key generation function, which is convenient and friendly for planners to operate, and there is no need to pay attention to which configuration data has been modified.

[0033] In another specific implementation, in this step, in addition to obtaining the file fingerprint of the configuration data, the file fingerprint of the structure definition file corresponding to the configuration data is also obtained according to the identifier of the configuration data. The structure definition file is used to describe the data structure of the configuration data corresponding thereto, such as Figure 3 As shown, Figure 3 The bean structure in is used to describe the field type in the clothing table. In this embodiment, the structure in the configuration data is expressed by the above structure definition file, and the server needs to use the structure definition file to parse the configuration data when generating target data. That is, the configuration data and the structure definition file of the configuration data jointly determine the uniqueness of the generated target data.

[0034] Step 204: the client evenly distributes the file fingerprints to multiple data generation requests according to the number of servers and submits them to the multiple servers respectively;

[0035] In a specific implementation, the client splits the tasks in the instruction according to the number of servers. For example, there are 3 servers and there are 15 file fingerprints of configuration data in the client instruction; the client divides the above file fingerprints into 3 parts evenly and sends one part to each server through a data generation request. Those skilled in the art should know that the above examples are not exhaustive, and those skilled in the art can evenly distribute the tasks according to actual conditions. The distribution method is well known to those skilled in the art and will not be described in detail here.

[0036] In another specific implementation, the file fingerprint includes not only the file fingerprint of the configuration data, but also the file fingerprint of multiple structure definition files corresponding to the configuration data. When allocating tasks, the file fingerprint of the configuration data and the file fingerprint of the corresponding structure definition file are allocated to the same data generation request, and then sent to the same server.

[0037] Step 206: The server searches the cache for corresponding target data based on the received file fingerprint. If so, the server returns description information of the target data. If not, the server proceeds to step 208.

[0038] In a specific implementation, the server queries in its cache according to the file fingerprint of the received configuration data. If there is target data corresponding to the file fingerprint, it means that the server has already generated the target data for the configuration file and does not need to generate it again. The server directly returns the description information of the target data.

[0039] In another specific implementation, the server receives the file fingerprint of the configuration data and the file fingerprint of the corresponding structure definition file, and uses the two file fingerprints as query conditions to query in the cache. If there is target data corresponding to the file fingerprint, it means that the server has already generated the target data for the configuration file and the structure definition file, and there is no need to generate it again, and the description information of the target data is directly returned.

[0040] If the target data corresponding to the current file fingerprint does not exist in the server cache, the target data needs to be regenerated, and the process proceeds to step 208 .

[0041] Step 208: If the corresponding target data does not exist, the server further checks whether there is a file required to generate the target data in the cache. If so, the server generates the target data and description information; if not, the server obtains the file required to generate the target data from the client, and then generates the target data and description information.

[0042] In this step, when the target data is not found in the cache of the server, it means that the server needs to regenerate the corresponding target data.

[0043] In a specific implementation, the server further checks whether there is a file required to generate the target data in the cache, that is, the configuration file represented by the file fingerprint received by the server. If the configuration file exists in the cache, the server generates the target data and the description information of the target data according to the configuration file. If the configuration file does not exist in the cache, the server sends a data request to the client to obtain the configuration file, thereby generating the target data and the description information of the target data.

[0044] In another specific implementation, the server further checks whether there are files required to generate the target data in the cache, including the configuration file represented by the file fingerprint received by the server and the corresponding structure definition file. Since in this implementation, the target data is generated based on the configuration data and the structure definition file of the configuration data, the target data cannot be generated when one of the configuration data or the structure definition file is missing in the server's cache. If the configuration file exists in the cache and the corresponding structure definition file exists, the server generates the target data and the description information of the target data based on the two. If the configuration file and / or the corresponding structure definition file does not exist in the cache, the server sends a data request to the client to obtain the missing file, and then generates the target data and the description information of the target data.

[0045] Step 210: The client receives the description information of the target data sent by the server and performs verification. If the verification condition is met, the target data is obtained according to the description information.

[0046] In this step, after generating the target data and the corresponding description information, the server returns the description information to the client, and the client determines whether it needs to obtain the target data generated by the server based on the description information.

[0047] In a specific implementation, the description information includes a download path and a file fingerprint of the target data.

[0048] Further, after receiving the description information of the target data, the client determines whether the target data exists locally on the client, and if not, obtains the target data according to the download path in the description information;

[0049] If the target data exists locally on the client, the file fingerprints of the two are compared. If the file fingerprints are different, the target data is obtained according to the download path in the description information;

[0050] If the target data exists locally on the client and the file fingerprint is the same, the target data will not be downloaded.

[0051] For medium or large projects, the configuration data may be as large as tens or hundreds of MB, and it may take tens of seconds or even longer to completely generate the target data. Planners and program developers need to generate target data frequently to verify the effect of configuration changes, so shortening this generation time is very meaningful to improve development efficiency.

[0052] In the method provided by the above-mentioned embodiment of the present application, the task of generating target data is first shared by using a distributed server, and the target data is further incrementally generated by comparing file fingerprints, which greatly shortens the time consumption of generating data, because in most cases, only a few configuration data are actually changed, and it is not necessary to regenerate all configurations. After the target data is generated, the target data itself will not be returned directly to the client, but the client will be verified again by describing the information, and the required target data will be obtained after the verification is passed. By means of incremental generation and file fingerprint comparison, unnecessary steps in the data generation process are greatly reduced, and data generation is carried out in a targeted manner for the needs of planners and developers, which greatly reduces the time consumption in the generation process, improves the efficiency of development, and shortens the usual data generation time of medium and large projects by hundreds of ms. Moreover, for planners and developers, there is no need to select the modified configuration file for the generation process in order to save time, and the target data can be generated for all configuration files with one key, which is simple and convenient to operate.

[0053] The present application also provides a method for generating target data in a distributed manner, which is used for a client and includes steps 302-310:

[0054] Step 302: receiving an instruction for generating target data, and obtaining a file fingerprint of the configuration data according to an identifier of the configuration data in the instruction;

[0055] Step 304: according to the number of servers, evenly distribute the file fingerprints to multiple data generation requests and submit them to multiple servers respectively;

[0056] In another specific implementation, the file fingerprint includes not only the file fingerprint of the configuration data, but also the file fingerprint of multiple structure definition files corresponding to the configuration data. When allocating tasks, the file fingerprint of the configuration data and the file fingerprint of the corresponding structure definition file are allocated to the same data generation request, and then sent to the same server.

[0057] Step 306: receiving a request from the server for obtaining a file required for generating target data, and returning the file required for generating target data;

[0058] Step 308: receiving description information of the target data returned by the server;

[0059] Step 310: Verify the description information of the received target data, and if it meets the verification conditions, obtain the target data according to the description information.

[0060] The present application also provides a method for generating target data in a distributed manner, which is used for a server and includes steps 402-408:

[0061] Step 402: receiving a data generation request sent by a client, each data generation request including file fingerprints of multiple configuration data files;

[0062] In another specific implementation, the file fingerprint includes not only the file fingerprint of the configuration data, but also the file fingerprints of a plurality of structure definition files corresponding to the configuration data.

[0063] Step 404: the server searches the cache for corresponding target data according to the file fingerprint, and if so, returns description information of the target data;

[0064] Step 406: If the corresponding target data does not exist in the cache, the server further checks whether there is a file required to generate the target data in the cache. If so, the server generates the target data and description information of the target data; if not, the server obtains the file required to generate the target data from the client, and further generates the target data and description information of the target data;

[0065] Step 408: Return the description information of the target data to the client.

[0066] In a specific implementation, the server may be a locally deployed server or a remotely deployed server.

[0067] Corresponding to the above method embodiment, the present application also provides an embodiment of a system for generating target data in a distributed manner, including a client and a server. The client and the server execute the above method for generating target data in a distributed manner. The client and the server may be as follows: Figure 1 Computing device 100 is shown.

[0068] The above is a schematic scheme of a distributed system for generating target data in this embodiment. It should be noted that the technical scheme of the distributed system for generating target data and the technical scheme of the above-mentioned distributed method for generating target data belong to the same concept, and the details of the technical scheme of the distributed system for generating target data that are not described in detail can all be referred to the description of the technical scheme of the above-mentioned distributed method for generating target data.

[0069] In one embodiment of the present application, a computing device is also provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the method for distributed generation of target data when executing the instructions.

[0070] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned method for generating target data in a distributed manner belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned method for generating target data in a distributed manner.

[0071] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the method for distributed generation of target data as described above.

[0072] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned method for generating target data in a distributed manner belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned method for generating target data in a distributed manner.

[0073] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0074] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

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

[0076] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0077] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A method for generating target data in a distributed manner, characterized in that: include: The client receives an instruction to generate target data, and obtains a file fingerprint of the configuration data according to an identifier of the configuration data included in the instruction; The instruction to generate target data includes an instruction to generate target data for multiple or all configuration data; Acquiring the file fingerprint of the configuration data according to the identifier of the configuration data in the instruction further includes: acquiring the file fingerprint of a structure definition file of the configuration data according to the identifier of the configuration data, wherein the structure definition file is used to describe the data structure of the configuration data corresponding thereto; The client evenly distributes the file fingerprint to multiple data generation requests according to the number of servers and submits them to multiple servers respectively; The server searches the cache for the corresponding target data based on the received file fingerprint. If so, it returns the description information of the target data. If the corresponding target data does not exist, the server further checks whether there is a file required to generate the target data in the cache. If so, the server generates the target data and description information of the target data; if not, the server obtains the file required to generate the target data from the client, and then generates the target data and description information of the target data; The client receives the description information of the target data sent by the server and performs verification. If the verification condition is met, the target data is obtained according to the description information.

2. The method according to claim 1, wherein: The description information includes the generated download path and file fingerprint of the target data.

3. The method according to claim 2, wherein: The client verifies the description information of the received target data, and if the verification condition is met, obtaining the target data according to the description information includes: Determine whether the target data exists locally on the client. If not, obtain the target data according to the download path in the description information. If the target data exists locally on the client, but the file fingerprint is different, the target data is obtained according to the download path in the description information; If the target data exists locally on the client and the file fingerprint is the same, the target data will not be downloaded.

4. The method according to claim 1, wherein: The server searches the cache for corresponding target data according to the file fingerprint and further includes: According to the file fingerprint of the structure definition file and the file fingerprint of the corresponding configuration data, it is searched in the cache whether there is corresponding target data.

5. According to the method of claim 1, the files required for generating the target data include: Configuration data files and / or structure definition files. The method according to claim 1 , wherein the plurality of servers are local servers or remote servers.

7. A method for generating target data in a distributed manner, for use in a client, characterized in that: include: Receiving an instruction to generate target data, and obtaining a file fingerprint of the configuration data according to an identifier of the configuration data in the instruction; The instruction to generate target data includes an instruction to generate target data for multiple or all configuration data; Acquiring the file fingerprint of the configuration data according to the identifier of the configuration data in the instruction further includes: acquiring the file fingerprint of a structure definition file of the configuration data according to the identifier of the configuration data, wherein the structure definition file is used to describe the data structure of the configuration data corresponding thereto; According to the number of servers, the file fingerprints are evenly distributed to multiple data generation requests and submitted to multiple servers respectively; Receive a request from the server for obtaining a file required to generate target data, and return the file required to generate target data; Receive the description information of the target data returned by the server; The description information of the received target data is verified, and if the verification condition is met, the target data is obtained according to the description information.

8. A method for generating target data in a distributed manner, for use in a server, characterized in that: include: Receive a data generation request sent by a client, each data generation request includes file fingerprints of multiple or all configuration data files; the file fingerprint also includes a file fingerprint of a structure definition file of the configuration data, the structure definition file is used to describe the data structure of the configuration data corresponding thereto; The server searches the cache for corresponding target data based on the file fingerprint, and if so, returns description information of the target data; If the corresponding target data does not exist in the cache, the server further checks whether there is a file required to generate the target data in the cache. If so, the server generates the target data and description information of the target data; If it does not exist, the server obtains the files required to generate the target data from the client, and further generates the target data and description information of the target data; Returns description information of the target data to the client.

9. A system for generating target data in a distributed manner, comprising a client and a server, characterized in that The client and the server execute the method according to any one of claims 1-8.

10. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the instructions, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Method and device for downloading forms

    CN106534247A

  • Game resource checking method, device and system and storage medium

    CN109977022A

  • Data acquisition method and device, terminal and storage medium

    CN111651408A