Data processing method and system, computer equipment and storage medium
By configuring the data automatically injecting the request class to call the target interface, the problem that a single interface call in the prior art cannot meet the interaction of multiple services is solved, and data interaction and code flexibility between multiple services is realized.
Patent Information
- Application Number
- CN202411327716.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art interface calling methods only support a single external service call and cannot adapt to the interaction between multiple services under the complex microservice architecture.
Through the interface configuration data automatically injects the request class to call the target interface, realizes dynamic calls of multiple interfaces, reduces duplicate encoding work, and promotes data interaction between multiple services.
It realizes data interaction between multiple services, reduces duplicate encoding work, and improves the maintainability and scalability of the system.
Smart Images

Figure CN119440870A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, system, computer device and storage medium. Background Art
[0002] The interface calling method of the prior art usually only supports a single external service call, which is converted into a fixed format file such as json or xml through a simple SQL query. This single interaction mode is not suitable for the interaction between multiple services under the complex microservice architecture. Summary of the invention
[0003] The purpose of this application is to provide a data processing method, system, computer device and storage medium, which can solve the above-mentioned technical problems, automatically inject request classes through interface configuration data to call the target interface, realize dynamic calling of multiple interfaces, reduce repeated coding work, and promote data interaction between multiple services.
[0004] In order to solve the above technical problems, in a first aspect, the present application provides a data processing method, comprising:
[0005] Acquire interface configuration data, where the interface configuration data at least includes calling parameters of the first target interface;
[0006] Generate a request class and a request method, inject the first target interface into the request class according to the interface configuration data, and assemble the calling parameters of the first target interface in the request method;
[0007] In response to the call request of the first target interface, obtaining input parameters of the first target interface;
[0008] A request object of the request class is created according to input parameters of the first target interface, and the request method is executed on the request object to call the first target interface through the calling parameters of the first target interface.
[0009] In one embodiment, the interface configuration data further includes a return parameter of the first target interface and a call parameter of the second target interface. After generating the request class and the request method, the method further includes:
[0010] Injecting the second target interface into the request class, and assembling the calling parameters of the second target interface in the request method;
[0011] After executing the request method on the request object to call the first target interface through the calling parameters of the first target interface, the method further includes:
[0012] Obtaining a return result of calling the first target interface;
[0013] According to the return parameter of the first target interface and the call parameter of the second target interface, converting the return result of the first target interface into the input parameter of the second target interface;
[0014] Creating a request object of the request class according to the input parameters of the second target interface;
[0015] The request method is executed on the request object to call the second target interface through the calling parameters of the second target interface.
[0016] In one embodiment, converting the return result of the first target interface into the input parameter of the second target interface according to the return parameter of the first target interface and the call parameter of the second target interface includes:
[0017] Generate a converter interface according to the return parameter of the first target interface and the call parameter of the second target interface;
[0018] The converter interface is called to convert output data of the first target interface into input parameters of the second target interface.
[0019] In one implementation, the interface configuration data further includes a mapping relationship between a return parameter of the first target interface and a call parameter of the second target interface, and the generating of the converter interface includes:
[0020] If the output parameter of the first target interface is inconsistent with the input parameter of the second target interface, the converter interface is generated according to the mapping relationship.
[0021] In one implementation, the obtaining of configuration data of the first target interface includes:
[0022] The interface configuration data is obtained based on the front-end page.
[0023] In one embodiment, the method further comprises:
[0024] Acquire return data of calling the first target interface and / or the second target interface;
[0025] Performing preset processing on the returned data, wherein the preset processing includes at least one of encryption, signature addition, and format conversion;
[0026] The processed return data is sent to the initiator of the call request.
[0027] In one embodiment, before creating a request object of the request class according to the input parameters of the first target interface and executing the request method on the request object to call the first target interface through the call parameters of the first target interface, the method further includes at least one of the following:
[0028] If the input parameter of the first target interface is encrypted transmission, decryption processing is performed;
[0029] Verifying the request signature contained in the input parameters of the first target interface;
[0030] Perform data verification on input parameters of the first target interface.
[0031] In a second aspect, the present application further provides a data processing system, including a first server, a platform, and a second server; wherein:
[0032] The first server is used to provide the interface configuration data to the platform, wherein the interface configuration data at least includes the calling parameters of the first target interface;
[0033] The second server is used to send a call request of the first target interface to the platform;
[0034] The platform end is used to obtain interface configuration data, generate a request class and a request method according to the interface configuration data, inject an instance of the first target interface into the request class, and assemble the calling parameters of the first target interface in the request method; and, in response to a calling request of the first target interface, obtain the input parameters of the first target interface, create a request object of the request class according to the input parameters of the first target interface, and execute the request method on the request object to call the first target interface through the calling parameters of the first target interface.
[0035] In a third aspect, the present application also provides a computer device, including: a processor, a memory, and a network interface;
[0036] The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the data processing method as described above.
[0037] In a fourth aspect, the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the data processing method as described above.
[0038] The data processing method, system, computer device and storage medium data processing method of the present application include: obtaining interface configuration data, the interface configuration data at least including the calling parameters of the first target interface. Generate a request class and a request method, inject an instance of the first target interface into the request class according to the interface configuration data, and assemble the calling parameters of the first target interface in the request method. In response to the calling request of the first target interface, obtain the input parameters of the first target interface. Create a request object of the request class according to the input parameters of the first target interface, execute the request method on the request object, and call the first target interface through the calling parameters of the first target interface. The present application automatically injects the request class to call the target interface through the interface configuration data, which can realize the dynamic calling of multiple interfaces, reduce the repeated coding work, and promote the data interaction between multiple services.
[0039] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following specifically cites the preferred embodiments and describes them in detail with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is one of the flow charts of the data processing method according to the embodiment of the present application.
[0041] Figure 2 It is a schematic diagram of a front-end page according to an embodiment of the present application.
[0042] Figure 3 This is the second flowchart of the data processing method according to the embodiment of the present application.
[0043] Figure 4 This is the third flow chart of the data processing method according to the embodiment of the present application.
[0044] Figure 5 It is a structural diagram of a data processing system according to an embodiment of the present application.
[0045] Figure 6 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined application purpose, the specific implementation methods, methods, steps, structures, characteristics and effects of the data processing method, system, computer equipment and storage medium proposed in the present application are described in detail below in combination with the accompanying drawings and preferred embodiments.
[0047] The aforementioned and other technical contents, features and effects of the present application will be clearly presented in the following detailed description of the preferred embodiments with reference to the drawings. Through the description of the specific implementation methods, the technical means and effects adopted by the present application to achieve the predetermined purpose can be more deeply and specifically understood. However, the drawings are only for reference and explanation purposes and are not used to limit the present application.
[0048] The Battery Swap Ecosystem involves multiple participants, including but not limited to battery manufacturers, electric vehicle manufacturers, battery swap station operators, charging facility providers, payment solution providers, data analysis companies, and various service providers. In order to ensure that these different entities can work together, an open platform is needed to act as a middleware, which is responsible for standardized interfaces, data exchange, and business logic processing. The data processing method of an embodiment of the present application provides a basic interface based on downstream services, and automatically generates an external unified interface through parameter configuration on an open platform, which can realize data interaction between multiple services.
[0049] Please refer to Figure 1 , the embodiment of the present application provides a data processing method, which can be applied to the open platform as described above, including:
[0050] Step S1, obtaining interface configuration data, where the interface configuration data at least includes calling parameters of a first target interface.
[0051] In this embodiment, the interface configuration data refers to the configuration parameters used to call a specific interface, and the interface configuration data includes at least the calling parameters of the first target interface. The first target interface can be an RPC (Remote Procedure Call) interface provided by the downstream service. The calling parameters of the first target interface include but are not limited to the interface request type, interface request path, interface full path, and request parameter full path of the first target interface. Among them, the interface request type is used to define the HTTP method for communication between the client and the server, including but not limited to GET (retrieve data from the server), POST (send data to the server to create or update resources), PUT (replace existing resources), and DELETE (remove resources). The interface request path is the request URL (Uniform Resource Locator), which refers to the entry point for calling the downstream service, that is, the network location of the service. The full path of the interface refers to the complete class path of the downstream service, including the fully qualified name of the package name and class name, and the method name to be called. The full path of the request parameter refers to the class definition of the parameters that need to be passed when calling the downstream service, such as the Java class of the parameters required for calling the downstream service.
[0052] Step S2, generating a request class and a request method, injecting the first target interface into the request class according to the interface configuration data, and assembling the calling parameters of the first target interface in the request method.
[0053] In this embodiment, the Java reflection mechanism can be used to dynamically generate the Controller request class and request method. The Controller request class is a class in a Web application that is responsible for receiving and processing HTTP requests and sending responses to the client. The request method is a specific method defined in the Controller request class and is designed to handle specific HTTP request types and paths. The Controller request class usually contains multiple request methods, each of which corresponds to a different HTTP request type (such as GET, POST, etc.) and is usually mapped to a specific URL path.
[0054] The request class can build and generate requests according to the interface configuration data, which encapsulates the request logic, including setting the URL, filling the request parameters and processing the request response. In object-oriented programming, a class may rely on other classes or interfaces to complete its functions. Dependency injection is a design pattern that allows these dependencies to be dynamically inserted into the class at runtime, rather than hard-coded inside the class. In this embodiment, an instance of the first target interface is injected into the request class, that is, the request class depends on the implementation of the first target interface, and this dependency is not directly created in the request class, but outside the request class, through the dependency injection container (such as the Spring framework), the instance of the service interface is passed to the request class at runtime. In the request class, there are one or more request methods, which are responsible for calling the first target interface. Before calling the interface, these methods need to assemble the correct call parameters according to the interface configuration data, including extracting parameter values from the HTTP request, building complex request bodies, formatting dates or numbers, etc. After the parameters are assembled, the request method can use these parameters to call the first target interface. In this way, the request class can dynamically interact with different service implementations without modifying its code, which increases the flexibility and testability of the code, improves the maintainability and scalability of the system, and makes calls between services more flexible and efficient.
[0055] Step S3: in response to the calling request of the first target interface, obtaining input parameters of the first target interface.
[0056] In this embodiment, the external service or client assembles the input parameters for calling the first target interface and generates a call request based on the interface document. After receiving the call request for calling the first target interface from the external service or client, the open platform parses the input parameters required for the first target interface from the call request. The input parameters include but are not limited to encryption parameters, signature parameters, business parameters, and authentication parameters. Specifically, encryption parameters refer to certain sensitive or important data that are encrypted before the request is sent. Signature parameters refer to the usual signature in the call request to ensure the integrity of the request and the authenticity of the source. Business parameters refer to parameters related to business logic, which are used to describe the specific requirements of the request. Authentication parameters refer to API keys, tokens, etc., which are used to verify whether the requester has the authority to call the interface.
[0057] Step S4, creating a request object of the request class according to the input parameters of the first target interface, and executing the request method on the request object to call the first target interface through the calling parameters of the first target interface.
[0058] In this embodiment, the request class creates a request object based on the input parameters obtained from the call request. The request object contains all the information necessary to call the first target interface. The request object contains a request method for executing the actual service call. The request method is executed on the request object, that is, the request method is called to trigger the calling process of the first target interface.
[0059] In some embodiments, the interface configuration data further includes a return parameter of the first target interface and a call parameter of the second target interface. After the request class and the request method are generated, the data processing method further includes:
[0060] Inject the second target interface into the request class, and assemble the calling parameters of the second target interface in the request method;
[0061] After executing the request method on the request object to call the first target interface through the call parameters of the first target interface, the data processing method further includes:
[0062] Obtain the return result of calling the first target interface;
[0063] According to the return parameter of the first target interface and the call parameter of the second target interface, converting the return result of the first target interface into the input parameter of the second target interface;
[0064] A request object of the request class is created according to the input parameters of the second target interface, and a request method is executed on the request object to call the second target interface through the call parameters of the second target interface.
[0065] As an implementation method of this embodiment, the return parameters of the first target interface and the call parameters of the second target interface can be input in the interface configuration data. Among them, the return parameters of the first target interface may include the class path of the return result of the first target interface (i.e., the type of the return result). The call parameters of the second target interface may include the full path of the request parameters of the second target interface, including the class path of the call request of the second target interface (i.e., the request parameter type). When the return type of the previous interface call and the parameter type required for the next call are known, the type conversion logic can be pre-defined or automatically generated by programming means to convert the return result of the first target interface into the input parameter of the second target interface.
[0066] First, an instance of the second target interface is injected into the request class, and before calling the second target interface, the calling parameters of the second target interface are assembled in the request method. After receiving the return result of the first target interface, the type conversion logic is generated according to the return parameters of the first target interface and the calling parameters of the second target interface to convert the return result of the first target interface into the input parameters of the second target interface. Then, the request class creates a request object according to the input parameters of the second target interface. This request object contains all the information necessary to call the second target interface. The request object contains a request method for executing the actual service call. The request method is executed on the request object, that is, the request method is called to trigger the calling process of the second target interface. In this way, chain calls between multiple target interfaces can be realized.
[0067] Let's take a specific example to illustrate. In the microservice architecture, the request chain can be called in sequence through a series of downstream services to process a composite request. When the external service requests the development platform to obtain the list of battery swap stations, the external service or client initiates an interface call request to the open platform to obtain the list information of the battery swap stations. Obtaining the list information of the battery swap stations involves three downstream services, namely:
[0068] Downstream service 1: Query basic information of battery swap stations.
[0069] Downstream service 2 queries the battery information of the battery swap station based on the return data of downstream service 1.
[0070] Downstream service 3 queries the vehicle queue information based on the return data of downstream service 2.
[0071] The open platform is responsible for integrating the data of the above-mentioned multiple downstream services. Specifically, downstream service 1 is the first downstream service to be called, which is used to obtain basic information of the battery swap station, such as location, status, etc., from the database or cache. After receiving the return result of service 1, the open platform converts it into the input parameter of downstream service 2, and further calls the interface of downstream service 2 to query the battery information related to the battery swap station, such as the battery model, charging status, etc. Then, after receiving the return result of service 2, the open platform converts it into the input parameter of downstream service 3, and further calls the interface of downstream service 3 to query the vehicle queue related to the battery swap station, which may include the number of queued vehicles, expected waiting time, etc. These downstream services form a request chain through a series of calls. Each step depends on the output of the previous step, and finally summarizes it into a complete response and returns it to the original requester, which can realize the decomposition and modular processing of complex business logic in the microservice architecture.
[0072] In some embodiments, converting the return result of the first target interface into the input parameter of the second target interface according to the return parameter of the first target interface and the call parameter of the second target interface includes:
[0073] generating a converter according to an output parameter of the first target interface and an input parameter of the second target interface;
[0074] The converter is called to convert the output data of the first target interface into the input parameters of the second target interface.
[0075] As an implementation method of this embodiment, a MapStruct plug-in is used to automatically generate a Convertor converter interface. It should be noted that MapStruct is a code generator that can simplify the mapping between Java objects. When a mapping method is declared in a Java interface, MapStruct can automatically generate the specific implementation code of this method. This can reduce the workload of manually writing conversion logic and also reduce the possibility of errors.
[0076] Extract the class path of the result returned by the first target interface from the return parameter of the first target interface, and extract the class path of the call request of the second target interface from the call parameter of the second target interface. Use the MapStruct plug-in to create a Convertor interface, and define the conversion method according to the class path of the result returned by the first target interface and the class path of the call request of the second target interface. Then inject an instance of the Convertor interface into the request class to automatically convert the result returned by the first target interface into the input parameter of the second target interface. The Converter interface can ensure the consistency and compatibility of data formats between different services.
[0077] In some embodiments, the interface configuration data further includes a mapping relationship between a return parameter of the first target interface and a call parameter of the second target interface, and generating the converter includes:
[0078] If the output parameters of the first target interface are inconsistent with the input parameters of the second target interface, a converter is generated according to the mapping relationship.
[0079] As an implementation method of this embodiment, if the parameter types or parameter names of the output parameters of the first target interface and the input parameters of the second target interface are inconsistent, the mapping relationship between the return parameters of the first target interface and the call parameters of the second target interface in the interface configuration data is obtained. A converter interface is generated according to the mapping relationship, and a conversion method of the parameter type or parameter name is defined in the converter interface to achieve data conversion. If the parameter types and parameter names of the two are consistent, there is no need to generate a converter interface according to the mapping relationship.
[0080] In some embodiments, obtaining configuration data of the first target interface includes:
[0081] Get interface configuration data based on the front-end page.
[0082] As an implementation method of this embodiment, Figure 2 As shown, a front-end page template for multiple RPC interface calls is displayed. In this page template, different interface configuration data is obtained through different fields. Specifically, in the request method type column, the interface request type of the first target interface can be obtained. In the request URL column, the interface request path can be obtained. In the downstream service class RPC information, the full path of the first target interface can be obtained. In the return result business class column, the return parameters of the first target interface can be obtained. In the downstream service class request parameter class column, the full path of the request parameter class can be obtained. In the parameter mapping relationship column, the mapping relationship between the return parameters of the first target interface and the call parameters of the second target interface can be obtained. In the last column, the full path of the second target interface can be obtained.
[0083] In some embodiments, the data processing method further includes:
[0084] Acquire return data of calling the first target interface and / or the second target interface;
[0085] Performing preset processing on the returned data, the preset processing including at least one of encryption, signature addition, and format conversion;
[0086] Send the processed return data to the initiator of the call request.
[0087] As an implementation method of this embodiment, after the interface call is completed, for the return data of the first target interface and / or the second target interface, before returning to the initiator of the call request (i.e., the external service), the data needs to be pre-processed, including but not limited to encryption, adding signatures, and converting formats. Among them, encryption refers to encrypting sensitive data to prevent it from being intercepted or tampered with during transmission. Adding a signature is to verify the source of the data and that it has not been tampered with, and a digital signature can be used. Digital signatures are usually generated based on the sender's private key, and the recipient can use the sender's public key to verify the signature to ensure the integrity of the data and the identity of the sender. The conversion format can be performed according to the requirements of the initiator. For example, convert the JSON format to the XML format, or adjust the order and structure of the data fields to meet the specifications of a specific API. Finally, the processed return data is sent to the initiator.
[0088] In some embodiments, before creating a request object of a request class according to input parameters of the first target interface and executing a request method on the request object to call the first target interface through the call parameters of the first target interface, the data processing method further includes at least one of the following:
[0089] If the input parameter of the first target interface is encrypted transmission, decryption processing is performed;
[0090] Verifying a request signature included in an input parameter of the first target interface;
[0091] Perform data verification on the input parameters of the first target interface.
[0092] As an implementation method of this embodiment, after obtaining the input parameters of the first target interface, if the input parameters are transmitted in encrypted form, it is necessary to use the corresponding key and algorithm to decrypt the encrypted data and restore it to the original plaintext data. If the input parameters contain a digital signature, the sender's public key can be used to verify the signature to confirm the integrity of the data and the identity of the sender. In addition, a series of checks are required on the input parameters, such as checking whether the parameters exist, whether they are empty, whether they conform to the expected data type, whether they are within the allowed range, etc., to prevent program errors or security vulnerabilities caused by invalid input.
[0093] The data processing method of the embodiment of the present application obtains interface configuration data, and the interface configuration data at least includes the calling parameters of the first target interface. Generate a request class and a request method, inject an instance of the first target interface into the request class according to the interface configuration data, and assemble the calling parameters of the first target interface in the request method. In response to the calling request of the first target interface, obtain the input parameters of the first target interface. Create a request object of the request class according to the input parameters of the first target interface, execute the request method on the request object, and call the first target interface through the calling parameters of the first target interface. The embodiment of the present application automatically injects the request class with interface configuration data to call the target interface, which can realize the dynamic calling of multiple interfaces, reduce repeated coding work, and promote data interaction between multiple services.
[0094] Please refer to Figure 3 In some embodiments, the developer configures the RPC interface information on the front-end page, such as the interface URL path, the request method type, the association mapping relationship between the first RPC interface and the second RPC interface, etc. The open platform reads and saves the above interface configuration data to the database, and dynamically generates an interface based on the interface configuration data, and defines the call to the RPC interface in the method corresponding to the interface. When the external service assembles the interface request information according to the interface document provided by the open platform, it sends an interface call request to the server of the open platform. The open platform decrypts and verifies the input parameters of the RPC interface provided by the external service, calls the corresponding RPC interface, and assembles and processes the results returned by the RPC interface and sends them to the external service.
[0095] Please refer to Figure 4 In some embodiments, the external service requests a business interface from the open platform, and the open platform requests a corresponding RPC interface from the downstream service 1. After the downstream service 1 returns the business result, it determines whether the next RPC call is configured. If the next RPC call is configured, the returned business result mapping is converted into a new RPC interface request to call the corresponding RPC interface to the downstream service 2. After the downstream service 2 returns the business result, the business result is included as a general instance, and is returned to the external service after encryption and signature. If the next RPC call is not configured after calling the RPC interface of the downstream service 1, the business result returned by the downstream service 1 is processed and returned to the external service.
[0096] like Figure 5 As shown, the embodiment of the present application further provides a data processing system 60, including:
[0097] The first service end 70, i.e., the downstream service, is used to provide interface configuration data to the platform end 90, where the interface configuration data at least includes the calling parameters of the first target interface;
[0098] The second service end 80, i.e., the external service, is used to send a call request of the first target interface to the platform end 90;
[0099] The platform end 90 is used to obtain interface configuration data, generate a request class and a request method, inject the first target interface into the request class according to the interface configuration data, assemble the call parameters of the first target interface in the request method; and, in response to the call request of the first target interface, obtain the input parameters of the first target interface. Create a request object of the request class according to the input parameters of the first target interface, and execute the request method on the request object to call the first target interface through the call parameters of the first target interface.
[0100] For the specific working process and steps of the data processing system of this embodiment, please refer to the description of the data processing method and its implementation method, which will not be repeated here.
[0101] Based on the same inventive concept as the above embodiments, the embodiments of the present invention further provide an electronic device, such as Figure 6 As shown, the electronic device includes: a processor 310 and a memory 311 storing a computer program; wherein, Figure 6 The processor 310 shown in the figure is not used to indicate that the number of the processor 310 is one, but is only used to indicate the positional relationship of the processor 310 relative to other devices. In actual applications, the number of the processor 310 may be one or more; similarly, Figure 6 The memory 311 shown in the figure has the same meaning, that is, it is only used to refer to the position relationship of the memory 311 relative to other devices. In practical applications, the number of memories 311 can be one or more. When the processor 310 runs the computer program, the above method is implemented.
[0102] The electronic device may also include: at least one network interface 312. The various components in the electronic device are coupled together via a bus system 313. It is understood that the bus system 313 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 313 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 313 is not described in detail. Figure 6 Various buses are labeled as bus system 313.
[0103] The memory 311 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 311 described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable types of memories.
[0104] The memory 311 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device. Examples of these data include: any computer program used to operate on the electronic device, such as an operating system and an application; contact data; phone book data; messages; pictures; videos, etc. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application program may include various applications, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. Here, the program that implements the method of the embodiment of the present invention may be included in the application program.
[0105] Based on the same inventive concept as the above-mentioned embodiment, this embodiment further provides a computer-readable storage medium, in which a computer program is stored. The computer-readable storage medium may be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); or various devices including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc. When the computer program stored in the computer-readable storage medium is run by the processor, the above method or system is implemented. For the specific steps implemented when the computer program is executed by the processor, please refer to the description of the above embodiment, which will not be repeated here.
[0106] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0107] In this document, the terms "comprises," "comprising," or any other variations thereof, are intended to cover a non-exclusive inclusion of elements other than those listed and may also include additional elements not expressly listed.
[0108] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: include: Acquire interface configuration data, where the interface configuration data at least includes calling parameters of the first target interface; Generate a request class and a request method, inject the first target interface into the request class according to the interface configuration data, and assemble the calling parameters of the first target interface in the request method; In response to the call request of the first target interface, obtaining input parameters of the first target interface; A request object of the request class is created according to input parameters of the first target interface, and the request method is executed on the request object to call the first target interface through the calling parameters of the first target interface.
2. The method according to claim 1, characterized in that The interface configuration data also includes the return parameters of the first target interface and the call parameters of the second target interface. After the request class and the request method are generated, the method further includes: Injecting the second target interface into the request class, and assembling the calling parameters of the second target interface in the request method; After executing the request method on the request object to call the first target interface through the calling parameters of the first target interface, the method further includes: Obtaining a return result of calling the first target interface; According to the return parameter of the first target interface and the call parameter of the second target interface, converting the return result of the first target interface into the input parameter of the second target interface; Creating a request object of the request class according to the input parameters of the second target interface; The request method is executed on the request object to call the second target interface through the calling parameters of the second target interface.
3. The method according to claim 2, characterized in that The converting the return result of the first target interface into the input parameter of the second target interface according to the return parameter of the first target interface and the calling parameter of the second target interface includes: Generate a converter interface according to the return parameter of the first target interface and the call parameter of the second target interface; The converter interface is called to convert output data of the first target interface into input parameters of the second target interface.
4. The method according to claim 3, characterized in that The interface configuration data also includes a mapping relationship between a return parameter of the first target interface and a call parameter of the second target interface. The generating of the converter interface includes: If the output parameter of the first target interface is inconsistent with the input parameter of the second target interface, the converter interface is generated according to the mapping relationship.
5. The method according to any one of claims 1 to 4, characterized in that: The obtaining of configuration data of the first target interface includes: The interface configuration data is obtained based on the front-end page.
6. The method according to claim 2, characterized in that The method further comprises: Acquire return data of calling the first target interface and / or the second target interface; Performing preset processing on the returned data, wherein the preset processing includes at least one of encryption, signature addition, and format conversion; The processed return data is sent to the initiator of the call request.
7. The method according to claim 1, characterized in that Before creating a request object of the request class according to the input parameters of the first target interface and executing the request method on the request object to call the first target interface through the call parameters of the first target interface, the method further includes at least one of the following: If the input parameter of the first target interface is encrypted transmission, decryption processing is performed; Verifying the request signature contained in the input parameters of the first target interface; Perform data verification on input parameters of the first target interface.
8. A data processing system, characterized in that: It includes a first server, a platform, and a second server; wherein, The first server is used to provide the interface configuration data to the platform, wherein the interface configuration data at least includes the calling parameters of the first target interface; The second server is used to send a call request of the first target interface to the platform; The platform end is used to obtain interface configuration data, generate a request class and a request method according to the interface configuration data, inject an instance of the first target interface into the request class, and assemble the calling parameters of the first target interface in the request method; and, in response to a calling request of the first target interface, obtain the input parameters of the first target interface, create a request object of the request class according to the input parameters of the first target interface, and execute the request method on the request object to call the first target interface through the calling parameters of the first target interface.
9. A computer device, characterized in that: include: processor and memory and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 7.