Information calling method and device, computer program product and electronic equipment

By intercepting and parsing call requests, judging and generating target call functions, the problem that traditional chain calling methods cannot be dynamically adjusted is solved, and higher flexibility and scalability are achieved.

CN119201292APending Publication Date: 2024-12-27CHINA TELECOM BESTPAY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410909329.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Due to static definition, traditional chain calling methods cannot dynamically adjust the calling methods and parameters according to runtime conditions, resulting in the inability to flexibly respond in complex and changeable business scenarios.

Method used

By intercepting the call request of the initial class instance, parsing the call request, and determining whether the target class instance has the target call content, if it exists, it will return; if it does not exist, use the preset function and the target call feature to generate the target call function and send it To the initial class instance, dynamic adjustment is implemented.

Benefits of technology

Improves the flexibility and scalability of call operations, allowing initial class instances to flexibly respond to unpre-set call operations without modifying the underlying code or making a lot of configuration adjustments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201292A_ABST
    Figure CN119201292A_ABST
Patent Text Reader

Abstract

The invention discloses an information calling method and device, a computer program product and electronic equipment. Relates to the technical field of computers. The method comprises the following steps: intercepting a calling request sent by an initial class instance, and analyzing the calling request to obtain a target calling feature; judging whether target calling content corresponding to the target calling feature is stored in the target class instance or not; under the condition that the target calling content is stored in the target class instance, returning the target calling content to the initial class instance; and under the condition that the target call content is not stored in the target class instance, generating a target call function through a preset function and the target call feature, and sending the target call function to the initial class instance. Through the method and the device, the problem that the preset calling method and the parameters cannot be dynamically adjusted according to the running time condition due to the fact that the preset calling method and the parameters are defined in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an information calling method, device, computer program product and electronic device. Background Art

[0002] As one of the core paradigms of modern software development, object-oriented programming greatly improves the reusability, maintainability and scalability of code through features such as encapsulation, inheritance and polymorphism. Among them, chain call, as an advanced implementation method of object-oriented programming operations, has shown great advantages in improving code readability and reducing redundant code with its concise and fluent coding style.

[0003] However, the traditional chain calling method is limited by static definition, that is, the method calling and parameter passing are determined at the time of writing, which lacks flexibility. This static arrangement method is difficult to adapt to complex and changing business scenarios, especially when the calling chain or method parameters need to be dynamically adjusted according to runtime conditions. Since the calling method has been defined, it is impossible to modify the calling method or calling parameters, and thus the corresponding calling operation cannot be performed.

[0004] With regard to the problem in the related art that the preset calling method and parameters have been defined, resulting in the inability to dynamically adjust the preset calling method and parameters according to the operating conditions, no effective solution has been proposed yet. Summary of the invention

[0005] The present application provides an information calling method, device, computer program product and electronic device to solve the problem in the related art that the preset calling method and parameters have been defined, resulting in the inability to dynamically adjust the preset calling method and parameters according to the operating conditions.

[0006] According to one aspect of the present application, an information calling method is provided. The method includes: intercepting a calling request sent by an initial class instance, parsing the calling request, and obtaining a target calling feature; judging whether a target calling content corresponding to the target calling feature is stored in the target class instance, wherein the target class instance stores multiple contents to be called, and the target class instance is associated with the initial class instance through a proxy instance; if the target calling content is stored in the target class instance, the target calling content is returned to the initial class instance; if the target calling content is not stored in the target class instance, a target calling function is generated by a preset function and a target calling feature, and the target calling function is sent to the initial class instance, wherein the target calling function is used to obtain the target calling content.

[0007] Optionally, before determining whether the target call content corresponding to the target call feature is stored in the target class instance, the method further includes: determining whether the target call content is stored in the initial class instance; if the target call content is stored in the initial class instance, sending a call request to the initial class instance; if the target call content is not stored in the initial class instance, executing the step of determining whether the target call content corresponding to the target call feature is stored in the target class instance.

[0008] Optionally, determining whether target call content corresponding to the target call feature is stored in the target class instance includes: accessing a storage area of ​​the target class instance, wherein the storage area is used to store data content, and the data content includes at least one of the following: attribute data, method data, operation data; searching the storage area for feature information related to the target call feature; determining that the target call content is stored in the target class instance when feature information related to the target call feature is found in the storage area; and determining that the target call content is not stored in the target class instance when feature information related to the target call feature is not found in the storage area.

[0009] Optionally, generating a target calling function through a preset function and a target calling feature, and sending the target calling function to the initial class instance includes: obtaining a feature value corresponding to the target calling feature from the operation and maintenance end; when the feature value is obtained, adding the feature value to the preset function to obtain the target calling function, and sending the target calling function to the initial class instance, wherein, after receiving the target calling function, the initial class instance executes the target calling function to obtain the feature value, and determines the feature value as the target calling content.

[0010] Optionally, generating a target calling function through a preset function and a target calling feature, and sending the target calling function to the initial class instance includes: obtaining a feature value corresponding to the target calling feature from the operation and maintenance end; if the feature value is not obtained, determining the target calling function in the function library according to the target calling feature, and sending the target calling function to the initial class instance, wherein, after receiving the target calling function, the initial class instance executes the preset operation carried in the target calling function to obtain the target calling content, and the function library includes multiple initial functions.

[0011] Optionally, before determining whether the target call content corresponding to the target call feature is stored in the target class instance, the method also includes: obtaining multiple contents to be called, and storing the multiple contents to be called in the target class instance; setting a proxy instance for the target class instance, wherein the proxy instance is used to receive a call request sent to the target class instance.

[0012] Optionally, after generating the target call function through the preset function and the target call feature, the method further includes: storing the feature value in the target class instance.

[0013] According to another aspect of the present application, an information calling device is provided. The device includes: a parsing unit, which is used to intercept a call request sent by an initial class instance, parse the call request, and obtain a target call feature; a first judgment unit, which is used to judge whether a target call content corresponding to the target call feature is stored in the target class instance, wherein the target class instance stores multiple contents to be called, and the target class instance is associated with the initial class instance through a proxy instance; a returning unit, which is used to return the target call content to the initial class instance if the target call content is stored in the target class instance; and a generating unit, which is used to generate a target call function through a preset function and a target call feature if the target call content is not stored in the target class instance, and send the target call function to the initial class instance, wherein the target call function is used to obtain the target call content.

[0014] According to another aspect of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, an information calling method in the present application is implemented.

[0015] According to another aspect of the present invention, an electronic device is provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein an information calling method is executed when the computer-readable instructions are executed.

[0016] Through this application, the following steps are adopted: intercepting the call request sent by the initial class instance, parsing the call request, and obtaining the target call feature; judging whether the target call content corresponding to the target call feature is stored in the target class instance, wherein the target class instance stores multiple contents to be called, and the target class instance is associated with the initial class instance through a proxy instance; in the case where the target call content is stored in the target class instance, the target call content is returned to the initial class instance; in the case where the target call content is not stored in the target class instance, a target call function is generated by a preset function and a target call feature, and the target call function is sent to the initial class instance, wherein the target call function is used to obtain the target call content. The problem that the preset call method and parameters in the related art cannot be dynamically adjusted according to the operation conditions because the preset call method and parameters have been defined is solved. The initial class instance is associated with the target class instance by using a proxy instance, so that the content to be called in the target class instance can be shared and reused by multiple initial class instances. And in the case where there is no target call content in the target class instance, the target call function can be dynamically generated according to the target call feature, so that the initial class instance is no longer limited to the preset call method and parameters. This enables the initial class instance to respond flexibly when executing call operations that are not pre-set, without modifying the underlying code or making a lot of configuration adjustments, achieving the technical effect of improving the flexibility and scalability of the call operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 is a flowchart of an information calling method provided according to an embodiment of the present application;

[0019] Figure 2 is a flowchart of a method for determining target call content provided in an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of an information calling device provided according to an embodiment of the present application;

[0021] Figure 4 It is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] It should be noted that the information calling method, device, computer program product and electronic device determined in the present disclosure can be used in the field of computer technology, and can also be used in any field outside the field of computer technology. The application field of the information calling method, device, computer program product and electronic device determined in the present disclosure is not limited.

[0026] It should be noted that the collected information, user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) used in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated. Corresponding operation portals are provided for users to choose to authorize or refuse to use. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0027] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0028] Object-oriented programming: It is a programming paradigm that encapsulates data (attributes) and operations (methods) into independent objects and implements functions through interactions between these objects.

[0029] Chain call: is a programming paradigm that allows multiple methods to be called consecutively on the same object, each method returns the object itself or another object with a similar interface. This can express a series of operations in a concise and readable way, and make the code more fluent and readable.

[0030] Class instance: is a specific implementation or object of a class. A class is a blueprint or template for creating an object, which defines the object's properties (data) and methods (functions). An instance is a specific object created based on this class template. It contains all the properties and methods defined in the class, but each instance can have its own independent property values.

[0031] Proxy instance: The Proxy constructor is used to generate Proxy instances, which can intercept and customize various operations of the target object (such as attribute access, assignment, function call, etc.).

[0032] According to an embodiment of the present application, an information calling method is provided.

[0033] Figure 1 is a flow chart of the information calling method provided according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0034] Step S101, intercepting a call request sent by an initial class instance, and parsing the call request to obtain target call features.

[0035] It should be noted that the initial class instance can be a class instance that executes chain calls, and the execution subject of this application is a proxy instance set on the target class instance, such as a proxy instance.

[0036] Specifically, the proxy instance can intercept and process various operations sent by the initial class instance to the target class instance, such as attribute access, method call, etc. When a call request is initiated through the initial class instance (for example, accessing an attribute or calling a method), the proxy instance will intercept the call request. By parsing the call request, the target of the call (attribute name or method name) and any passed parameters can be obtained, and the target call characteristics are formed based on the attribute name, method name and other parameters in the above call target, so that the content that the initial class instance needs to call can be determined based on the target call characteristics.

[0037] Step S102, determining whether the target class instance stores target call content corresponding to the target call feature, wherein the target class instance stores a plurality of contents to be called, and the target class instance is associated with the initial class instance through a proxy instance.

[0038] It should be noted that the target class instance can be an object containing multiple properties and methods, where each method or property may be associated with a specific call feature (such as a method name or property name), and each method or property can be called a content to be called, and the selected content to be called is the target call content. In order to effectively match, the target class instance can use the following storage mechanism to store the content to be called: Direct mapping: The target class instance directly defines the properties or methods corresponding to the call feature. For example, if the call feature is "getData", there may be a method called getData in the target class instance. Mapping table: The target class instance may maintain a mapping table (such as an object in JavaScript), where the key is the call feature (such as the method name) and the value is the corresponding function body or processing logic.

[0039] Furthermore, when the proxy instance intercepts the call request sent by the initial class instance, the proxy instance will parse the request to obtain the target call characteristics (such as method name or attribute name). Then, the proxy instance can check whether there is content matching the target call characteristics in the target class instance, thereby determining whether the corresponding target call content can be obtained from the target class instance, and feeding the target call content back to the initial class instance, thereby completing the call operation.

[0040] Step S103: When the target calling content is stored in the target class instance, the target calling content is returned to the initial class instance.

[0041] Specifically, if the target class instance has an attribute or method corresponding to the call feature, that is, if the target call content exists, the proxy instance can directly access and return this value or execute this method to the initial class instance. For example, if the target call content is a function, it may be executed immediately and return the execution result. If the target call content is a value, it will directly return this value, thereby completing the feedback operation of the call content.

[0042] Step S104, when the target calling content is not stored in the target class instance, a target calling function is generated by using a preset function and a target calling feature, and the target calling function is sent to the initial class instance, wherein the target calling function is used to obtain the target calling content.

[0043] Specifically, if no call content matching the call feature is found in the target class instance, a target call function can be generated according to the preset logic (which can be a function or a series of steps). The target call function is dynamically created based on the call feature (such as the method name) and contains some default behaviors or fallback logic, or contains properties or methods that need to be returned to the initial class instance. After the target call function is generated, the target call function can be returned to the initial class instance for use in subsequent operations.

[0044] For example, when a proxy instance intercepts a call request on an initial class instance and tries to find content matching the call signature in the target class instance, if no matching item is found, the proxy instance realizes that a new call function or processing logic needs to be generated. At this point, the proxy instance triggers a preset logic process. This logic process may be a function, a method call chain, or a series of predefined steps to generate a new call function.

[0045] For example, the preset logic may be a collection of one or more functions or methods that receive calling features (such as method names) as input and generate new function bodies based on this input; or, the logic process may use some form of templates or frameworks to build new functions. These templates define the basic structure of the function, and the specific behavior or logic is dynamically generated by filling in the placeholders in the template; or, in some complex cases, the preset logic may be a rule engine that dynamically generates function bodies according to a set of predefined rules. These rules may determine the behavior of the function based on certain attributes of the calling features (such as name, parameter type, etc.).

[0046] Furthermore, under the guidance of the preset logic, a target call function is created, which will define its behavior based on the call features (such as the method name) and may contain some default behaviors or fallback logic. For example, if the method name called is "getData", but there is no such method in the target class instance, then the generated target call function may return a default data set to the initial class instance, or throw an error containing useful information. Finally, the newly generated call function is returned to the initial class instance, and this new function can now be used in the context of the initial class instance, thereby completing the technical effect of feeding back the target call content to the initial class instance.

[0047] It should be noted that in the above steps, the role of the proxy instance is very critical. As a bridge between the initial class instance and the target class instance, it is responsible for intercepting and processing all call requests, and forwarding the requests to the target class instance according to the actual situation, or generating new processing logic and returning it to the initial class instance. In this way, we can expand or modify the behavior of the initial class without modifying the original class code.

[0048] The information calling method provided by the embodiment of the present application intercepts the calling request sent by the initial class instance, and parses the calling request to obtain the target calling feature; judges whether the target calling content corresponding to the target calling feature is stored in the target class instance, wherein the target class instance stores multiple contents to be called, and the target class instance is associated with the initial class instance through a proxy instance; in the case where the target calling content is stored in the target class instance, the target calling content is returned to the initial class instance; in the case where the target calling content is not stored in the target class instance, a target calling function is generated by a preset function and a target calling feature, and the target calling function is sent to the initial class instance, wherein the target calling function is used to obtain the target calling content. The problem that the preset calling method and parameters in the related art cannot be dynamically adjusted according to the operation conditions because the preset calling method and parameters have been defined is solved. The initial class instance is associated with the target class instance by using a proxy instance, so that the content to be called in the target class instance can be shared and reused by multiple initial class instances. And in the case where there is no target calling content in the target class instance, the target calling function can be generated dynamically according to the target calling feature, so that the initial class instance is no longer limited to the preset calling method and parameters. This enables the initial class instance to respond flexibly when executing call operations that are not pre-set, without modifying the underlying code or making a lot of configuration adjustments, achieving the technical effect of improving the flexibility and scalability of the call operation.

[0049] Optionally, in the information calling method provided in the embodiment of the present application, before determining whether the target calling content corresponding to the target calling feature is stored in the target class instance, the method also includes: determining whether the target calling content is stored in the initial class instance; if the target calling content is stored in the initial class instance, sending the calling request to the initial class instance; if the target calling content is not stored in the initial class instance, executing the step of determining whether the target calling content corresponding to the target calling feature is stored in the target class instance.

[0050] Specifically, since the initial class instance may store the target call content, when using the proxy instance to intercept the call request on the initial class instance, it is possible to first determine whether the initial class instance stores the target call content that matches the call characteristics (such as method name or attribute name). For example, by directly accessing the attributes or methods of the initial class instance, it is possible to check whether the initial class instance directly stores the target call content that matches the call characteristics.

[0051] Furthermore, if the target call content is found in the initial class instance, the call request is directly sent to the initial class instance itself for processing, so that the initial class instance can directly obtain and call the target call content from its own pre-set properties or methods, and perform subsequent call operations. If no matching call content is found in the initial class instance, the step of determining whether the target call content corresponding to the target call feature is stored in the target class instance is executed, thereby obtaining the target call content from the target class instance, thereby achieving the technical effect of improving the convenience of obtaining the target call content.

[0052] This embodiment allows the method or property to be called to be stored in the initial class instance by checking the initial class instance first, thereby increasing the flexibility and configurability of the code. Furthermore, if the initial class instance already contains the required calling content, there is no need to check the target class instance or execute more complex logic to generate a new calling function, thereby improving the execution efficiency of the code.

[0053] Optionally, in the information calling method provided in the embodiment of the present application, determining whether the target calling content corresponding to the target calling feature is stored in the target class instance includes: accessing a storage area of ​​the target class instance, wherein the storage area is used to store data content, and the data content includes at least one of the following: attribute data, method data, operation data; searching the storage area for feature information related to the target calling feature; when feature information related to the target calling feature is queried in the storage area, determining that the target calling content is stored in the target class instance; when feature information related to the target calling feature is not queried in the storage area, determining that the target calling content is not stored in the target class instance.

[0054] It should be noted that a storage area can be preset in the target class instance. This storage area can be an object, a mapping (such as Map or Object), a database connection handle (if the data is stored in an external database), or any other data structure that can store and retrieve data. In the storage area, the data content may exist in various forms, including but not limited to: Attribute data: key-value pairs stored directly on the object, representing the state or configuration of the instance. Method data: function body or reference, which defines the behavior of the instance. Operation data: may refer to specific operation logic, processing flow or instruction sequence, which are not directly expressed as attributes or methods, but can be triggered and executed through some mechanism (such as event listeners, callback functions).

[0055] Specifically, after obtaining the target call features in the call request, it is necessary to search the storage area for feature information related to the target call features. During the search, it is possible to determine how to search in the storage area based on the target call features (such as method name, attribute name, or operation identifier), for example, traversing the properties of the object, querying the mapped keys, executing database queries, and other operations. After determining the search strategy, the storage area is searched for feature information that matches the target call features according to the search strategy, thereby obtaining the target call content.

[0056] Further, if feature information related to the target call feature is found in the storage area, it can be determined that the target call content is stored in the target class instance. At this time, the target call content can be obtained according to the feature information. If feature information related to the target call feature is not found in the storage area, it can be determined that the target call content is not stored in the target class instance, thereby achieving the technical effect of accurately judging whether the target call content corresponding to the target call feature is stored in the target class instance.

[0057] This embodiment can improve the query performance of finding feature information in the storage area by explicitly storing the data content in the storage area of ​​the target class instance and defining a clear search strategy to find the content, thereby improving the execution efficiency of the overall code.

[0058] Optionally, in the information calling method provided in the embodiment of the present application, Figure 2 is a flow chart of a method for determining target call content according to an embodiment of the present application, such as Figure 2 As shown, generating a target call function through a preset function and a target call feature, and sending the target call function to an initial class instance includes:

[0059] Step S201, obtaining a feature value corresponding to a target call feature from an operation and maintenance end;

[0060] Step S202, when the characteristic value is obtained, the characteristic value is added to the preset function to obtain the target calling function, and the target calling function is sent to the initial class instance, wherein after receiving the target calling function, the initial class instance executes the target calling function to obtain the characteristic value, and determines the characteristic value as the target calling content.

[0061] It should be noted that one or more preset functions may be defined in the target class instance, which will serve as the basis for generating the target call function. The preset function may be a general function with placeholders or default parameters, which can be modified or extended to include specific logic as needed.

[0062] Specifically, after setting multiple preset functions in the target class instance, the feature values ​​associated with the target call features can be obtained from the operation and maintenance end through a preset mechanism (such as API call, configuration file reading, user input, etc.), so as to modify the preset function using the obtained feature values ​​to generate a target call function specific to the current request, where the operation and maintenance end can be a user or a preset database, etc.

[0063] It should be noted that the process of obtaining characteristic values ​​and adding them to a preset function can be implemented in a variety of ways, such as dynamically replacing placeholders in a function, modifying a function's parameter list, etc., so as to obtain a target calling function.

[0064] Furthermore, after obtaining the target calling function, the target calling function can be sent to the initial class instance, the target calling function is executed through the initial class instance to obtain the characteristic value, and the characteristic value is determined as the target calling content, thereby completing the target calling content calling operation.

[0065] This embodiment separates the function implementation from the calling logic by dynamically generating the target calling function, so that the proxy instance can flexibly respond to different requests and conditions. When the initial class instance needs to call an undefined property or method, it only needs to define a new preset function according to the characteristic value, making it easier for the initial class instance to expand the calling object, so that the functions of the initial class instance can be dynamically combined and customized according to needs.

[0066] Optionally, in the information calling method provided in the embodiment of the present application, a target calling function is generated by a preset function and a target calling feature, and sending the target calling function to the initial class instance includes: obtaining a feature value corresponding to the target calling feature from the operation and maintenance end; if the feature value is not obtained, determining the target calling function in the function library according to the target calling feature, and sending the target calling function to the initial class instance, wherein, after receiving the target calling function, the initial class instance executes the preset operation carried in the target calling function to obtain the target calling content, and the function library includes multiple initial functions.

[0067] It should be noted that a function library can be a collection of functions, including multiple initial functions that can be used to perform different tasks. Each function has a unique identifier or label in the function library to distinguish different functions. These identifiers or labels can be names, codes, numbers, or any attributes that can uniquely identify a function.

[0068] Specifically, when the operation and maintenance end does not reply with the feature value, the proxy instance needs to search for the corresponding target call function in the function library according to the target call feature, which can be achieved by matching the target call feature with the function identifier or label in the function library. If a match is found, the target call function corresponding to the target call feature is determined. When matching, the matching logic used may include simple string comparison, regular expression matching, hash search, or more complex algorithms. The proxy instance checks each function in the function library one by one according to the matching logic until a function matching the target call feature is found.

[0069] If the proxy instance successfully finds a function that matches the target call feature in the function library, then the function is determined as the target call function for this call, and the target call function is sent to the initial class instance. The target call function is executed through the initial class instance to obtain the feature value, and the feature value is determined as the target call content, thereby completing the target call content call operation.

[0070] This embodiment separates the function implementation from the calling logic by dynamically generating the target calling function, so that the proxy instance can flexibly respond to different requests and conditions. When the initial class instance needs to call an undefined property or method, it only needs to define a new preset function according to the characteristic value, making it easier for the initial class instance to expand the calling object, so that the functions of the initial class instance can be dynamically combined and customized according to needs.

[0071] Optionally, in the information calling method provided in the embodiment of the present application, before determining whether the target calling content corresponding to the target calling feature is stored in the target class instance, the method also includes: obtaining multiple contents to be called, and storing the multiple contents to be called in the target class instance; setting a proxy instance for the target class instance, wherein the proxy instance is used to receive a calling request sent to the target class instance.

[0072] Specifically, when creating a target class instance, it is necessary to collect multiple contents to be called from different data sources or business logics. These contents to be called can be pre-set properties or methods, which can be called by the initial class instance. The system can obtain these contents through database query, file reading or user input.

[0073] Furthermore, after obtaining multiple contents to be called, these contents need to be stored in the target class instance. The storage method may include adding the contents to a list of the target class instance, or encapsulating the contents in a data structure of the instance.

[0074] To control access and calls to the target class instance, the system sets up a proxy instance for the target class instance. The proxy instance is an intermediate layer that intercepts and processes all call requests sent to the target class instance. The proxy instance can perform additional logic, such as permission checking, logging, performance monitoring, or request modification, and then forward the request to the target class instance, thereby hiding the complexity and implementation details of the target class instance while providing a unified access interface.

[0075] This embodiment sets up a proxy instance so that the system can add additional properties and methods to the target class instance without modifying the target class instance code, so that the initial class instance can call the properties and methods in the target class instance, thereby enhancing the flexibility and scalability of the system and enabling the system to adapt to changing needs more easily.

[0076] Optionally, in the information calling method provided in the embodiment of the present application, after generating the target calling function through the preset function and the target calling feature, the method also includes: storing the feature value in the target class instance.

[0077] Specifically, when obtaining the characteristic value, since the characteristic value is also the attribute or method called by the initial class instance, in order to ensure that the efficiency of obtaining the attribute or method can be improved when the attribute or method is obtained again subsequently, the characteristic value can be stored in the target class instance, so that when the attribute or method is obtained again subsequently, it can be directly obtained from the target class instance, thereby achieving the technical effect of improving the calling efficiency of the attribute or method calling operation.

[0078] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0079] The embodiment of the present application also provides an information calling device. It should be noted that the information calling device of the embodiment of the present application can be used to execute the information calling method provided by the embodiment of the present application. The information calling device provided by the embodiment of the present application is introduced below.

[0080] Figure 3 Schematic diagram of an information calling device provided according to an embodiment of the present application. Figure 3 As shown, the device includes: a parsing unit 31, a first judging unit 32, a returning unit 33, and a generating unit 34.

[0081] The parsing unit 31 is used to intercept the call request sent by the initial class instance, and parse the call request to obtain the target call feature.

[0082] The first judgment unit 32 is used to judge whether the target calling content corresponding to the target calling feature is stored in the target class instance, wherein the target class instance stores multiple contents to be called, and the target class instance is associated with the initial class instance through the proxy instance.

[0083] The returning unit 33 is used to return the target calling content to the initial class instance when the target calling content is stored in the target class instance.

[0084] The generating unit 34 is used to generate a target calling function through a preset function and a target calling feature when no target calling content is stored in the target class instance, and send the target calling function to the initial class instance, wherein the target calling function is used to obtain the target calling content.

[0085] The information calling device provided by the embodiment of the present application intercepts the calling request sent by the initial class instance through the parsing unit 31, and parses the calling request to obtain the target calling feature; the first judging unit 32 judges whether the target calling content corresponding to the target calling feature is stored in the target class instance, wherein the target class instance stores multiple contents to be called, and the target class instance is associated with the initial class instance through the proxy instance; the returning unit 33 returns the target calling content to the initial class instance when the target calling content is stored in the target class instance; the generating unit 34 generates the target calling function through the preset function and the target calling feature when the target class instance does not store the target calling content, and sends the target calling function to the initial class instance, wherein the target calling function is used to obtain the target calling content. The problem that the preset calling method and parameters in the related art cannot be dynamically adjusted according to the operation conditions because the preset calling method and parameters have been defined is solved, and the initial class instance is associated with the target class instance by using the proxy instance, so that the contents to be called in the target class instance can be shared and reused by multiple initial class instances. Furthermore, when the target call content does not exist in the target class instance, the target call function can be dynamically generated according to the target call characteristics, so that the initial class instance is no longer restricted to the preset call method and parameters. This enables the initial class instance to respond flexibly when executing a call operation that is not preset, without modifying the underlying code or making a lot of configuration adjustments, thus achieving the technical effect of improving the flexibility and scalability of the call operation.

[0086] Optionally, in the information calling device provided in the embodiment of the present application, before determining whether the target calling content corresponding to the target calling feature is stored in the target class instance, the device also includes: a second determination unit, used to determine whether the target calling content is stored in the initial class instance; a sending unit, used to send the call request to the initial class instance when the target calling content is stored in the initial class instance; and an execution unit, used to execute the step of determining whether the target calling content corresponding to the target calling feature is stored in the target class instance when the target calling content is not stored in the initial class instance.

[0087] Optionally, in the information calling device provided in the embodiment of the present application, the first judgment unit 32 includes: an access module, used to access the storage area of ​​the target class instance, wherein the storage area is used to store data content, and the data content includes at least one of the following: attribute data, method data, and operation data; a search module, used to search for feature information related to the target call feature in the storage area; a first determination module, used to determine that the target call content is stored in the target class instance when the feature information related to the target call feature is queried in the storage area; and a second determination module, used to determine that the target call content is not stored in the target class instance when the feature information related to the target call feature is not queried in the storage area.

[0088] Optionally, in the information calling device provided in the embodiment of the present application, the generation unit 34 includes: a first acquisition module, used to obtain a feature value corresponding to the target calling feature from the operation and maintenance end; an adding module, used to add the feature value to a preset function when the feature value is obtained, to obtain the target calling function, and send the target calling function to the initial class instance, wherein, after receiving the target calling function, the initial class instance executes the target calling function, obtains the feature value, and determines the feature value as the target calling content.

[0089] Optionally, in the information calling device provided in the embodiment of the present application, the generation unit 34 includes: a second acquisition module, used to obtain a feature value corresponding to the target calling feature from the operation and maintenance end; a third determination module, used to determine the target calling function in the function library according to the target calling feature when the feature value is not obtained, and send the target calling function to the initial class instance, wherein, after receiving the target calling function, the initial class instance executes the preset operation carried in the target calling function to obtain the target calling content, and the function library includes multiple initial functions.

[0090] Optionally, in the information calling device provided in the embodiment of the present application, before determining whether the target calling content corresponding to the target calling feature is stored in the target class instance, the device also includes: an acquisition unit, used to acquire multiple contents to be called, and store the multiple contents to be called in the target class instance; a setting unit, used to set a proxy instance for the target class instance, wherein the proxy instance is used to receive a call request sent to the target class instance.

[0091] Optionally, in the information calling device provided in the embodiment of the present application, after generating the target calling function through the preset function and the target calling feature, the device also includes: a storage unit for storing the feature value in the target class instance.

[0092] The above-mentioned information calling device includes a processor and a memory. The above-mentioned parsing unit 31, the first judgment unit 32, the return unit 33, the generation unit 34, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.

[0093] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and by adjusting the kernel parameters, the problem in the related art that the preset calling method and parameters have been defined, resulting in the inability to dynamically adjust the preset calling method and parameters according to the operating conditions is solved.

[0094] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0095] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, an information calling method is implemented.

[0096] An embodiment of the present invention provides a processor, which is used to run a program, wherein an execution information calling method is performed when the program is running.

[0097] Figure 4 is a schematic diagram of an electronic device provided according to an embodiment of the present application, such as Figure 4 As shown, an embodiment of the present invention provides an electronic device, the electronic device 40 includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the steps of the above information calling method when executing the program. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.

[0098] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the steps of the above-mentioned information calling method.

[0099] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0100] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0101] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0103] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0104] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0105] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0106] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0107] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. An information calling method, characterized in that: include: Intercepting the call request sent by the initial class instance, and parsing the call request to obtain the target call feature; Determine whether the target calling content corresponding to the target calling feature is stored in the target class instance, wherein the target class instance stores a plurality of contents to be called, and the target class instance is associated with the initial class instance through a proxy instance; In the case where the target call content is stored in the target class instance, returning the target call content to the initial class instance; In the case that the target calling content is not stored in the target class instance, a target calling function is generated by using a preset function and the target calling feature, and the target calling function is sent to the initial class instance, wherein the target calling function is used to obtain the target calling content.

2. The method according to claim 1, characterized in that: Before determining whether the target call content corresponding to the target call feature is stored in the target class instance, the method further includes: Determine whether the target call content is stored in the initial class instance; In the case where the target calling content is stored in the initial class instance, sending the calling request to the initial class instance; In the case that the target call content is not stored in the initial class instance, the step of determining whether the target call content corresponding to the target call feature is stored in the target class instance is performed.

3. The method according to claim 1, characterized in that Determining whether the target call content corresponding to the target call feature is stored in the target class instance includes: Accessing a storage area of ​​the target class instance, wherein the storage area is used to store data content, and the data content includes at least one of the following: attribute data, method data, and operation data; Searching the storage area for feature information related to the target call feature; In the case where feature information related to the target call feature is queried in the storage area, determining that the target call content is stored in the target class instance; When no feature information related to the target call feature can be found in the storage area, it is determined that the target call content is not stored in the target class instance.

4. The method according to claim 1, characterized in that Generating a target call function by using a preset function and the target call feature, and sending the target call function to the initial class instance comprises: Obtaining a feature value corresponding to the target call feature from the operation and maintenance end; When the characteristic value is obtained, the characteristic value is added to the preset function to obtain the target calling function, and the target calling function is sent to the initial class instance, wherein after receiving the target calling function, the initial class instance executes the target calling function to obtain the characteristic value, and determines the characteristic value as the target calling content.

5. The method according to claim 1, characterized in that Generating a target call function by using a preset function and the target call feature, and sending the target call function to the initial class instance comprises: Obtaining a feature value corresponding to the target call feature from the operation and maintenance end; In the case where the characteristic value is not obtained, the target calling function is determined in the function library according to the target calling characteristic, and the target calling function is sent to the initial class instance, wherein after receiving the target calling function, the initial class instance executes the preset operation carried in the target calling function to obtain the target calling content, and the function library includes multiple initial functions.

6. The method according to claim 1, characterized in that Before determining whether the target call content corresponding to the target call feature is stored in the target class instance, the method further includes: Acquire the multiple contents to be called, and store the multiple contents to be called in the target class instance; A proxy instance is set for the target class instance, wherein the proxy instance is used to receive a call request sent to the target class instance.

7. The method according to claim 4, characterized in that After generating a target calling function by using a preset function and the target calling feature, the method further includes: The feature value is stored in the target class instance.

8. An information calling device, characterized in that: include: A parsing unit, used to intercept the call request sent by the initial class instance, and parse the call request to obtain the target call feature; A first judgment unit is used to judge whether a target calling content corresponding to the target calling feature is stored in a target class instance, wherein the target class instance stores a plurality of contents to be called, and the target class instance is associated with the initial class instance through a proxy instance; a returning unit, configured to return the target calling content to the initial class instance if the target calling content is stored in the target class instance; A generating unit is used to generate a target calling function by using a preset function and the target calling feature when the target calling content is not stored in the target class instance, and send the target calling function to the initial class instance, wherein the target calling function is used to obtain the target calling content.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the information calling method described in any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the information calling method described in any one of claims 1 to 7.