A method, apparatus, computer device, and storage medium for implementing application functions.

By obtaining resource indexes and generating target object templates in the terminal, the convenience issue of updating application functions in the terminal is solved, realizing dynamic function updates without downloading new SDK packages, and improving the convenience and efficiency of application function implementation.

CN114610343BActive Publication Date: 2025-10-31TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011322412.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-23
Publication Date
2025-10-31
Estimated Expiration
2040-11-23

AI Technical Summary

Technical Problem

In existing technologies, updating application functions on a terminal requires recompiling and repackaging a new version of the SDK package, which increases the burden on the terminal and reduces the ease of implementing application functions.

Method used

By obtaining the resource index of the target function in the application, the software development kit client is triggered to obtain the resource file, dynamically generate the target object template of the target function, and call the function template to implement the target function, thus avoiding the need to download a new version of the SDK installation package for updates.

Benefits of technology

It reduces the amount of installation package data downloaded and the amount of interaction, lowers bandwidth resource consumption, and improves the convenience and dynamism of application function implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610343B_ABST
    Figure CN114610343B_ABST
Patent Text Reader

Abstract

This application discloses an application function implementation method, apparatus, computer device, and storage medium. This application embodiment can obtain a resource index of a target function in an application; trigger the application's software development kit (SDK) client to obtain a resource file corresponding to the resource index; when the application calls the target function, trigger the SSD client to generate a target object template for the target function based on the resource file; and call the function template in the target object template through the SSD client, so that the application implements the target function. This improves the convenience of application function implementation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, specifically to an application function implementation method, apparatus, computer equipment, and storage medium. Background Technology

[0002] Some applications (apps) installed on a terminal typically integrate a Software Development Kit (SDK) to implement certain functions. When a new feature is released for the application, the new feature can be implemented by updating the SDK.

[0003] Currently, when a terminal needs to update application functionality, a new static library must be compiled for the application to use. This means that each update requires providing a new version of the SDK package and notifying the terminal to update. Furthermore, third-party SDKs are typically managed by an intermediary platform (CocoaPods). The SDK stores the addresses of SDK packages corresponding to various version numbers in CocoaPods. After obtaining SDK authorization, the application on the terminal provides the SDK version number and address to CocoaPods to download the SDK package for updating. At this point, the terminal needs to recompile and repackage the new version of the SDK package. By running this updated version, the SDK functionality is updated so that the application can implement the new feature. Because updating the SDK requires not only modifying the SDK version but also repackaging the static library, it increases the burden on the terminal for implementing application functionality and reduces the ease of application implementation. Summary of the Invention

[0004] This application provides an application function implementation method, apparatus, computer device, and storage medium, which can improve the convenience of implementing application functions.

[0005] To address the aforementioned technical problems, this application provides the following technical solutions:

[0006] This application provides a method for implementing application functions, including:

[0007] Retrieve the resource index of the target function in the application;

[0008] The application's software development kit client is triggered to obtain the resource file corresponding to the resource index;

[0009] When the application calls the target function, it triggers the software development kit client to generate a target object template for the target function based on the resource file;

[0010] The application implements the target function by calling the function template in the target object template through the software development kit client.

[0011] According to one aspect of this application, an application function implementation apparatus is also provided, comprising:

[0012] The index retrieval unit is used to retrieve the resource index of the target function in the application.

[0013] The file acquisition unit is used to trigger the application's software development kit client to acquire the resource file corresponding to the resource index;

[0014] The generation unit is used to trigger the software development kit client to generate a target object template for the target function based on the resource file when the application calls the target function;

[0015] The calling unit is used to call the function template in the target object template through the software development kit client, so that the application can implement the target function.

[0016] According to one aspect of this application, a computer device is also provided, including a processor and a memory, wherein the memory stores a computer program, and the processor executes any of the application function implementation methods provided in the embodiments of this application when it invokes the computer program in the memory.

[0017] According to one aspect of this application, a storage medium is also provided for storing a computer program, which is loaded by a processor to execute any of the application function implementation methods provided in the embodiments of this application.

[0018] This application embodiment can obtain the resource index of the target function in the application, trigger the application's software development kit (SDK) client to obtain the resource file corresponding to the resource index. Then, when the application calls the target function, the SSD client is triggered to generate a target object template for the target function based on the resource file. At this time, the function template in the target object template can be called by the SSD client to enable the application to implement the target function. This solution can dynamically generate the target object template for the target function through the resource file corresponding to the target function that needs to be updated in the application, and call the function template in the target object template to implement the target function, without needing to download and update the new version of the SDK installation package. This reduces the amount of installation package data download or interaction, as well as bandwidth resources, and increases the dynamism of the application in implementing the target function, thereby improving the convenience of application function implementation. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of a scenario for the application function implementation system provided in the embodiments of this application;

[0021] Figure 2 This is a flowchart illustrating the application function implementation method provided in the embodiments of this application;

[0022] Figure 3 This is a schematic diagram of the terminal and server connection provided in an embodiment of this application;

[0023] Figure 4 This is another flowchart illustrating the application function implementation method provided in the embodiments of this application;

[0024] Figure 5 This is a schematic diagram of the application function implementation device provided in the embodiments of this application;

[0025] Figure 6 This is a schematic diagram of the terminal structure provided in the embodiments of this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] This application provides an application function implementation method, apparatus, computer device, and storage medium.

[0028] Please see Figure 1 , Figure 1This is a schematic diagram of an application function implementation system provided in this application embodiment. The system may include an application function implementation device, which can be integrated into a terminal 10. The terminal 10 may be a mobile phone, tablet, laptop, desktop computer, home appliance, or wearable device, etc. The terminal 10 and server 20 can be directly or indirectly connected via wired or wireless communication, which is not limited herein. The server 20 may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing 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, content delivery networks (CDNs), and big data and artificial intelligence platforms, but is not limited to these.

[0029] In short, a database can be viewed as an electronic filing cabinet—a place to store electronic files, where users can add, query, update, and delete data. A "database" is a collection of data stored together in a certain way, shared by multiple users, with minimal redundancy, and independent of application programs.

[0030] Cloud computing is a computing model that distributes computing tasks across a large pool of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, resources in the "cloud" appear infinitely scalable, readily available, on-demand, and expandable, with payment based on usage.

[0031] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network to work together through application software or application interfaces to provide data storage and business access functions to the outside world.

[0032] Terminal 10 can receive function update information sent by server 20 and extract the resource index of the target function that the application needs to update from the function update information. Then, terminal 10 can send a resource acquisition request carrying the resource index to server 20. Server 20 can query resource files in the database based on the resource index and send the queried resource files to terminal 10. When the application running on terminal 10 needs to call the target function, terminal 10 can parse the resource file and generate a target object template of the target function based on the parsed resource information. The application can then call the function template in the target object template through a preset calling interface, thereby enabling the application to implement the target function and improving the convenience of application function implementation.

[0033] It should be noted that, Figure 1 The schematic diagram of the application function implementation system shown is merely an example. The application function implementation system and scenario described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of the application function implementation system and the emergence of new business scenarios, the technical solutions provided in this application embodiment are also applicable to technical problems similar to object templates.

[0034] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0035] In this embodiment, the description will be from the perspective of the application function implementation device, which can be integrated into the terminal.

[0036] Please see Figure 2 , Figure 2 This is a flowchart illustrating an application function implementation method according to an embodiment of this application. The application function implementation method may include:

[0037] S101. Obtain the resource index of the target function in the application.

[0038] The application can be an audio / video player, search engine, instant messaging, or payment application installed on the terminal. The target function can include sharing, login, payment, scanning, and location functions. The resource index can include a Uniform Resource Locator (URL) or resource address. The resource can include video, image, or text. Of course, the application, target function, resource, and resource index can be flexibly set according to actual needs, and the specific content is not limited here.

[0039] The terminal can obtain the resource index of the target function that needs to be updated when the application's function needs to be updated, or it can obtain the resource index of the target function that needs to be updated periodically, or it can obtain the resource index of the target function that needs to be updated when it receives an update trigger command; and so on.

[0040] In one embodiment, obtaining the resource index of a target function in an application may include: obtaining function update information of the application; and extracting the resource index of the target function in the application that needs to be updated from the function update information.

[0041] To improve the accuracy of resource index retrieval, it can be based on feature update information. For example, a terminal can receive feature update information for an application pushed by a server. This update information may include the application identifier, SKD identifier (e.g., version number), and resource indexes. The type or specific content of the feature update information can be flexibly set according to actual needs. In this case, the resource indexes of the target features that need to be updated in the application can be extracted from the feature update information.

[0042] In one embodiment, before obtaining application function update information, the application function implementation method may further include: sending a registration request to a server through the application, the registration request carrying application information of the application; and receiving registration completion information returned by the server, the registration completion information including an application identifier. Obtaining application function update information may include: receiving application function update information pushed by the server based on the application identifier.

[0043] To improve the flexibility and reliability of obtaining feature update information, terminals can register their applications on the service and then receive precise feature update information pushed by the server based on the application identifier. Specifically, the application can send a registration request to the server, which may include the application's information, as well as other information. This application information may include the application name, provisioning profile, and application certificate (SecureSocket Layer, SSL). The provisioning profile may record the application's name, version, or copyright information in array, text, or other formats.

[0044] This allows the server to authenticate the application based on the received application information, determining whether the application has been registered repeatedly or violated regulations. Upon successful authentication, the server can return registration completion information containing an application identifier (which can be called a token) to the terminal, enabling the terminal to subsequently request data from the server based on the token. At this point, the terminal can return registration completion information containing the application identifier, which uniquely identifies the application. This identifier can be the application name or application number, and can consist of one or more of numbers, letters, symbols, or characters; specific elements are not limited here.

[0045] During the process of obtaining application feature update information, the terminal can receive application feature update information pushed by the server based on the application identifier. For example, if an application has an SDK with only QR code scanning functionality, and the upgraded version adds the ability to scan and recognize bank card numbers, the SDK can be upgraded, thus allowing the terminal to receive application feature update information pushed by the server. As another example, when an application's SDK has vulnerabilities and needs to be modified, the terminal can also receive application feature update information pushed by the server.

[0046] It should be noted that, in order to facilitate users' awareness of application feature updates, the terminal can display the update information in the notification bar or application message notification interface after receiving the update information, so that users can view it.

[0047] S102, Trigger the application's software development kit client to obtain the resource file corresponding to the resource index.

[0048] To facilitate future updates to the application's functionality, resource files corresponding to the resource index can be retrieved. For example, resource files can be obtained from the terminal's local file storage, or they can be downloaded from a server.

[0049] In one embodiment, obtaining the resource file corresponding to the resource index may include: querying the local file storage space for the resource file corresponding to the resource index; and when the file storage space contains the resource file, obtaining the resource file from the file storage space.

[0050] To facilitate the use of resource files, they can be stored in the terminal's local file storage space. When retrieving the resource file corresponding to the resource index, the local file storage space is first queried to determine if the resource file corresponding to the resource index is stored there. If the resource file is found in the file storage space, it means that the terminal has already downloaded the resource file from the server and stored it in its file storage space. At this point, the resource file corresponding to the resource index can be retrieved from the file storage space.

[0051] In one embodiment, after querying the resource file corresponding to the resource index from the local file storage space, the application function implementation method may further include: when no resource file is found to be stored in the file storage space, sending a resource retrieval request carrying the resource index to the server; and receiving the resource file corresponding to the resource index returned by the server based on the resource retrieval request.

[0052] For example, if the resource file is not found in the file storage space, it indicates that the terminal may be using the resource file for the first time and therefore has not downloaded it from the server beforehand. In this case, a resource retrieval request carrying the resource index can be sent to the server. This request can also include information such as a token and SDK version, allowing the server to retrieve the resource file from a pre-defined database based on the resource index and send it to the terminal. The terminal can then receive the resource file corresponding to the resource index returned by the server based on the resource retrieval request and store it in its local file storage space.

[0053] In one embodiment, sending a resource acquisition request carrying a resource index to the server may include: extracting the software development kit (SDK) identifier from the feature update information and sending the feature update information to the SSD client corresponding to the SSD identifier; triggering the SSD client to send a resource acquisition request carrying a resource index to the server.

[0054] To improve the accuracy of resource acquisition request sending and thus the accuracy of resource file acquisition, the SDK identifier can be extracted from the feature update information to identify the SDK client on the terminal corresponding to the SDK identifier. Then, the feature update information can be sent to the SDK client corresponding to the SDK identifier, triggering the SDK client to send a resource acquisition request carrying the resource index to the server and receive the resource file corresponding to the resource index returned by the server.

[0055] S103. When the application calls the target function, the software development kit client is triggered to generate the target object template of the target function based on the resource file.

[0056] During application runtime, it can invoke target functions based on actual usage needs. When the application invokes a target function, it triggers the SDK client to generate a target object template corresponding to the target function based on resource files. This target object template can be a target class, which can be the basis for information encapsulation in Object-Oriented Programming (OOP). The class can contain data descriptions for performing a certain function and a set of functions for manipulating data or passing messages. The class internally encapsulates attributes and methods. The target object template can include one or more function templates, which can be methods in a class. A method can be an ordered combination of steps to perform a function. This method can be created in the program and referenced elsewhere, such as being invoked during application runtime.

[0057] In one embodiment, when an application calls a target function, triggering the software development kit (SDK) client to generate a target object template for the target function based on a resource file may include: when the application calls the target function, triggering the SSD client to parse the resource file based on a predetermined data format to obtain parsed resource information; and generating a target object template for the target function based on the parsed resource information.

[0058] To improve the convenience and reliability of target object template generation, the target object template can be generated by parsing the resource information obtained from the resource file. Specifically, when the application calls the target function, the SDK client can be triggered to parse the resource file based on a predetermined data format to obtain the parsed resource information. This predetermined data format can be flexibly set according to actual needs; for example, the resource file can be parsed based on JSON format, HTML format, or XML format, etc. The parsed resource information can include at least object template information, variables, attributes, and protocol information, at which point the target object template for the target function can be generated based on the parsed resource information.

[0059] In one embodiment, generating a target object template for a target function based on parsed resource information may include: generating an application programming interface (API) based on object template information, variables, attributes, and protocol information; and generating the target object template for the target function by invoking an object template generation strategy based on the API.

[0060] To improve the accuracy of target object template generation, information such as object templates, variables, attributes, and protocol information obtained from parsing resource files can be used to generate an Application Programming Interface (API) through scripting languages ​​like JavaScript and method scrambling. The API is then used to call object template generation strategies (such as class generation methods) to generate the target object template for the desired functionality. Method scrambling can be a syntax feature used in iOS development, allowing iOS programs to perform method replacements or modifications during runtime.

[0061] In one embodiment, triggering the software development kit client to parse the resource file based on a predetermined data format to obtain the parsed resource information may include: when it is detected that the resource file has not been downloaded successfully, determining the node where the download of the resource file was interrupted; downloading the undownloaded portion of the resource file based on the node where the download was interrupted; and triggering the software development kit client to parse the downloaded resource file based on a predetermined data format to obtain the parsed resource information.

[0062] To improve the reliability and accuracy of target object template generation, before using resource files, it's possible to check if the resource files were downloaded successfully (e.g., checking if the version number of the corresponding function is the latest), i.e., checking if the resource files are complete. For example, if the SDK updates too much content or the network is poor, download failures may occur, potentially leading to resource file download failures. When a resource file download failure is detected, a new resource retrieval request can be sent to the server to re-download the resource file. Alternatively, when a resource file download failure is detected, the node where the download was interrupted can be identified, and the undownloaded portion of the resource file can be downloaded based on that node to achieve resume functionality. In this case, it's not necessary to re-download the entire resource file, saving download resources and improving download efficiency. After obtaining the resource files, the SDK client can be triggered to parse the downloaded resource files based on a predetermined data format to obtain the parsed resource information.

[0063] S104. Call the function template in the target object template through the software development kit client so that the application can implement the target function.

[0064] After generating the target object template for the desired function, the SDK client can call the function template within the target object template to enable the application to implement the target function. For example, in the social sharing SDK, iOS 14 users need to agree to privacy permissions to continue using the service. Updating this function only requires configuring resource files in the SDK to generate the target object template for the application to call, without needing to update the SDK version. This means that the application's functionality can be updated without repackaging the static library, reducing the communication and integration costs of SDK updates and increasing dynamism.

[0065] In one embodiment, calling a function template in a target object template through a software development kit client to enable an application to perform a target function may include: responding to a trigger operation on the application; determining a function identifier based on the trigger operation; determining a function template in the target object template from a pre-stored mapping relationship based on the function identifier, wherein the mapping relationship is a mapping relationship between function templates and function identifiers in the target object template; and calling the function template in the target object template to enable the application to perform the target function.

[0066] To enhance the flexibility and convenience of triggering applications to achieve target functions, after launching an application, the terminal can receive user-input trigger operations within the application's display interface. These trigger operations can include clicks or swipes, and can be for a specific function of the application, such as clicking the scan function. The terminal can respond to the application's trigger operation, determine a function identifier based on the trigger operation, and then, according to the function identifier, determine the function template within the target object template from the pre-stored mapping relationship between function templates and function identifiers. At this point, the function template within the target object template can be invoked, enabling the application to achieve the target function.

[0067] In one embodiment, before determining the function template in the target object template from the pre-stored mapping relationship based on the function identifier, the application function implementation method may further include: extracting each function template in the target object template and setting a function identifier for each function template; establishing a mapping relationship between each function template and the function identifier; and storing the mapping relationship between each function template and the function identifier.

[0068] To improve the ease of accessing functional templates within a target object template, a mapping relationship between functional templates and functional identifiers can be pre-established and stored. For example, after generating the target object template, each functional template can be extracted, and a functional identifier can be assigned to each template. This identifier serves as a unique identification method and can be a functional name or functional number, composed of one or more of numbers, letters, symbols, or text—the specific composition is not limited here. Then, a mapping relationship between each functional template and its identifier can be established and stored. For instance, this mapping relationship can be stored in a container or a pre-defined storage space so that functional templates within the target object template can be located later based on this mapping relationship.

[0069] In one embodiment, calling a function template in the target object template may include: initializing the software development kit corresponding to the application based on the application's application identifier, and setting calling parameters for the software development kit; generating a preset calling interface based on the calling parameters; and calling the function template in the target object template through the preset calling interface.

[0070] To improve the convenience and accuracy of calling function templates within the target object template, pre-defined calling interfaces can be used. For example, the application's application identifier can be obtained, and based on this identifier, the corresponding SDK can be initialized. During SDK initialization, calling parameters can be set for the SDK, and a pre-defined calling interface can be generated based on these parameters. Then, the function templates within the target object template can be called through this pre-defined calling interface. For instance, if a resource file adds the function of recognizing bank card numbers to a QR code scanner, a function template for this function can be created at runtime based on the resource file using Method swizzling. This dynamically created function template can then be called through the pre-defined calling interface, thus enabling the QR code scanner to recognize bank card numbers.

[0071] This application embodiment can obtain the resource index of the target function in the application, trigger the application's software development kit (SDK) client to obtain the resource file corresponding to the resource index. Then, when the application calls the target function, the SSD client is triggered to generate a target object template for the target function based on the resource file. At this time, the function template in the target object template can be called by the SSD client to enable the application to implement the target function. This solution can dynamically generate the target object template for the target function through the resource file corresponding to the target function that needs to be updated in the application, and call the function template in the target object template to implement the target function, without needing to download and update the new version of the SDK installation package. This reduces the amount of installation package data download or interaction, as well as bandwidth resources, and increases the dynamism of the application in implementing the target function, thereby improving the convenience of application function implementation.

[0072] Based on the functional template described in the above embodiments, the following examples will provide further detailed explanations.

[0073] This embodiment takes the integration of application function implementation devices into a terminal as an example, and describes in detail the methods within the object template and function template classes. The terminal may include applications and SDK clients, and can interact with a server. Taking a cluster server as an example, the cluster server may include a push notification server (e.g., Apple Push Notification service (APNS)), application servers, and SDK servers. For example, Figure 3 As shown, the application can connect to the SDK client, the push notification server, and the application server. The SDK client can connect to the SDK server, and the push notification server can connect to both the SDK server and the application server. The push notification server can be used for message pushing and application registration, while the application server can be used for storing and processing application-related data. The SDK server can be used for storing and updating SDK-related data.

[0074] Please see Figure 4 , Figure 4 This is a flowchart illustrating the application function implementation method provided in this application embodiment. The method flow may include:

[0075] S201, The application sends application information to the push notification server.

[0076] For example, an application can send a registration request carrying application information to a push notification server. This application information may include the application name, description file, and application certificate (SSL certificate).

[0077] S202. The message push server performs internal authentication of the application based on the application information.

[0078] S203. After authentication is completed, the push notification server sends an application identifier token to the application.

[0079] After successful authentication, the push notification server can return registration completion information containing the application identifier (i.e., token0) to the application.

[0080] S204. The application sends the token to the application server and SDK client, etc., and the SDK client sends the token to the SDK server.

[0081] S205, the SDK client initializes the SDK based on the token and generates a preset call interface.

[0082] For example, an SDK client can initialize the SDK corresponding to the application based on the application's application identifier token, and set calling parameters for the SDK during initialization. Based on the calling parameters, a preset calling interface can be generated. The parameters passed to the preset calling interface can include JSON data, so that methods in the target class can be called through the preset calling interface later.

[0083] S206, The SDK server stores information using tokens as the dimension.

[0084] The information stored on the SDK server may include SDK information, such as SDK version number, access time, and usage duration.

[0085] S207. When the SDK is updated, the SDK server stores the function update information.

[0086] This feature update information may include application identifiers, SDK identifiers, resource indexes, text information, and video materials. The SDK server can store the feature update information in a database and send it to a push notification server.

[0087] S208, the SDK server sends an update command carrying function update information to the message push server.

[0088] Update commands can be used to instruct push notification servers to push feature update information to applications.

[0089] S209. The push notification server sends feature update information to the application based on the token.

[0090] S210. The application sends update information to the SDK client based on the SDK identifier.

[0091] For example, when the payment SDK and login SDK need to be updated, the corresponding SDK can be matched using the refresh field. Specifically, the payment SDK identifier in the refresh field can be used to match the corresponding payment SDK, and the login SDK identifier in the refresh field can be used to match the corresponding login SDK.

[0092] S211. The SDK client sends a resource acquisition request to the SDK server.

[0093] After receiving the feature update information, the SDK client can extract the resource index of the target feature that needs to be updated in the application from the feature update information, and send the resource acquisition request carrying the resource index to the SDK server.

[0094] S212. The SDK server sends resource files to the SDK client based on the resource acquisition request.

[0095] The SDK server returns the resource file corresponding to the resource index based on the resource retrieval request to the SDK client.

[0096] S213, The SDK client generates the target class for the target function based on the resource file.

[0097] The SDK client parses resource files based on a predefined data format (e.g., JSON) to obtain parsed resource information. This parsed resource information can include at least class information, variables, attributes, and protocol information. At this point, a target class for the desired functionality can be generated based on this parsed resource information. For example, an API interface can be generated using a scripting language like JavaScript and method swizzling, and then the class generation method can be called based on the API interface to generate the target class for the desired functionality.

[0098] S214. The SDK client calls the methods in the target class through the preset call interface to achieve the target function.

[0099] For example, it can receive user input to trigger operations on the application, respond to the trigger operations on the application, and call methods in the target class through a preset calling interface so that the application can achieve the target function.

[0100] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed description of the application function update method above, which will not be repeated here.

[0101] This application embodiment can retrieve the resource file corresponding to the resource index in the function update information of the target function that needs to be updated in the application from the SDK server. When the application calls the target function, the SDK client can dynamically generate the target class of the target function based on the resource file and call the methods in the target class to enable the application to implement the target function, thereby improving the convenience and flexibility of application function updates.

[0102] To facilitate better implementation of the application function implementation method provided in the embodiments of this application, the embodiments of this application also provide an apparatus based on the above-described application function implementation method. The meanings of the terms used are the same as in the above-described application function implementation method, and specific implementation details can be found in the descriptions in the method embodiments.

[0103] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of the application function implementation device provided in the embodiments of this application. The application function implementation device may include an index acquisition unit 301, a file acquisition unit 302, a generation unit 303, and a calling unit 304, etc.

[0104] The index acquisition unit 301 is used to acquire the resource index of the target function in the application.

[0105] The file acquisition unit 302 is used to trigger the application's software development kit client to acquire the resource file corresponding to the resource index.

[0106] The generation unit 303 is used to trigger the software development kit client to generate a target object template for the target function based on the resource file when the application calls the target function.

[0107] Calling unit 304 is used to call the function template in the target object template through the software development kit client so that the application can implement the target function.

[0108] In one embodiment, the index acquisition unit 301 can be specifically used to: acquire application function update information; and extract the resource index of the target function that needs to be updated in the application from the function update information.

[0109] In one embodiment, the application function implementation apparatus may further include:

[0110] The sending unit is used to send a registration request to the server through the application, and the registration request carries the application information of the application.

[0111] The receiving unit is used to receive registration completion information returned by the server. The registration completion information includes the application identifier.

[0112] The index acquisition unit 301 can be specifically used to: receive application function update information pushed by the server based on the application identifier.

[0113] In one embodiment, the file acquisition unit 302 may include:

[0114] The query sub-unit is used to query the resource file corresponding to the resource index from the local file storage space;

[0115] The `get` sub-unit is used to retrieve resource files from the file storage space when the query file storage space contains such files.

[0116] In one embodiment, the file acquisition unit 302 may further include:

[0117] The sending subunit is used to send a resource retrieval request carrying the resource index to the server when no resource file is found in the file storage space.

[0118] The receiving subunit is used to receive the resource file corresponding to the resource index returned by the server based on the resource acquisition request.

[0119] In one embodiment, the sending subunit can be specifically used to: extract the software development kit (SDK) identifier from the feature update information, and send the feature update information to the SSD client corresponding to the SSD identifier; trigger the SSD client to send a resource acquisition request carrying a resource index to the server.

[0120] In one embodiment, the generation unit 303 may include:

[0121] The parsing subunit is used to trigger the software development kit client to parse the resource file based on a predetermined data format when the application calls the target function, so as to obtain the parsed resource information;

[0122] The generation sub-unit is used to generate the target object template for the target function based on the parsed resource information.

[0123] In one embodiment, the parsed resource information includes at least object template information, variables, attributes, and protocol information. The generation subunit can be specifically used to: generate an application programming interface (API) based on the object template information, variables, attributes, and protocol information; and generate a target object template for the target function by calling the object template generation strategy based on the API.

[0124] In one embodiment, the parsing subunit is specifically used to: when it is detected that a resource file has not been downloaded successfully, determine the node where the download of the resource file was interrupted; download the undownloaded portion of the resource file based on the node where the download was interrupted; and trigger the software development kit client to parse the downloaded resource file based on a predetermined data format to obtain the parsed resource information.

[0125] In one embodiment, the calling unit 304 can be specifically used to: respond to a trigger operation on the application; determine a function identifier based on the trigger operation; determine a function template in the target object template from a pre-stored mapping relationship according to the function identifier, wherein the mapping relationship is the mapping relationship between the function template of the target object template and the function identifier; and call the function template in the target object template so that the application can implement the target function.

[0126] In one embodiment, the application function implementation apparatus may include:

[0127] The storage unit is used to extract each functional template from the target object template, set a functional identifier for each functional template, establish a mapping relationship between each functional template and the functional identifier, and store the mapping relationship between each functional template and the functional identifier.

[0128] In one embodiment, the calling unit 304 has the ability to: initialize the software development kit corresponding to the application based on the application identifier of the application, and set calling parameters for the software development kit; generate a preset calling interface based on the calling parameters; and call the function template in the target object template through the preset calling interface.

[0129] In this embodiment, the index acquisition unit 301 acquires the resource index of the target function in the application, and the file acquisition unit 302 triggers the application's software development kit (SDK) client to acquire the resource file corresponding to the resource index. Then, when the application calls the target function, the generation unit 303 triggers the SSD client to generate a target object template for the target function based on the resource file. At this time, the calling unit 304 can call the function template in the target object template through the SSD client, so that the application can implement the target function. This solution can dynamically generate the target object template of the target function through the resource file corresponding to the target function that needs to be updated in the application, and call the function template in the target object template to implement the target function, thereby improving the convenience of application function implementation.

[0130] This application also provides a computer device, which may be a terminal, such as... Figure 6 As shown, it illustrates a structural schematic diagram of the terminal involved in an embodiment of this application. Specifically:

[0131] The terminal may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 6 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0132] The processor 401 is the control center of the terminal, connecting various parts of the terminal through various interfaces and lines. It executes various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.

[0133] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0134] The terminal also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0135] The terminal may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0136] Although not shown, the terminal may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the terminal loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402 to realize various functions, as follows:

[0137] Obtain the resource index of the target function in the application; trigger the application's software development kit (SDK) client to obtain the resource file corresponding to the resource index; when the application calls the target function, trigger the SSD client to generate the target object template of the target function based on the resource file; call the function template in the target object template through the SSD client so that the application can implement the target function.

[0138] In one embodiment, when obtaining the resource index of a target function in an application, the processor 401 may perform the following: obtaining function update information of the application; and extracting the resource index of the target function in the application that needs to be updated from the function update information.

[0139] In one embodiment, when retrieving a resource file corresponding to a resource index, the processor 401 may perform the following: querying the local file storage space for the resource file corresponding to the resource index; and retrieving the resource file from the file storage space when the query shows that a resource file is stored there.

[0140] In one embodiment, after querying the resource file corresponding to the resource index from the local file storage space, the processor 401 may perform the following: when no resource file is found in the file storage space, send a resource acquisition request carrying the resource index to the server; and receive the resource file corresponding to the resource index returned by the server based on the resource acquisition request.

[0141] In one embodiment, when sending a resource acquisition request carrying a resource index to the server, the processor 401 may perform the following: extract the software development kit identifier from the feature update information and send the feature update information to the software development kit client corresponding to the software development kit identifier; trigger the software development kit client to send a resource acquisition request carrying a resource index to the server.

[0142] In one embodiment, before obtaining the application's feature update information, the processor 401 may perform the following: sending a registration request to the server through the application, the registration request carrying the application information of the application; receiving registration completion information returned by the server, the registration completion information including the application identifier; obtaining the application's feature update information includes: receiving the application's feature update information pushed by the server based on the application identifier.

[0143] In one embodiment, when the software development kit client is triggered to generate a target object template for a target function based on a resource file, the processor 401 may execute the following: when the application calls the target function, the software development kit client is triggered to parse the resource file based on a predetermined data format to obtain parsed resource information; and the target object template for the target function is generated based on the parsed resource information.

[0144] In one embodiment, the parsed resource information includes at least object template information, variables, attributes, and protocol information. When generating the target object template for the target function based on the parsed resource information, the processor 401 can perform the following: generate an application programming interface (API) based on the object template information, variables, attributes, and protocol information; and call the object template generation strategy based on the API to generate the target object template for the target function.

[0145] In one embodiment, when the software development kit client is triggered to parse the resource file based on a predetermined data format and obtain the parsed resource information, the processor 401 may perform the following: when it is detected that the resource file has not been downloaded successfully, determine the node where the download of the resource file is interrupted; download the undownloaded part of the resource file based on the node where the download is interrupted; and trigger the software development kit client to parse the downloaded resource file based on the predetermined data format and obtain the parsed resource information.

[0146] In one embodiment, when a function template in a target object template is invoked through a software development kit client to enable an application to perform a target function, the processor 401 may perform the following: respond to a trigger operation on the application; determine a function identifier based on the trigger operation; determine a function template in the target object template from a pre-stored mapping relationship based on the function identifier, wherein the mapping relationship is a mapping relationship between function templates and function identifiers in the target object template; and invoke the function template in the target object template to enable the application to perform the target function.

[0147] In one embodiment, before determining the functional template in the target object template from the pre-stored mapping relationship based on the functional identifier, the processor 401 may perform the following: extract each functional template in the target object template and set a functional identifier for each functional template; establish a mapping relationship between each functional template and the functional identifier; and store the mapping relationship between each functional template and the functional identifier.

[0148] In one embodiment, when calling a function template in the target object template, the processor 401 may perform the following: based on the application's application identifier, initialize the software development kit corresponding to the application to set calling parameters for the software development kit; generate a preset calling interface based on the calling parameters; and call the function template in the target object template through the preset calling interface.

[0149] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed description of the application function implementation method above, which will not be repeated here.

[0150] According to one aspect of this application, a computer program product or computer program is provided, comprising 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 methods provided in the various optional implementations of the above embodiments.

[0151] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions in a computer program, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0152] Therefore, embodiments of this application provide a storage medium storing a computer program that can be loaded by a processor to execute any of the application function implementation methods provided in embodiments of this application.

[0153] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0154] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0155] Since the instructions stored in the storage medium can execute the steps in any of the application function implementation methods provided in the embodiments of this application, the beneficial effects that any of the application function implementation methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0156] The above provides a detailed description of an application function implementation method, apparatus, computer device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, those skilled in the art may make changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for implementing application functions, characterized in that, include: Retrieve the resource index of the target function in the application; The application's software development kit client is triggered to obtain the resource file corresponding to the resource index; When the application calls the target function, the software development kit (SDK) client is triggered to generate a target object template for the target function based on the resource file. The target object template is a target class, and includes one or more function templates, which are methods within the class. These function templates are called during the application's execution. The SSD client is also triggered to parse the resource file based on a predetermined data format to obtain parsed resource information. This parsed resource information includes at least object template information, variables, attributes, and protocol information. Based on the object template information, variables, attributes, and protocol information, an application programming interface (API) is generated. Finally, based on the API, an object template generation strategy is invoked to generate the target object template for the target function. The application implements the target function by calling the function template in the target object template through the software development kit client. The function template in the target object template is called through a preset calling interface. The application sends application information to the message push server. The message push server performs internal authentication on the application based on the application information. After authentication, the message push server sends an application identifier to the application. The application sends the application identifier to the application server and the software development kit client. The software development kit client initializes the SDK based on the application identifier and generates a preset calling interface.

2. The application function implementation method according to claim 1, characterized in that, The software development kit client is triggered to parse the resource file based on a predetermined data format, and the parsed resource information includes: When it is detected that the resource file has not been downloaded successfully, the node where the download of the resource file was interrupted is determined; Based on the nodes where the download was interrupted, the undownloaded portions of the resource files are downloaded; The software development kit client is triggered to parse the downloaded resource file based on a predetermined data format to obtain the parsed resource information.

3. The application function implementation method according to claim 1, characterized in that, The step of obtaining the resource index of the target function in the application, triggering the application's software development kit client, and obtaining the resource file corresponding to the resource index includes: Obtain the function update information of the application, and extract the resource index of the target function that needs to be updated in the application from the function update information; The application's software development kit client is triggered to query the resource file corresponding to the resource index from the local file storage space; When the resource file is stored in the file storage space, the resource file is retrieved from the file storage space.

4. The application function implementation method according to claim 3, characterized in that, After querying the resource file corresponding to the resource index from the local file storage space, the application function implementation method further includes: When it is found that the resource file is not stored in the file storage space, the software development kit identifier in the function update information is extracted, and the function update information is sent to the software development kit client corresponding to the software development kit identifier; The software development kit client is triggered to send a resource acquisition request carrying the resource index to the server; Receive the resource file corresponding to the resource index returned by the server based on the resource acquisition request.

5. The application function implementation method according to claim 3, characterized in that, Before obtaining the application's function update information, the application function implementation method further includes: The application sends a registration request to the server, and the registration request carries the application information of the application. Receive registration completion information returned by the server, the registration completion information including an application identifier; The process of obtaining the application's feature update information includes: Receive the application's feature update information pushed by the server based on the application identifier.

6. The application function implementation method according to any one of claims 1 to 5, characterized in that, The step of calling the function template in the target object template through the software development kit client so that the application can implement the target function includes: Respond to a trigger operation on the application; The function identifier is determined based on the triggering operation; The function template in the target object template is determined from the pre-stored mapping relationship based on the function identifier, wherein the mapping relationship is the mapping relationship between the function template of the target object template and the function identifier; The application calls the function template in the target object template so that it can implement the target function.

7. The application function implementation method according to claim 6, characterized in that, Before determining the function template in the target object template from the pre-stored mapping relationship based on the function identifier, the application function implementation method further includes: Extract each functional template from the target object template and set a functional identifier for each functional template; Establish a mapping relationship between each functional template and its corresponding functional identifier; Store the mapping relationship between each functional template and the functional identifier.

8. The application function implementation method according to claim 6, characterized in that, The invocation of the function template in the target object template includes: Based on the application identifier of the application, initialize the software development kit corresponding to the application, and set the calling parameters for the software development kit; Generate a preset calling interface based on the calling parameters; The function template in the target object template is invoked through the preset calling interface.

9. An application function implementation device, characterized in that, include: The index retrieval unit is used to retrieve the resource index of the target function in the application. The file acquisition unit is used to trigger the application's software development kit client to acquire the resource file corresponding to the resource index; A generation unit is configured to, when the application calls the target function, trigger the software development kit (SDK) client to generate a target object template for the target function based on the resource file. The target object template is a target class, and includes one or more function templates, which are methods within the class. These function templates are invoked during the application's execution. The unit also triggers the SSD client to parse the resource file based on a predetermined data format to obtain parsed resource information. This parsed resource information includes at least object template information, variables, attributes, and protocol information. Based on the object template information, variables, attributes, and protocol information, an application programming interface (API) is generated. Finally, based on the API, an object template generation strategy is invoked to generate the target object template for the target function. The calling unit is used to call the function template in the target object template through the software development kit client, so that the application can implement the target function. The function template in the target object template is called through a preset calling interface. The application sends application information to the message push server. The message push server performs internal authentication on the application based on the application information. After authentication, the message push server sends an application identifier to the application. The application sends the application identifier to the application server and the software development kit client. The software development kit client initializes the SDK based on the application identifier and generates a preset calling interface.

10. A computer device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the application function implementation method as described in any one of claims 1 to 8 when it calls the computer program in the memory.

11. A storage medium, characterized in that, The storage medium is used to store a computer program, which is loaded by a processor to execute the application function implementation method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Application dynamic updating method and system, electronic equipment and storage medium

    CN109408098A

  • Customized development method and device of payment application, computer device and storage medium

    CN109766084A