Method and system for caching and reading SDK (Software Development Kit) access data

By using dictionaries and abstract classes to store SDK interface call order and callback data in game development, the platform restrictions and temporary code problems during SDK access are solved, and debugging efficiency and development progress are improved.

CN119025446APending Publication Date: 2024-11-26FUJIAN TQ DIGITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310582309.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-23
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In game development, due to platform restrictions during the SDK access process, a large amount of temporary code is needed to debug SDK functions, which affects work efficiency, and the game package is released for a long time, which affects the SDK access progress.

Method used

By defining a dictionary to store SDK interface names and types, abstract classes define virtual interface functions, run all SDKs to store interface call order and callback data, and read these data on the target platform, avoiding instantiating kernel functions on each platform.

Benefits of technology

It realizes the function of debugging SDK access and reading data on a designated platform, reducing the number of temporary codes, and improving the SDK access debugging progress and game development progress.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025446A_ABST
    Figure CN119025446A_ABST
Patent Text Reader

Abstract

The invention relates to an SDK (Software Development Kit) access data caching and reading method, which comprises the following steps of: defining a dictionary which comprises keys and values, taking an SDK interface name and an SDK type as the keys of the dictionary, and taking data returned by an SDK as the values of the dictionary; the interface of each SDK defines a virtual class on the basis of the abstract class; adding the dictionary into an interface function of a virtual class of the SDK; running all SDKs on a development platform on which any SDK can run, filling key values of the dictionary with data returned after running, and locally storing the dictionary according to execution time; all the SDKs run on the target development platform, if some SDKs cannot run, only the virtual-class interface functions of the SDKs are executed, and SDK interface calling time and names of the virtual-class interface functions are stored in the dictionary; the callback data stored locally is read one by one according to the dictionary, the data returned by the SDK can be stored locally in advance in the running process of the game package, the relevant functions of the SDK can be debugged on an actual development platform, and the working efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for SDK access data caching and reading. Background Art

[0002] A software development kit (SDK) is generally a collection of development tools used by software engineers to build application software for specific software packages, software frameworks, hardware platforms, operating systems, etc.

[0003] In game development, it is often necessary to connect to various types of SDKs. When connecting to the SDK, some SDK operating environments have platform restrictions (such as only being able to run on the Android platform). At this time, if you want to test the SDK access function and the function in the game that requires the data returned by the SDK, you need to publish the game to the Android platform. The game package is usually large, and it takes time to publish the package for the mobile platform. In addition, the debugging-related functions of the SDK require writing a large amount of temporary code, which will affect the debugging progress of related functions during the SDK access process and affect work efficiency. Summary of the invention

[0004] To overcome the above problems, the purpose of the present invention is to provide a method and system for SDK access data caching and reading, which can store the return data of SDK at different stages in advance during the operation of the game package, and can also debug SDK related functions on a specified development platform, with strong adaptability.

[0005] The present invention is implemented by the following scheme:

[0006] A method for SDK access data caching and reading, the method steps are as follows:

[0007] Step 1: Define a dictionary, which includes keys and values. The SDK interface name and SDK type are used as the dictionary keys, and the data returned by the SDK is used as the dictionary values. The data returned by the SDK includes callback events, callback functions, and SDK interface call time. The callback event mounts the callback function. When the callback event is executed, the callback data is obtained through the callback function. The callback event and callback data are class objects.

[0008] Step 2: Each SDK interface defines a virtual class based on the abstract class;

[0009] Step 3: Add the key-value pairs of the dictionary to the interface function of the virtual class of the SDK;

[0010] Step 4: Run all SDKs on a development platform where any SDK can run, obtain the execution time of all SDKs, and execute callback events. Then, store the SDK interface names and SDK types in the order of execution time. The SDK interface names and SDK types are used as dictionary keys, and the SDK interface call time, the name of the callback function, and the callback data are stored as dictionary values. The dictionary is then stored locally.

[0011] Step 5: All SDKs are run on the target development platform. If an SDK cannot be run, only the interface function of the virtual class of the SDK is executed, and the SDK interface call time and the name of the virtual class interface function are stored in the dictionary described in step 3;

[0012] Step 6: According to the SDK interface call time and the name of the interface function of the virtual class stored in the dictionary in step 5, read the callback data of the dictionary stored locally in sequence according to the SDK interface call time.

[0013] Furthermore, the virtual class in step 2 implements all functions of the SDK interface, and the functions do not execute the SDK's kernel instance functions.

[0014] Furthermore, the data returned by the SDK is the different data quantities and types returned in steps during the operation of SKD. The data returned by the SDK in each step is written as a data class. The data returned by the SDK in different steps is different. It is an abstract data class, and the data class is defined according to the data type actually returned by each SDK.

[0015] A system for SDK access data caching and reading, the system comprising a dictionary definition module, a virtual class definition module, a dictionary adding module, a pre-running module, a testing module, and a reading module;

[0016] The dictionary definition module is used to define a dictionary with an SDK interface name and an SDK type as a key and a callback event as a value. The callback event is a class object and has a callback function mounted thereon. When the callback event is executed, the data returned by the SDK is obtained through the callback function.

[0017] The virtual class definition module is used for defining virtual classes based on abstract classes in the interfaces of each SDK;

[0018] The dictionary adding module is used to add the key-value pairs of the dictionary to the interface function of the virtual class of the SDK;

[0019] The pre-run module is used to run all SDKs on a development platform where any SDK can run, obtain the execution time of all SDKs, and execute callback events. The SDK interface names and SDK types are directly stored in the order of execution time. The SDK interface names and SDK types are used as dictionary keys, and the SDK interface call time and the name of the callback function and callback data are stored as dictionary values, and the dictionary is stored locally;

[0020] The test module is used to run another development platform. If an SDK cannot be run, only the interface function of the virtual class of the SDK is executed, and the SDK interface call time and the name of the callback function are stored in the dictionary;

[0021] The reading module is used to read the data returned by the SDK stored in the pre-running module in sequence according to the SDK interface calling time and the name of the callback function stored in the dictionary in the testing module and according to the SDK interface calling time.

[0022] Furthermore, the virtual class in the virtual class definition module implements all functions of the SDK interface, and the functions do not execute the SDK's kernel instance functions.

[0023] Furthermore, the data returned by the SDK is the different data quantities and types returned in steps during the operation of SKD. The data returned by the SDK in each step is written as a data class. The data returned by the SDK in different steps is different. It is an abstract data class, and the data class is defined according to the data type actually returned by each SDK.

[0024] The beneficial effects of the present invention are:

[0025] The present invention provides a method and system for caching and reading SDK access data. The method is based on the SDK obtaining the interface calling sequence and callback function and the data returned by the SDK on the designated running platform and storing them in the local file. Only a small number of packages need to be released to the designated platform, so that the SDK data in the SDK access process and the functions of the system that reads the SDK data in the game can be debugged on the development platform to see whether they are correct. At the same time, there is no need to write a large amount of temporary code to debug related functions, which improves the SDK access debugging progress, avoids game bugs caused by a large number of temporary codes not being completely deleted, and improves the overall progress of game development. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 is a flow chart of the method of the present invention;

[0027] Figure 2 It is a structural block diagram of the system of the present invention. DETAILED DESCRIPTION

[0028] The present invention will be further described below in conjunction with the accompanying drawings.

[0029] See also Figure 1 , a method for SDK access data caching and reading, the method steps are as follows:

[0030] Step 1: Define a dictionary, which includes keys and values. The SDK interface name and SDK type are used as the dictionary keys, and the data returned by the SDK is used as the dictionary values. The data returned by the SDK includes callback events, callback functions, and SDK interface call time. The callback event is a class object and mounts a callback function. When the callback event is executed, the callback data is obtained through the callback function.

[0031] Step 2: Each SDK interface defines a virtual class based on the abstract class;

[0032] Step 3: Add the key-value pairs of the dictionary to the interface function of the virtual class of the SDK;

[0033] Step 4: Run all SDKs on a development platform where any SDK can run, obtain the execution time of all SDKs, and execute callback events. Then, store the SDK interface names and SDK types in the order of execution time. The SDK interface names and SDK types are used as dictionary keys, and the SDK interface call time, the name of the callback function, and the callback data are stored as dictionary values. The dictionary is then stored locally.

[0034] Step 5: All SDKs are run on the target development platform. If an SDK cannot be run, only the interface function of the virtual class of the SDK is executed, and the SDK interface call time and the name of the virtual class interface function are stored in the dictionary described in step 3;

[0035] Step 6: According to the SDK interface call time and the name of the interface function of the virtual class stored in the dictionary in step 5, read the callback data of the dictionary stored locally in sequence according to the SDK interface call time.

[0036] The present invention will be further described below in conjunction with a specific embodiment:

[0037] A method for SDK access data caching and reading, the method steps are as follows:

[0038] Step 1: Define a dictionary, which includes keys and values. The SDK interface name and SDK type are used as the dictionary keys, and the data returned by the SDK is used as the dictionary values. The data returned by the SDK includes callback events, callback functions, and SDK interface call time. The callback event mounts the callback function. When the callback event is executed, the callback data is obtained through the callback function. The callback event and callback data are class objects.

[0039] The data returned by the SDK is the different data quantities and types returned in steps during the SKD operation process. The data returned by the SDK in each step is written as a data class. The data returned by the SDK in different steps is different. It is an abstract data class, and the data class is defined according to the data type actually returned by each SDK.

[0040] Step 2: Each SDK interface defines a virtual class based on the abstract class;

[0041] A virtual class is defined based on the interface class of each SDK, and the virtual class implements all functions of the SDK interface class, and all functions do not execute the SDK kernel instance function, and the above dictionary stores the SDK interface call time and the name of the callback function;

[0042] Step 3: Add the key-value pairs of the dictionary to the interface function of the virtual class of the SDK;

[0043] Step 4: Run all SDKs on a development platform where any SDK can run, obtain the execution time of all SDKs, and execute callback events. Then, store the SDK interface names and SDK types in the order of execution time. The SDK interface names and SDK types are used as dictionary keys, and the SDK interface call time, the name of the callback function, and the callback data are stored as dictionary values. The dictionary is then stored locally.

[0044] Step 5: All SDKs are running on the target development platform. If an SDK cannot run, only the interface function of the SDK's virtual class is executed.

[0045] The SDK does not instantiate its kernel implementation functions on the development platform, and defines the macros of the development platform not to execute the kernel instance functions.

[0046] Then the SDK interface call time and the name of the virtual class interface function are stored in the dictionary described in step 3;

[0047] Step 6: According to the SDK interface call time and the name of the virtual class interface function stored in the dictionary in step 5,

[0048] The SDK interface calls the callback data of the dictionary stored locally in sequence.

[0049] See also Figure 2 , a system for SDK access data caching and reading, the system comprising a dictionary definition module, a virtual class definition module, a dictionary adding module, a pre-running module, a testing module, and a reading module;

[0050] The dictionary definition module is used to define a dictionary with an SDK interface name and an SDK type as a key and a callback event as a value. The callback event is a class object and has a callback function mounted thereon. When the callback event is executed, the data returned by the SDK is obtained through the callback function.

[0051] The virtual class definition module is used for defining virtual classes based on abstract classes in the interfaces of each SDK;

[0052] The dictionary adding module is used to add the key-value pairs of the dictionary to the interface function of the virtual class of the SDK;

[0053] The pre-run module is used to run all SDKs on a development platform where any SDK can run, obtain the execution time of all SDKs, and execute callback events. The SDK interface names and SDK types are directly stored in the order of execution time. The SDK interface names and SDK types are used as dictionary keys, and the SDK interface call time and the name of the callback function and callback data are stored as dictionary values, and the dictionary is stored locally;

[0054] The test module is used to run another development platform. If an SDK cannot be run, only the interface function of the virtual class of the SDK is executed, and the SDK interface call time and the name of the callback function are stored in the dictionary;

[0055] The reading module is used to read the data returned by the SDK stored in the pre-running module in sequence according to the SDK interface calling time and the name of the callback function stored in the dictionary in the testing module and according to the SDK interface calling time.

[0056] In one embodiment of the present invention, the virtual class in the virtual class definition module implements all functions of the SDK interface, and the functions do not execute the SDK's kernel instance functions.

[0057] In one embodiment of the present invention, the data returned by the SDK is the different data quantities and types returned in steps during the operation of the SKD. The data returned by the SDK in each step is written as a data class. The data returned by the SDK in different steps is different. It is an abstract data class, and the data class is defined according to the data type actually returned by each SDK.

[0058] In summary, the present invention provides a method and system for SDK access data caching and reading, based on the SDK obtaining the interface calling sequence and callback function and the data returned by the SDK on the specified running platform, and storing them in local files. Only a small number of packages need to be released to the specified platform, so that the SDK data in the SDK access process and the functions of the system that reads the SDK data in the game can be debugged on the development platform to see whether they are correct. At the same time, there is no need to write a large amount of temporary code to debug related functions, which improves the SDK access debugging progress, avoids game bugs caused by a large number of temporary codes that are not completely deleted, and improves the overall progress of game development.

[0059] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.

Claims

1. A method for SDK access data caching and reading, characterized in that: The method steps are as follows: Step 1: Define a dictionary, which includes keys and values. The SDK interface name and SDK type are used as the dictionary keys, and the data returned by the SDK is used as the dictionary values. The data returned by the SDK includes callback events, callback functions, and SDK interface call time. The callback event mounts the callback function. When the callback event is executed, the callback data is obtained through the callback function. The callback event and callback data are class objects. Step 2: Each SDK interface defines a virtual class based on the abstract class; Step 3: Add the key-value pairs of the dictionary to the interface function of the virtual class of the SDK; Step 4: Run all SDKs on a development platform where any SDK can run, obtain the execution time of all SDKs, and execute callback events. Then, store the SDK interface names and SDK types in the order of execution time. The SDK interface names and SDK types are used as dictionary keys, and the SDK interface call time, the name of the callback function, and the callback data are stored as dictionary values. The dictionary is then stored locally. Step 5: All SDKs are run on the target development platform. If an SDK cannot be run, only the interface function of the virtual class of the SDK is executed, and the SDK interface call time and the name of the virtual class interface function are stored in the dictionary described in step 3; Step 6: According to the SDK interface call time and the name of the interface function of the virtual class stored in the dictionary in step 5, read the callback data of the dictionary stored locally in sequence according to the SDK interface call time.

2. A method for SDK access data caching and reading according to claim 1, characterized in that: The virtual class in step 2 implements all functions of the SDK interface, and the functions do not execute the SDK's kernel instance functions.

3. A method for SDK access data caching and reading according to claim 1, characterized in that: The data returned by the SDK is the different data quantities and types returned in steps during the SKD operation process. The data returned by the SDK in each step is written as a data class. The data returned by the SDK in different steps is different. It is an abstract data class, and the data class is defined according to the data type actually returned by each SDK.

4. A system for SDK access data caching and reading, characterized in that: The system includes a dictionary definition module, a virtual class definition module, a dictionary addition module, a pre-operation module, a test module, and a reading module; The dictionary definition module is used to define a dictionary with SDK interface name and SDK type as keys and callback events as values. The callback event is a class object and has a callback function mounted thereon. When the callback event is executed, the data returned by the SDK is obtained through the callback function. The virtual class definition module is used for defining virtual classes based on abstract classes in the interfaces of each SDK; The dictionary adding module is used to add the key-value pairs of the dictionary to the interface function of the virtual class of the SDK; The pre-run module is used to run all SDKs on a development platform where any SDK can run. Get the execution time of all SDKs. When the callback event is executed, store the SDK interface name and SDK type in the order of execution time. The SDK interface name and SDK type are used as dictionary keys. The SDK interface call time and the name and callback data of the callback function are stored as dictionary values. The dictionary is then stored locally. The test module is used to run another development platform. If an SDK cannot be run, only the interface function of the virtual class of the SDK is executed, and the SDK interface call time and the name of the callback function are stored in the dictionary; The reading module is used to read the data returned by the SDK stored in the pre-running module in sequence according to the SDK interface calling time and the name of the callback function stored in the dictionary in the testing module and according to the SDK interface calling time.

5. A system for caching and reading SDK access data according to claim 4, characterized in that: The virtual class in the virtual class definition module implements all functions of the SDK interface, and the function does not execute the SDK's kernel instance function.

6. A system for caching and reading SDK access data according to claim 4, characterized in that: The data returned by the SDK is the different data quantities and types returned in steps during the SKD operation process. The data returned by the SDK in each step is written as a data class. The data returned by the SDK in different steps is different. It is an abstract data class, and the data class is defined according to the data type actually returned by each SDK.