Data processing method between application components and related equipment

By deploying middleware in the application for data format conversion, the problem of data communication between private cloud components and other components in the application is solved, efficient component deployment and maintenance is achieved, and maintenance costs are reduced.

CN120020729APending Publication Date: 2025-05-20TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311547086.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2025-05-20

AI Technical Summary

Technical Problem

When private cloud components access applications, private cloud components need to be customized to transform or develop them in order to communicate with other components in the application. As the application components are updated and iterated, they need to be maintained and developed accordingly, which is cumbersome and inefficient.

Method used

By deploying middleware in the application, the data conversion method library of the middleware is used to convert the service data to be sent to the second component to the data format to conform to the data format of the second component, thereby realizing data communication between the two.

Benefits of technology

It realizes data communication between components that cannot be directly communicated, reduces the maintenance cost of private cloud components, improves the deployment efficiency of components in applications, and avoids the problem of long processing delays caused by server authentication and verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120020729A_ABST
    Figure CN120020729A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data processing method between application components and related equipment, middleware is deployed in an application of the method, and a first component and a second component which are not matched in data format need to be called in the application service execution process in the application. The method comprises the following steps: a service execution thread of an application service generates a calling request for a second component after calling a first component; if the middleware detects the calling request, obtaining service data carried by the calling request; the middleware obtains a data conversion method corresponding to the second component from a data conversion method library, calls the data conversion method corresponding to the second component, and performs data format conversion on the service data to obtain the service data matched with the data format of the second component; and the middleware sends the converted service data to the second component, so that the second component performs service processing on the converted service data. According to the technical scheme provided by the embodiment of the invention, the components which cannot directly communicate can realize data communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer and communication technologies. Specifically, it relates to a data processing method, apparatus, electronic device, computer-readable medium, and computer program product for application components. Background Art

[0002] A component is a reusable program unit with specific functions. An application often needs to call different components to complete the functions required by the application. In actual use, the components called by the application may be private cloud components (i.e., components with different development manufacturers from the application's development manufacturer), so they cannot directly communicate with the native components in the application or other private cloud components in the application.

[0003] Therefore, when a private cloud component is accessed by an application, it is necessary for the provider of the private cloud component to perform customized transformation or development on the private cloud component during delivery so that the components in the application can communicate with the private cloud component. With the subsequent update and iteration of the components in the application, corresponding maintenance and development iteration also need to be carried out for the data communication of the private cloud component, which is troublesome and inefficient. Therefore, how to enable components that cannot directly communicate to achieve data communication is an urgent problem to be solved currently. Summary of the Invention

[0004] Embodiments of this application provide a data processing method, a data processing apparatus, an electronic device, a computer-readable medium, and a computer program product for application components, which can enable components that cannot directly communicate to achieve data communication.

[0005] Other features and advantages of this application will become apparent through the following detailed description, or be learned in part through the practice of this application.

[0006] In a first aspect, embodiments of this application provide a data processing method for application components. There is middleware deployed in the application. When the application services in the application are executed, they need to call a first component and a second component with mismatched data formats. The method includes:

[0007] After the business execution thread of the application service calls the first component, a call request for the second component is generated; wherein, the call request carries the business data that the first component is to send to the second component.

[0008] If the middleware detects the call request, it obtains the business data carried by the call request.

[0009] The middleware obtains the data conversion method corresponding to the second component from the data conversion method library; wherein, the data conversion method library pre-stores the data conversion methods corresponding to multiple candidate components.

[0010] The middleware invokes the data conversion method corresponding to the second component to perform data format conversion on the service data, and obtains service data that matches the data format of the second component;

[0011] The middleware sends the converted service data to the second component;

[0012] The second component performs service processing on the converted service data to obtain a service processing result.

[0013] In a second aspect, an embodiment of the present application provides a data processing system between application components. The system includes a middleware deployed in an application, a service execution thread for the application service in the application, a first component and a second component with mismatched data formats in the application, and the application service needs to invoke the first component and the second component during execution;

[0014] The service execution thread is used to generate a call request for the second component after invoking the first component; wherein, the call request carries the service data to be sent from the first component to the second component;

[0015] The middleware is used to obtain the service data carried by the call request if the call request is detected;

[0016] The middleware is further used to obtain the data conversion method corresponding to the second component from a data conversion method library; wherein, the data conversion method library pre-stores data conversion methods corresponding to multiple candidate components;

[0017] The middleware is further used to invoke the data conversion method corresponding to the second component to perform data format conversion on the service data, and obtain service data that matches the data format of the second component;

[0018] The middleware is further used to send the converted service data to the second component;

[0019] The second component is used to perform service processing on the converted service data to obtain a service processing result.

[0020] In a third aspect, an embodiment of the present application provides an electronic device, including one or more processors; a storage device for storing one or more computer programs, and when the one or more computer programs are executed by the one or more processors, the electronic device implements the data processing method between application components as described above.

[0021] Fourthly, an embodiment of the present application provides a computer-readable medium, on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method between application components as described above.

[0022] Fifthly, an embodiment of the present application provides a computer program product, including a computer program. The computer program is stored in a computer-readable medium, and a processor of an electronic device reads and executes the computer program from the computer-readable medium, so that the electronic device executes the data processing method between application components as described above.

[0023] In the technical solution provided by the embodiment of the present application, through the data conversion method preset in the middleware, the data format of the service data to be sent from the first component to the second component can be converted into the data format adapted to the second component, so that the second component can successfully receive the converted service data, enabling two components that cannot communicate directly to achieve data communication. At the same time, in the embodiment of the present application, by deploying the middleware, the data communication process between the first component and the second component can be decoupled without invading the original communication mechanism. This method enables the private cloud component to no longer need to continuously perform secondary development as other components are updated and iterated, which is beneficial to reducing the maintenance cost of the private cloud component and improving the deployment efficiency of the private cloud component in the application.

[0024] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings here are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts. In the drawings:

[0026] Figure 1 is a schematic structural diagram of a data processing system between application components provided by an embodiment of the present application;

[0027] Figure 2 is a schematic structural diagram of another data processing system between application components provided by an embodiment of the present application;

[0028] Figure 3 is a schematic flowchart of a data processing method between application components provided by an embodiment of the present application;

[0029] Figure 4It is a schematic diagram of a service execution process provided by an embodiment of the present application;

[0030] Figure 5 It is a schematic structural diagram of a middleware provided by an embodiment of the present application;

[0031] Figure 6 It is a schematic flowchart of another data processing method between application components provided by an embodiment of the present application;

[0032] Figure 7 It is a schematic diagram of a classification file provided by an embodiment of the present application;

[0033] Figure 8 It is a schematic diagram of an initialization process of a middleware provided by an embodiment of the present application;

[0034] Figure 9 It is a schematic diagram of a middleware processing process provided by an embodiment of the present application;

[0035] Figure 10 It shows a schematic structural diagram of a computer system of an electronic device suitable for implementing an embodiment of the present application. Detailed implementation manners

[0036] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0037] The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0038] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.

[0039] The flowcharts shown in the accompanying drawings are merely illustrative and not necessarily inclusive of all content and operations, nor are they necessarily to be executed in the order described. For example, some operations may be decomposed, while some operations may be combined or partially combined, so the actual execution order may change according to the actual situation.

[0040] It should also be noted that: "a plurality of" as mentioned in this application means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0041] A private cloud is to create cloud infrastructure and software and hardware resources within a firewall for departments within an institution or enterprise to share the resources in the data center. To create a private cloud, in addition to hardware resources, there is generally also cloud device (IaaS, Infrastructure as a Service) software.

[0042] Private cloud computing also includes three levels: cloud hardware, cloud platform, and cloud services. The difference is that cloud hardware is the user's own personal computer or server, rather than the data center of a cloud computing vendor. The purpose of a cloud computing vendor to build a data center is to provide public cloud services for millions of users, so it needs to have hundreds of thousands of servers. For private cloud computing, it only serves friends and relatives for an individual, and only serves the employees of the enterprise, as well as the customers and suppliers of the enterprise for an enterprise. Therefore, an individual's or enterprise's own personal computer or server is sufficient to provide cloud services.

[0043] A public cloud usually refers to a cloud provided by a third-party provider for users. A public cloud can generally be used through the Internet and may be free or inexpensive. The core attribute of a public cloud is shared resource services. There are many instances of this kind of cloud that can provide services in today's entire open public network.

[0044] Among them, a private cloud only serves an individual or the corresponding enterprise. Therefore, the application components developed in a private cloud environment (also known as private cloud components) only need to be able to communicate with each other. In this case, there may be communication barriers between private cloud components and application components in a public cloud environment (also known as public cloud components) or application components in other private clouds. Public cloud components or private cloud components in other private cloud environments cannot directly receive the data sent by this private cloud component.

[0045] The traditional communication methods between application components mainly include direct communication (Parent-Child). Among them, direct communication means that a component passes data to a child component through properties (props), and the child component sends messages to the parent component through events (events). This method is only applicable to components developed by the same manufacturer (i.e., belonging to the same private cloud). Otherwise, secondary development needs to be carried out on third-party components.

[0046] Therefore, after purchasing private cloud components for an application, the development manufacturer of the private cloud components usually needs to customize or develop the private cloud components for the application during delivery so that other components in the application can communicate with the private cloud components for data. However, with the update and iteration of other components in the application, the development manufacturer of the private cloud components also needs to perform corresponding updates and iterations on the data communication between the components, which is troublesome and inefficient.

[0047] Based on this, the embodiments of the present application provide a data processing solution between application components. In the application of this solution, a middleware is deployed. When the application services in this application are executed, they need to call a first component and a second component that cannot directly communicate. The middleware includes a data conversion method library, and multiple data conversion methods corresponding to candidate components are preset in the data conversion method library.

[0048] After the middleware obtains the service data that the first component needs to send to the second component, it can call the data conversion method corresponding to the second component stored in the data conversion method library to convert the data format of the service data, so as to obtain service data that matches the data format of the second component, so that the second component can successfully receive the converted service data and perform service processing on it to obtain a service processing result.

[0049] Among them, middleware, also known as the mediation layer, is a type of software that provides a connection between system software and application software and facilitates communication between software components. Application software can share information and resources between different technical architectures with the help of middleware. Middleware is located above the operating system of the terminal device and manages computing resources and network communication. Simply put, middleware is a type of service program that can connect application components, which is conducive to resource sharing and function sharing.

[0050] In this solution, a data conversion method library is deployed inside the middleware, and this middleware is mainly used for data format conversion between components. Among them, the reason why two components cannot directly communicate is that the data formats between the two components do not match. The situation where the data formats do not match can specifically include that two components cannot directly transfer data, the service data sent by one component cannot be parsed by the other component, and so on.

[0051] In addition, the first component refers to a private cloud component where the development manufacturer is different from the application development manufacturer; the second component can be an application component developed by the application development manufacturer or a private cloud component developed by other development manufacturers, which is not limited herein.

[0052] In addition, when an application accesses a private cloud component, it has already been determined which components in the application need to receive the service data sent by the private cloud component for corresponding service processing; therefore, the candidate components include the components in the application that are predetermined to need to receive the service data sent by the first component.

[0053] It is not difficult to see that through the data conversion method preset in the middleware in this solution, the data format of the service data to be sent from the first component to the second component can be converted into the data format adapted by the second component, so that the second component can successfully receive the converted service data and then perform corresponding service processing. Thus, it can be seen that through the middleware in this solution, data communication between two components that cannot communicate directly can be achieved.

[0054] Based on the above data processing solution between application components, an embodiment of this application provides a data processing system between application components, as shown in Figure 1 , Figure 1 The data processing system between application components shown can include multiple terminal devices 101 and multiple servers 102. Among them, a communication connection is established between any terminal device and any server. For example, the terminal device 101 can include any one or more of a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart vehicle, and a smart wearable device. One or more applications such as a financial application, a video application, a social application, an information flow application, and an education application can run in the terminal device 101, and a middleware is deployed in any application. The server 102 can be a server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. A direct or indirect communication connection can be established between any terminal device 101 and any server 102 through a wired or wireless communication method, which is not limited in this application.

[0055] In some embodiments, the above data processing method between application components can be only by Figure 1It is executed by the middleware deployed in the application in the terminal device 101 shown, and the server 102 provides corresponding services for the application in the terminal device 101. The specific execution process is as follows: After the middleware detects a call request from the business execution thread of the application service in the application to the second component, it can obtain the service data carried by the call request; wherein, the call request is generated after the business execution thread calls the first component, and the call request carries the service data that the first component is to send to the second component, and the first component and the second component cannot communicate directly (i.e., the data formats do not match). Then, the middleware can obtain the data conversion method corresponding to the second component from the data conversion method library and call the data conversion method corresponding to the second component to perform data format conversion on the service data to obtain service data that matches the data format of the second component; finally, the middleware can send the converted service data to the second component so that the second component can perform business processing on the converted service data to obtain a business processing result.

[0056] Based on the above data processing solution between application components, the embodiments of the present application further provide another data processing system between application components, which can be seen Figure 2 , Figure 2 is a schematic structural diagram of another data processing system between application components provided by the embodiments of the present application. Figure 2 The data processing system between the application components shown includes a business execution thread 201 of the application service in the application running on the terminal device, a first component 202, a second component 203, and a middleware 204. Among them, the first component 202 and the second component 203 cannot communicate directly, and the business execution thread 201 needs to call the first component 202 and the second component 203 during the execution of the application service. Communication connections can be established between the middleware 204 and the business execution thread 201, the business execution thread 201 and the first component 202, and the second component 203.

[0057] In some embodiments, the above data processing method between application components can be performed by Figure 2The service execution thread 201, the second component 203, and the middleware 204 shown above execute together. The specific execution process includes: after the service execution thread 201 calls the first component, it can generate a call request for the second component; among them, the call request carries the service data that the first component is to send to the second component. If the middleware 204 detects a call request for the second component, it obtains the service data carried by the call request; then, the middleware 204 can obtain the data conversion method corresponding to the second component from the data conversion method library and call the data conversion method corresponding to the second component to perform data format conversion on the service data to obtain service data that matches the data format of the second component. Finally, the middleware 204 can send the converted service data to the second component 203, so that the second component 203 performs service processing on the converted service data to obtain a service processing result.

[0058] It should be noted that the embodiments of the present application can be used for component communication in various applications such as game applications, video applications, financial applications, and map applications, and can be applied to various scenarios, including but not limited to various scenarios such as cloud technology, AI (Artificial Intelligence), and intelligent transportation, and are not limited thereto.

[0059] In the specific implementation manner of the present application, if data such as service data is related to an object, when the embodiments of the present application are applied to a specific product or technology, object permission or consent needs to be obtained, and the collection, use, and processing of relevant information or data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.

[0060] The following elaborates in detail on various implementation details of the technical solutions of the embodiments of the present application:

[0061] As Figure 3 shown, Figure 3 is a schematic flowchart of a data processing method between application components shown in an embodiment of the present application. This method can be applied to Figure 2 the data processing system between application components shown above. This method can be jointly executed by the service execution thread of the application service in the application, the first component, the second component, and the middleware. Among them, the data processing method between application components can include S301 to S306, which are introduced in detail as follows:

[0062] S301. After the service execution thread of the application service calls the first component, it generates a call request for the second component.

[0063] In the embodiments of the present application, a component is for implementing a specific application function, and the implementation of one or more application functions can complete corresponding application services. Therefore, the callers of the first component and the second component can be the service execution threads of the corresponding application services. It should be noted that the data formats between the first component and the second component do not match (i.e., they cannot communicate directly).

[0064] Specifically, after an application receives a service request for an application service from a user, it will respond to the service request and create a service execution thread for the application service.

[0065] In addition, the call request for the second component carries the service data that the first component is to send to the second component. Specifically, the service request for the application service from the user may include the data to be processed uploaded by the user; then, the service execution thread of the application service can generate a call request for the first component, and the call request for the first component carries the aforementioned data to be processed. Therefore, the first component will perform corresponding service processing on the data to be processed, so as to obtain the service data to be sent to the second component, and return the service data to the service execution thread of the application service. After that, the service execution thread of the application service will generate a call request for the second component based on the service data.

[0066] For example, a financial application and a barcode scanning and recognition component in the financial application are developed in a public cloud environment, while the camera component in the financial application is a private cloud component purchased from a certain manufacturer developed in its private cloud environment. The camera component and the barcode scanning and recognition component cannot communicate directly.

[0067] Among them, the financial application includes a wealth management service, and this service needs to obtain the bank card information of the initiator of the service through the camera component and the barcode scanning and recognition component. Then, the financial application can respond to the service request for the wealth management service, create a wealth management service thread, call the camera component through the wealth management service thread, and after obtaining image data (equivalent to service data) by calling the camera component, the wealth management service thread can then call the barcode scanning and recognition component to perform bank card recognition.

[0068] S302. If the middleware detects a call request for the second component, obtain the service data carried by the call request.

[0069] In the embodiments of the present application, since it is mentioned above that the data formats between the first component and the second component do not match and they cannot communicate directly. And after the service execution thread calls the first component, it will synchronously send the service data to the second component when calling the second component. Therefore, the middleware can determine whether there is service data that needs to be intercepted by detecting the call request of the service execution thread for the second component.

[0070] In a possible implementation, the second component can be a component configured with a page jump communication protocol. Specifically, the page jump communication protocol is the scheme protocol, which is generally used for page jumps in mobile development and can be analogized to the URL (Uniform Resource Locator) for accessing web pages.

[0071] In addition, the configuration process of the page jump communication protocol of the second component is equivalent to indicating the communication protocol address of the second component. Therefore, the business execution thread can call the second component by generating the corresponding communication protocol address.

[0072] Specifically, the business execution thread of the application service can generate a call request for the second component based on the page jump communication protocol of the second component; among them, the call request for the second component contains a communication protocol address that matches the page jump communication protocol of the second component.

[0073] Then, the middleware can perform real-time detection of the communication protocol of the application to obtain a detection result; if the communication protocol address included in the detection result matches the page jump communication protocol, the middleware can determine that a call request for the second component is detected.

[0074] Among them, the communication protocol address is generated by the business execution thread of the application service after calling the first component. Therefore, if a communication protocol address that matches the page jump communication protocol is detected, it actually means that the business execution thread of the application service has finished calling the first component, and the business execution thread is waiting to call the second component to process the business data output by the first component. In a specific implementation, the middleware can pre-create an application proxy thread to perform real-time detection of the communication protocol of the application.

[0075] Furthermore, developers can configure the corresponding page jump communication protocol for the components in the application in the protocol configuration platform. Specifically, the protocol configuration platform can include a protocol name editing area for configuring the protocol name for the component. For example, the protocol name configured for the camera component can be "photo: / / ". Then, if the communication protocol address contains "photo: / / ", it can be determined that the communication protocol address matches the page jump communication protocol of the camera component.

[0076] Optionally, the protocol configuration platform can also include a function name editing area for configuring the function name of the component function in the component.

[0077] For example, the code scanning and recognition component includes two component functions: bank card recognition and ID card recognition. Among them, the protocol name configured for the bank card recognition function can be "bank_card", and the protocol name configured for the ID card recognition function can be "ID_card". Then, if the communication protocol address contains "photo: / / bank_card", it can be determined that the bank card recognition function of the code scanning and recognition component can be called through this communication protocol address; if the communication protocol address contains "photo: / / ID_card", it can be determined that the ID card recognition function of the code scanning and recognition component can be called through this communication protocol address.

[0078] Optionally, the protocol configuration platform may further include one or more of a component version editing area, a service type editing area, and a request parameter editing area.

[0079] Among them, the component version editing area is used to configure the version of the component; the component will be updated iteratively, and the component functions that different versions of the component can implement may be different. For example, the 1.0 version of the code scanning and recognition component can recognize bank cards, and the 2.0 version of the code scanning and recognition component can recognize bank cards and ID cards.

[0080] The service type editing area is used to configure the application services that can call the component; only the service execution threads of the application services that match the configured service type can call the component through the corresponding communication protocol address. For example, if the code scanning and recognition component is configured with two service types: financial management and transfer, then only the service execution threads corresponding to the financial management service and the transfer service in the financial application can generate the communication protocol address corresponding to the code scanning and recognition component, so as to call the code scanning and recognition component.

[0081] The request parameter editing area is used to configure the resource parameters of the component. For example, the resource parameter of the code scanning and recognition component can be the storage address of the image recognition model.

[0082] In specific implementation, since private cloud components are usually only available for use after being purchased by the application development manufacturer. And when purchasing, since the wider the scope of use of the private cloud component, the higher the required price; therefore, the business scenarios that can use the private cloud component, the components that can be associated with the private cloud component, the component functions, etc. are usually agreed with the provider of the private cloud component. And through the protocol configuration platform, the above information can be flexibly configured, so that the private cloud component can be connected to the application faster, which is beneficial to improving the deployment efficiency of the private cloud component.

[0083] In one embodiment, since it has been possible to determine the component function in the second component required during the service execution process by analyzing the communication protocol address as mentioned above; therefore, the middleware can obtain the service data carried by the call request in a callback (hook) manner.

[0084] Specifically, the specific process for the middleware to obtain business data may include: First, obtaining the code segment identifier of the execution code segment corresponding to the second component indicated by the communication protocol address; and, obtaining the method identifier of the instance method that matches the component function indicated by the communication protocol address in the execution code segment; then, creating a data acquisition function based on the code segment identifier and the method identifier; then, swapping the pointer pointing to the instance method with the pointer pointing to the data acquisition function to obtain the swapped data acquisition function; finally, based on the swapped data acquisition function, the business data to be sent by the first component to the second component can be obtained.

[0085] S303. The middleware obtains the data conversion method corresponding to the second component from the data conversion method library.

[0086] In the embodiment of the present application, data conversion methods corresponding to multiple candidate components are pre-set in the data conversion method library. The data conversion method may specifically be a piece of code for data format conversion.

[0087] Specifically, the component identifier of the candidate component and the data conversion method may be associated and stored in the data conversion method library. Therefore, the data conversion method corresponding to the second component can be obtained from the data conversion method library through the component identifier of the second component. Among them, the component identifier may specifically be a component name, the code segment identifier of the code segment corresponding to the component, etc., which is not limited herein.

[0088] In addition, the candidate component may specifically be: a component that needs to receive the business data sent by a private cloud component such as the first component in some business scenarios. Further, the component configured with the page jump communication protocol mentioned in step S302 is a component that needs to receive the business data sent by a private cloud component such as the first component; therefore, the candidate component may actually be a component configured with the corresponding page jump communication protocol on the protocol configuration platform.

[0089] S304. The middleware calls the data conversion method corresponding to the second component to perform data format conversion on the business data to obtain business data that matches the data format of the second component.

[0090] In the embodiment of the present application, since it is mentioned in step S302 that the data conversion method may be a piece of code, the specific process of data format conversion may include: the middleware loads the data conversion method corresponding to the second component to create a corresponding conversion thread; the middleware performs data format conversion on the business data through the created conversion thread to obtain business data that matches the data format of the second component.

[0091] In a possible implementation, the second component may include multiple component functions, and there may be slight differences in the data formats that different component functions can receive. Therefore, the data conversion method corresponding to the second component may specifically include the component conversion methods corresponding to each component function in the second component.

[0092] Then, the specific process of data format conversion may further include: obtaining the function identifier corresponding to the component function of the second component to be called during the execution of the application service; calling the component conversion method of the component function that matches the function identifier to perform data format conversion on the service data to obtain service data that matches the data format of the second component.

[0093] Optionally, if multiple application services are to call a certain component function of a certain component simultaneously, it is necessary to call the same component conversion method to perform data format conversion on multiple service data from multiple application services. Or, after an application service calls the first component, there may be multiple service data to be sent to a certain component function of the second component, which will also result in the need to call the same component conversion method to perform data format conversion on multiple service data.

[0094] Therefore, the service data may include multiple. To avoid the situation of data disorder caused by multi-threaded calls, the specific process of data format conversion may further include: 1) If there is target service data with the same component function to be called among multiple service data, the middleware can load the component conversion method corresponding to the called component function to create a conversion thread; 2) If the conversion thread receives any target service data, the middleware performs a locking process on the conversion thread to obtain the locked conversion thread, where the locked conversion thread refuses to receive other target service data; 3) After the middleware detects that any target data has successfully converted its data format, it performs an unlocking process on the locked conversion thread to receive other target service data through the unlocked conversion thread until all target service data is received.

[0095] In specific implementation, the locking process can be performed by adding a mutex lock to the conversion thread, and the unlocking process can be performed by releasing the mutex lock.

[0096] In another possible implementation, the number of application services may include multiple, and the first component and the second component that need to be called during the execution of different application services may be different. Therefore, the middleware may need to load the data conversion methods corresponding to multiple second components simultaneously to create the conversion threads of each second component, so as to perform subsequent data format conversion. However, too many calls to conversion threads can easily affect the security and stability of data, and multi-threaded problems such as data disorder are likely to occur.

[0097] Therefore, to further avoid multi-threading issues, the specific process of data format conversion may include: obtaining the encryption and decryption parameters of each second component; determining the processing priorities of the service data to be sent from the corresponding first component to each second component based on the data decryption delays corresponding to the encryption and decryption parameters of each second component; and calling the corresponding data conversion methods of the corresponding second components according to the processing priorities of each service data to perform data format conversion on each service data to obtain service data that matches the data format of the corresponding second component.

[0098] Among them, the encryption and decryption parameters are used to indicate the encryption and decryption algorithms of the data, and different encryption and decryption parameters correspond to different data decryption delays. Specifically, different encryption and decryption parameters indicate different encryption and decryption algorithms, and different encryption and decryption algorithms require different encryption and decryption times; therefore, different encryption and decryption parameters correspond to different data decryption delays. It should be noted that by encrypting and decrypting the service data, the service data can be effectively prevented from being interfered by dirty data, so that the service data can be transmitted to the second component without interference and accurately.

[0099] In addition, the data decryption delay is inversely proportional to the processing priority. Specifically, the greater the data decryption delay, the lower the processing priority. Among them, the higher the processing priority, the earlier the processing order of the corresponding service data; the lower the processing priority, the later the processing order of the corresponding service data. Therefore, the higher the processing priority of the service data, the earlier the corresponding data conversion method of the corresponding second component will be called to perform data format conversion on the service data.

[0100] Optionally, if the processing priorities of multiple service data are the same, the corresponding multiple data conversion methods can be called simultaneously to perform data format conversion on the aforementioned multiple service data. Further, if the number of service data with the same processing priority is greater than the preset number, some service data can be randomly selected from the multiple service data with the same processing priority first. Then, the corresponding data conversion methods are called respectively to perform data format conversion on some service data. Finally, the corresponding data conversion methods are called respectively to perform data format conversion on the remaining service data.

[0101] Among them, the quantities of both some service data and the remaining service data are less than or equal to the preset number. The preset number can be set manually or set by the terminal device or server in the data processing system between the above application components based on the callable resource situation of the middleware, which is not limited here.

[0102] Specifically, an appropriate number of threads can effectively improve data processing efficiency. However, too many threads will lead to the aforementioned multi-threading problems. At the same time, it takes a certain amount of time to encrypt and decrypt data. Therefore, if the business data with a small data decryption delay is arranged to perform data format conversion first, then after the conversion threads corresponding to the business data with a small data decryption delay are released, the business data with a large data decryption delay may only complete data decryption. At this time, creating new conversion threads will not cause the number of threads in the middleware to be excessive. Therefore, by means of processing priority, the calling order of data conversion methods can be reasonably arranged, thereby effectively avoiding multi-threading problems such as the reduction of data security and stability and data disorder.

[0103] In specific implementation, the encryption and decryption parameters can include at least the following three types: Info, Warn, and Error. Among them, Info is used to indicate no encryption and decryption algorithm, that is, the business data is transmitted and called without encryption. For example, if the receiving component of the business data is a component for implementing functions such as opening the camera, writing to the album, and loading the web page, it means that the security requirements of the business data are not so high, so this type of data does not need to be encrypted for transmission.

[0104] Warn is used to indicate component decryption, that is, this type of business data is decrypted by the decryption function stored in the component that receives the business data. This method is applicable to general data transmission, and the middleware will perform transparent transmission of this type of business data, that is, no encryption and decryption operations are performed inside the middleware.

[0105] Error is used to indicate the public key algorithm. Specifically, at this time, the business data to be sent from the first component to the second component is the data encrypted by the business execution thread of the application service that calls these two components through the public key; and the private key corresponding to the application service will be stored in the middleware. It is necessary for the middleware to call the private key corresponding to the application service to decrypt the business data and then perform subsequent data format conversion. Among them, the public key algorithm can include one or more of algorithms such as block symmetric cipher algorithm (i.e., DES), triple data encryption algorithm (3DES), and asymmetric encryption algorithm (RSA).

[0106] S305. The middleware sends the converted business data to the second component.

[0107] In the embodiment of the present application, since the data format of the converted business data matches the data format that the second component can receive, the second component can successfully receive the converted business data.

[0108] In one embodiment, the middleware may cache intermediate resource data of a second component; wherein, the intermediate resource data includes at least one of relevant data with data format conversion failure and resource data reused by the operation of the data conversion method corresponding to the second component.

[0109] Specifically, if the conversion thread created by loading the data conversion method cannot receive service data due to reasons such as data type mismatch, then this service data can be referred to as relevant data with data format conversion failure.

[0110] Meanwhile, after a data conversion method is loaded for the first time to create a corresponding conversion thread, in order to ensure that the subsequent conversion thread can run faster, the middleware usually caches some resource data reused by the operation of the conversion thread. These resource data can specifically be some parameters, some functions in the database, and so on.

[0111] Furthermore, too much intermediate resource data cached in the middleware will affect the data processing speed of the middleware, thereby affecting the efficiency of data format conversion. Therefore, data cleaning can be performed on the intermediate resource data cached in the middleware according to a preset cleaning policy.

[0112] Among them, the preset cleaning policy includes a time-based cleaning policy or a usage frequency-based cleaning policy. Specifically, the time-based cleaning policy can include periodically performing data cleaning on the intermediate resource data cached in the middleware.

[0113] The usage frequency-based cleaning policy can include: determining the usage frequency of each intermediate resource data cached in the middleware, and based on the usage frequency of each intermediate resource data, performing data cleaning on each intermediate resource data. Among them, the higher the usage frequency of the intermediate resource data, the longer the future time for cleaning this intermediate resource data is from the current time. Optionally, it can also be other time-based cleaning policies or usage frequency-based cleaning policies, which are not limited herein.

[0114] Optionally, if the component version of the second component is updated, the reused resource data corresponding to it is very likely not to be used by the new version of the second component; meanwhile, the relevant data with data format conversion failure corresponding to it is even more useless. Therefore, after the component version is updated, data cleaning can be performed on the intermediate resource data cached in the middleware according to a preset cleaning policy.

[0115] In the specific implementation, please refer to the appendix Figure 4 which shows a schematic diagram of a business execution process. As Figure 4As shown, after the business execution thread of the application service calls the first component, the first component returns business data. Then, the business execution thread needs to call the second component, and the business execution thread sends a call request carrying the business data to the second component. As Figure 4 shown by the dashed arrow in

[0116] Specifically, please refer to the appendix Figure 5 , which shows a schematic structural diagram of a middleware. As Figure 5 shown, the middleware (also known as the scheme middleware) includes a service module (i.e., the services module), a data synchronization module, and a callback module (also known as the hook module).

[0117] 1) The callback module can specifically include two functions: program proxy and method exchange.

[0118] Since there is no restriction on the caller that generates the corresponding communication protocol address when configuring the scheme protocol of the second component, the second component does not have a unified call entry. Therefore, the program proxy part in the callback module needs to perform real-time detection of the communication protocol for the application, so that the method exchange part in the callback module can timely obtain the business data that the first component needs to send to the second component.

[0119] In practical applications, the specific process of the program proxy can include: the middleware can create a subclass of the application program proxy (such as AppDelegate), and the subclass of the application program proxy will implement an initialization method (such as the initialize method). By calling the initialization method in the subclass of the application program proxy, global monitoring of the application can be achieved, so as to detect whether a communication protocol address (specifically, it can be openUrl, an open address) is generated in the application process.

[0120] The process of method exchange can specifically include: after detecting that an openUrl is generated in the application process, since the openUrl can indicate the component function of the second component to be called; among them, the component function of the second component can be implemented by loading the instance method in the corresponding class. Therefore, the middleware can call the class_getClassMethod function in the initialize method to analyze the openUrl and obtain the class identifier (i.e., the code segment identifier) of the class code segment corresponding to the second component currently called (i.e., the execution code segment corresponding to the second component).

[0121] Then, the middleware can call the class_getInstanceMethod function in the initialize method to obtain the method identifier of the instance method used to implement the foregoing component function in the foregoing class code segment, and generate a custom function (i.e., a data acquisition function) based on the class identifier and the method identifier, such as openUrl_1.

[0122] After that, the middleware can call the method_exchangeImplementations function to exchange the IMP pointers of openUrl and openUrl_1. At this time, the business data passed to openUrl is essentially passed to openUrl_1, so that the middleware can capture the business data to be sent from the first component to the second component.

[0123] 2) The service module includes three parts: classification, processing priority, and timer. Among them, classification means that multiple candidate components are stored in the service module, each corresponding to a data conversion method; processing priority means that the service module can be used to determine the processing priority of each business data according to the component receiving each business data; the timer means that the service module can periodically clean the intermediate resource data cached in the middleware.

[0124] 3) The data synchronization module mainly includes a mutex part. The callback module will transmit the obtained business data to the data synchronization module for callback. After the data synchronization module loads the corresponding data conversion method to create a corresponding conversion thread, it will add a mutex to the created conversion thread after receiving a business data, so that the input of the business data becomes a linear operation. After the mutex of the conversion thread is released, the conversion thread can receive new business data.

[0125] S306. The second component performs business processing on the converted business data to obtain a business processing result.

[0126] In the embodiment of the present application, the second component can determine the component function required for the converted business data based on the application service corresponding to the business execution thread of the second component; then, the second component performs business processing on the converted business data through the determined component function to obtain a business processing result.

[0127] Optionally, since the call request mentioned in step S302 includes a communication protocol address, the second component can analyze the component function called by the business execution thread of the second component through the communication protocol address; then, the second component can perform business processing on the converted business data through the analyzed component function to obtain a business processing result.

[0128] Exemplarily, referring to the example in step S301, the middleware can call the data conversion method corresponding to the camera component to convert the data format of the image data to obtain the converted image data; then, the middleware can send the converted image data to the barcode scanning and recognition component so that the barcode scanning and recognition component can perform recognition processing on the converted image data to obtain the bank card recognition result.

[0129] In the embodiment of the present application, through the pre-set data conversion method in the middleware, the data format of the service data to be sent from the first component to the second component can be converted into the data format adapted by the second component, so that the second component can successfully receive the converted service data, achieving the purpose of enabling data communication between two components that cannot directly communicate.

[0130] At the same time, in the embodiment of the present application, by deploying the middleware, the data communication between the first component and the second component can be decoupled without invading the original communication mechanism; this method enables the developer of the first component (i.e., the private cloud component) to no longer need to perform secondary development on the private cloud component after the second component is iteratively updated, but only needs to simply and quickly configure the page jump communication protocol to the corresponding page through the protocol configuration platform, which is beneficial to reducing the maintenance cost of the private cloud component and improving the deployment efficiency of the private cloud component in the application.

[0131] In addition, compared with a method such as Websocket (a two-way communication protocol) where the private cloud component first sends the service data to the server through Websocket and then the server passes the service data to the corresponding component in the application; in the embodiment of the present application, the middleware can be used to verify the service data and can synchronously process and parse the service data, effectively avoiding the problem of excessive processing delay caused by server authentication and verification.

[0132] In addition, it should be noted that the second component can successfully receive the converted service data because the data format of the converted service data matches the data format of the data input port of the second component, and the middleware can find the data input port of the second component; therefore, for other components in the application that can directly communicate with the second component itself, they can actually also use the middleware to assist in finding the data input port of the second component to complete the data communication between the other components and the second component. Therefore, the middleware in the embodiment of the present application can also be compatible with the communication between components without a page jump communication protocol configured in the application and components with a page jump communication protocol configured, greatly expanding the dynamics of component interaction and communication.

[0133] In an embodiment of the present application, another data processing method between application components is provided, and this data processing method between application components can be applied to Figure 2A data processing system between application components as shown. This method can be executed by middleware, or jointly executed by the business execution thread of the application service, the first component, the second component, and the middleware. In the embodiments of the present application, taking the example that this method is executed by the middleware deployed in the application running on the terminal device, as Figure 6 shown, it shows a schematic flowchart of another data processing method between application components. This data processing method between application components is an extension based on the method Figure 3 shown in

[0134] Among them, S601 to S608 are introduced in detail as follows:

[0135] S601. In response to the startup operation of the application, obtain the code segment identifiers corresponding to the execution code segments of each candidate component.

[0136] In the embodiments of the present application, the candidate component is a component configured with a page jump communication protocol (such as the scheme protocol). In an object-oriented language, usually the code segment of a class is used to complete the functions implemented by a component. Therefore, the code segment identifiers corresponding to the execution code segments of each candidate component can specifically be the class identifiers of the classes corresponding to each candidate component.

[0137] In specific implementation, the process of obtaining the code segment identifier may include: during the startup process of the application, the server may send the component identifier of the component configured with the page jump communication protocol to the middleware; then, the middleware may obtain the code segment identifier corresponding to the execution code segment of the component indicated by the component identifier.

[0138] S602. Based on the multiple component functions included in each candidate component, perform classification and extension processing on the code segment identifier to obtain the component conversion methods corresponding to each component function in each candidate component.

[0139] In the embodiments of the present application, since the code segment identifier mentioned in step S601 is actually the class identifier, the classification and extension processing is actually classifying the class (category).

[0140] Among them, classification can extend "methods" for a class without modifying the original class. Only "methods" can be added during classification, and member variables cannot be added. Member variables in the original class can be accessed during classification, but only variables in the form of @protect (protected member variables) and @public (member variables that can be accessed by all classes) can be accessed.

[0141] In one embodiment, since the classification extension in the embodiments of the present application is a data conversion method for extending the component functions of candidate components, and the format of the data that the candidate components can receive can be clearly known through the corresponding execution code segments of the candidate components, the required data conversion method is also relatively clear. Therefore, the middleware can actually perform classification extension processing on each candidate component automatically according to the multiple component functions included in each candidate component.

[0142] S603. Associatively store the component identifiers of each candidate component, the function identifiers of multiple component functions in each candidate component, and multiple component conversion methods in a data conversion method library.

[0143] In the embodiments of the present application, the data conversion method library may be a storage unit or a storage space in the middleware, which is not limited herein.

[0144] In practical applications, please refer to the appendix Figure 7 , which shows a schematic diagram of a classification file. After obtaining the class identifier "TMF", the middleware can create an Installable class file according to the class identifier. As Figure 7 shown in the file directory 701 in, an Installable class file TMF+Installable is created. Then, the middleware can perform classification extension processing on the Installable class file in terms of component functions such as gateway, sharing, JS bridging, secure keyboard, and offline package, so as to obtain Figure 7 the classification files in lines 2 to 5 in.

[0145] Among them, the "TMFJSBridge+Installable" classification file in line 2 contains the data conversion method corresponding to the JS bridging component function; the "TMFSafeKeyboad+Installable" classification file in line 3 contains the data conversion method corresponding to the secure keyboard component function; the "TMFShare+Installable" classification file in line 4 contains the data conversion method corresponding to the sharing component function; the "TMFShark+Installable" classification file in line 5 contains the data conversion method corresponding to the gateway component function.

[0146] In a possible implementation manner, referring to the description of the encryption and decryption parameters in step S304, the encryption and decryption algorithms indicated by the encryption and decryption parameters include public key algorithms. If the encryption and decryption parameters are used to indicate a public key algorithm, the server also needs to send the public key and private key required for the public key algorithm to the middleware during the startup process of the application.

[0147] The specific process includes: 1) The middleware receives the encrypted information sent by the server. Among them, the encrypted information includes the public key, the private key, and the service identifier of the application service that needs to be encrypted and decrypted using the public key and the private key. 2) Send the public key to the service execution thread corresponding to the application service indicated by the service identifier in the encrypted information, and associate and store the private key with the service identifier in the encrypted information.

[0148] In the specific implementation, please refer to the appendix Figure 8 , which shows a schematic diagram of the initialization process of a middleware. As Figure 8 shown in step 801 in, when the application starts, the middleware will respond to the start operation of the application and create a classification. Among them, the process of creating a classification is the process of creating a data conversion method, which can be referred to step S601 to S603 and Figure 7 the example shown, which will not be elaborated here.

[0149] Then, as Figure 8 shown in step 802 in, the middleware can then create a subclass of the application proxy. Specifically, please refer to the description of the subclass of the application proxy in step S305, which will not be elaborated here.

[0150] After that, since the startup of the application includes cold startup and hot startup. Among them, cold startup means that there is no process of this application created in the terminal device, that is, no data related to this application is loaded. Hot startup means that before startup, there is still a process of this application in the terminal device, that is, some data related to this application is loaded.

[0151] Therefore, cold startup is generally the first startup of the application. As Figure 8 shown in steps 803 to 805 in, the middleware can determine whether the application is the first startup. If it is the first startup, it means that there is no cached private key locally in the terminal device. Therefore, the middleware needs to request the server to send down the encrypted information. If it is not the first startup, it means that there is a cached private key locally in the terminal device, then the middleware can directly load the locally cached private key.

[0152] Finally, as Figure 8 shown in step 806 in, the middleware can call the previously created subclass of the application proxy to create an application proxy thread, so as to perform real-time detection of the communication protocol of the application through the application proxy thread. So far, as Figure 8 shown in step 807 in, the middleware initialization is completed.

[0153] S604. If a call request from the service execution thread to the second component is detected, obtain the service data carried by the call request.

[0154] In the embodiment of the present application, for the specific implementation manner of step S604, reference may be made to the specific implementation manners of steps S301 and S302 in the above embodiments, which will not be elaborated herein.

[0155] S605. Obtain a function identifier corresponding to the component function of the second component to be called during the execution of the application service.

[0156] In the embodiment of the present application, the function identifier is used to uniquely indicate the corresponding component function in the second component. In specific implementation, the function identifier may include a component name and a component function name, or may be a function number, etc., which is not limited herein.

[0157] S606. Obtain the data conversion method corresponding to the second component from the data conversion method library.

[0158] In the embodiment of the present application, for the specific implementation manner of step S606, reference may be made to the specific implementation manner of step S303 in the above embodiments, which will not be elaborated herein.

[0159] S607. Invoke the data conversion method corresponding to the second component to perform data format conversion on the service data, and obtain service data that matches the data format of the second component.

[0160] In the embodiment of the present application, for the specific implementation manner of step S607, reference may be made to the specific implementation manner of step S304 in the above embodiments, which will not be elaborated herein.

[0161] In one embodiment, referring to step S603, if the encryption and decryption parameters of any second component are used to indicate a public key algorithm, it means that the middleware needs to use the private key to decrypt the corresponding service data. Therefore, before performing data format conversion on the service data, it may be determined whether the encryption and decryption parameters of the second component are used to indicate a public key algorithm. If so, the middleware may obtain the service identifier of the application service to be called for this second component; then, the middleware invokes the private key corresponding to the obtained service identifier to decrypt the service data to obtain the decrypted service data; then, the middleware invokes the data conversion method corresponding to the second component to perform data format conversion on the decrypted service data, and obtain service data that matches the data format of the second component.

[0162] S608. Send the converted service data to the second component, so that the second component performs service processing on the converted service data to obtain a service processing result.

[0163] In the embodiment of the present application, for the specific implementation manner of step S608, reference may be made to the specific implementation manners of steps S305 and S306 in the above embodiments, which will not be elaborated herein.

[0164] In practical applications, please refer to the appendix Figure 9, showing a schematic diagram of a middleware processing process. After the application execution thread of the application service calls Component_1, it will generate an openUrl for calling Component_2 (i.e., the communication protocol address of Component_2 included in the call request). At this time, as Figure 9 shown, the callback module 902 of the middleware 901 will generate a custom function (i.e., a data acquisition function) and exchange pointers with the instance method corresponding to the openUrl; therefore, the service data to be sent from Component_1 to Component_2 will be passed to the custom function after the pointer exchange.

[0165] Then, as Figure 9 shown, the service module 903 of the middleware 901 can obtain the encryption and decryption parameters corresponding to the second component; then, the service module 903 can decode and decrypt the service data passed to the custom function according to the encryption and decryption algorithm indicated by the encryption and decryption parameters, so as to obtain the decrypted service data. At the same time, the timer in the service module 903 can regularly clean the intermediate resource data cached in the middleware 901.

[0166] After that, as Figure 9 shown, the service module 903 can send the decrypted service data to the data synchronization module 904 after the mutex in the data synchronization module 904 is opened, so that the data synchronization module 904 can call the conversion thread created by the loaded data conversion method to perform data format conversion on the decrypted service data to obtain the converted service data. Finally, as Figure 9 shown, the conversion thread can pass the converted service data into Component_2.

[0167] In the embodiment of the present application, since the data formats that different component functions can receive may have slight differences, different component conversion methods can be created for different component functions, so that subsequent data format conversion can be performed according to the specific component functions required by the application service, which is beneficial to improving the adaptability between the data format of the converted service data and the data format of the component function to be called, so as to realize data communication between two components that cannot directly communicate while further improving the success rate of data communication between the two components.

[0168] In addition, in the embodiment of the present application, by classifying and expanding the component conversion methods of each component function in the candidate component under the code segment identifier corresponding to each candidate component, the component conversion method and the instance method corresponding to the corresponding component function can belong to the same class; therefore, the component conversion method can pass the service data to the corresponding instance method, so as to achieve the purpose of the middleware sending the converted service data to the second component.

[0169] Embodiments of the present application further provide an electronic device, including one or more processors and a storage device. The storage device is configured to store one or more computer programs. When the one or more computer programs are executed by the one or more processors, the electronic device implements the data processing method between the application components as described above.

[0170] Figure 10 FIG. shows a schematic structural diagram of a computer system of an electronic device suitable for implementing embodiments of the present application.

[0171] It should be noted that Figure 10 the computer system 1000 of the electronic device shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.

[0172] As Figure 10 shown, the computer system 1000 includes a processor (Central Processing Unit, CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the Read-Only Memory (ROM) 1002 or the program loaded from the storage section 1008 into the Random Access Memory (RAM) 1003, such as executing the method in the above embodiments. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. The Input / Output (I / O) interface 1005 is also connected to the bus 1004.

[0173] In some embodiments, the following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc. and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a Local Area Network (LAN) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as required. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as required so that the computer program read from it can be installed into the storage section 1008 as required.

[0174] In some embodiments, one or more instructions stored in a computer storage medium may be loaded and executed by a processor 1001 to implement the corresponding steps of the methods in the embodiments of the data processing method between the application components related to Figure 3 and Figure 6 Specifically, one or more instructions in the computer storage medium are loaded and executed by the processor 1001 as follows:

[0175] After the processor 1001 invokes the first component through the business execution thread of the application service, a call request for the second component is generated; wherein, the call request carries the business data to be sent from the first component to the second component;

[0176] If the processor 1001 detects the call request through the middleware, the business data carried by the call request is obtained;

[0177] The processor 1001 obtains, through the middleware, the data conversion method corresponding to the second component from the data conversion method library; wherein, the data conversion methods corresponding to multiple candidate components are preset in the data conversion method library;

[0178] The processor 1001 invokes, through the middleware, the data conversion method corresponding to the second component to perform data format conversion on the business data, and obtains business data that matches the data format of the second component;

[0179] The processor 1001 sends the converted business data to the second component through the middleware;

[0180] The processor 1001 performs business processing on the converted business data through the second component to obtain a business processing result.

[0181] In one embodiment, the data conversion method corresponding to the second component includes component conversion methods corresponding to the respective component functions in the second component; based on the foregoing solution, when the processor 1001 invokes, through the middleware, the data conversion method corresponding to the second component to perform data format conversion on the business data and obtains business data that matches the data format of the second component, it is specifically used to execute: obtaining, through the middleware, the function identifier corresponding to the component function of the second component to be invoked by the business execution thread; invoking, through the middleware, the component conversion method of the component function that matches the function identifier to perform data format conversion on the business data, and obtaining business data that matches the data format of the second component.

[0182] In one embodiment, based on the foregoing solution, the processor 1001 may further be configured to: respond to a startup operation of an application through middleware, and obtain a code segment identifier corresponding to an execution code segment of a second component; classify and expand the code segment identifier based on multiple component functions included in the second component through middleware, to obtain component conversion methods respectively corresponding to the component functions in the second component; and associate and store the component identifier of the second component, the function identifiers of the multiple component functions in the second component, and the multiple component conversion methods in a data conversion method library through middleware.

[0183] In one embodiment, the number of service data includes multiple; based on the foregoing solution, when the processor 1001 calls the data conversion method corresponding to the second component to perform data format conversion on the service data to obtain service data matching the data format of the second component, it may specifically be configured to: if there is target service data with the same component function to be called among the multiple service data, load the component conversion method corresponding to the called component function through middleware to create a conversion thread; if the conversion thread receives any target service data, perform a locking process on the conversion thread through middleware to obtain a locked conversion thread; wherein, the locked conversion thread refuses to receive other target service data; after detecting that any target service data has successfully converted its data format, perform an unlocking process on the locked conversion thread through middleware, so that the unlocked conversion thread can receive other target service data until all target service data has been received.

[0184] In one embodiment, based on the foregoing solution, the processor 1001 may further be configured to: obtain intermediate resource data of the second component cached by middleware through middleware; wherein, the intermediate resource data includes at least one of data related to failed data format conversion and resource data reused by the operation of the data conversion method corresponding to the second component; perform data cleaning on the intermediate resource data through middleware according to a preset cleaning policy; wherein, the preset cleaning policy includes a time-based cleaning policy or a usage frequency-based cleaning policy.

[0185] In one embodiment, the second component is configured with a page jump communication protocol, and the call request is generated based on the page jump communication protocol of the second component; based on the foregoing solution, the processor 1001 may further be configured to: perform real-time detection of the communication protocol of the application through middleware to obtain a detection result; if the communication protocol address included in the detection result matches the page jump communication protocol, determine that a call request has been detected through middleware.

[0186] In one embodiment, the communication protocol address is used to indicate the component function in the second component; based on the foregoing solution, when the processor 1001 obtains the service data carried in the call request through the middleware, it can specifically be used to: obtain, through the middleware, the code segment identifier of the execution code segment corresponding to the second component indicated by the communication protocol address; obtain, through the middleware, the method identifier of the instance method that matches the component function indicated by the communication protocol address in the execution code segment; create, through the middleware, a data acquisition function based on the code segment identifier and the method identifier; exchange, through the middleware, the pointer pointing to the instance method with the pointer pointing to the data acquisition function to obtain the exchanged data acquisition function; and obtain, through the middleware, the service data that the first component needs to send to the second component based on the exchanged data acquisition function.

[0187] In one embodiment, there are multiple application services, and the first component and the second component to be called during the execution of different application services are different; based on the foregoing solution, when the processor 1001 calls the data conversion method corresponding to the second component through the middleware to perform data format conversion on the service data to obtain service data that matches the data format of the second component, it can specifically be used to: obtain, through the middleware, the encryption and decryption parameters of each second component; wherein, different encryption and decryption parameters correspond to different data decryption time delays; determine, through the middleware, the processing priority of the service data that the corresponding first component needs to send to each second component based on the data decryption time delay corresponding to the encryption and decryption parameters of each second component; wherein, the data decryption time delay is inversely proportional to the processing priority; and call, through the middleware, the data conversion method corresponding to the corresponding second component according to the processing priority of each service data to perform data format conversion on each service data to obtain service data that matches the data format of the corresponding second component.

[0188] In one embodiment, based on the foregoing solution, the processor 1001 can also be used to: receive, through the middleware, the encryption information sent by the server; the encryption information includes a public key, a private key, and the service identifier of the application service that needs to use the public key and the private key for encryption and decryption; send, through the middleware, the public key to the service execution thread corresponding to the application service indicated by the service identifier in the encryption information, and associate and store the private key with the service identifier in the encryption information; if the encryption and decryption parameters of any second component are used to indicate the public key algorithm, obtain, through the middleware, the service identifier of the application service to be called for any second component; call, through the middleware, the private key corresponding to the obtained service identifier to decrypt any service data to obtain the decrypted service data, so as to obtain service data that matches the data format of any second component based on the decrypted service data.

[0189] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer program. For example, an embodiment of the present application includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 1009 and / or installed from the removable medium 1011. When the computer program is executed by the processor (CPU) 1001, various functions defined in the system of the present application are executed.

[0190] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium in the above various embodiments can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The computer program included on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0191] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of apparatuses, methods, and computer program products according to various embodiments of the present application. In this context, each box in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, and the above-mentioned module, segment of a program, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes may occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, as well as combinations of boxes in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and a computer program.

[0192] The units or modules involved in the embodiments described in the present application can be implemented in software or in hardware, and the described units or modules can also be provided in a processor. Among them, the names of these units or modules do not, in some cases, constitute a limitation on the units or modules themselves.

[0193] Another aspect of the present application also provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, it implements the data processing method between the application components as described above. The computer-readable medium can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device.

[0194] The embodiments of the present application provide a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the method embodiments as described above Figure 3 and Figure 6 shown. Among them, the computer-readable storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.

[0195] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0196] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include known common general knowledge or conventional technical means in the technical field not disclosed in the present application.

[0197] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the embodiments of the present application. Those of ordinary skill in the art can easily make corresponding modifications or adaptations according to the main concept and spirit of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope required by the claims.

Claims

1. A method for data processing between application components, characterized in that: Middleware is deployed in the application, and during the execution of the application service in the application, a first component and a second component with mismatched data formats need to be called, and the method includes: After calling the first component, the service execution thread of the application service generates a call request to the second component; wherein the call request carries the service data to be sent by the first component to the second component; If the middleware detects the call request, then obtains the business data carried by the call request; The middleware obtains the data conversion method corresponding to the second component from a data conversion method library; wherein the data conversion method library is pre-set with data conversion methods corresponding to a plurality of candidate components respectively; The middleware calls the data conversion method corresponding to the second component to convert the data format of the business data to obtain business data that matches the data format of the second component; The middleware sends the converted business data to the second component; The second component performs business processing on the converted business data to obtain a business processing result.

2. The method according to claim 1, characterized in that The data conversion method corresponding to the second component includes component conversion methods corresponding to the functions of each component in the second component; The middleware calls the data conversion method corresponding to the second component to convert the data format of the business data to obtain business data matching the data format of the second component, including: The middleware obtains a function identifier corresponding to a component function of the second component to be called by the business execution thread; The middleware calls the component conversion method of the component function that matches the function identifier, performs data format conversion on the business data, and obtains business data that matches the data format of the second component.

3. The method according to claim 2, characterized in that The method further comprises: The middleware responds to the startup operation of the application and obtains the code segment identifier corresponding to the execution code segment of the second component; The middleware performs classification and expansion processing on the code segment identifier based on multiple component functions included in the second component to obtain component conversion methods corresponding to each component function in the second component; The middleware associates and stores the component identifier of the second component, the function identifiers of multiple component functions in the second component, and the multiple component conversion methods in the data conversion method library.

4. The method according to claim 2, characterized in that: The number of the business data includes a plurality of business data; the middleware calls the data conversion method corresponding to the second component to convert the data format of the business data to obtain business data matching the data format of the second component, including: If there is target business data with the same component function to be called among the multiple business data, the middleware loads the component conversion method corresponding to the called component function to create a conversion thread; If the conversion thread receives any target business data, the middleware locks the conversion thread to obtain a locked conversion thread; wherein the locked conversion thread refuses to receive other target business data; After detecting that the data format of any target business data is successfully converted, the middleware unlocks the locked conversion thread to receive other target business data through the unlocked conversion thread until all target business data are received.

5. The method according to claim 1, characterized in that The method further comprises: The middleware obtains the intermediate resource data of the second component cached by the middleware; wherein the intermediate resource data includes at least one of the related data of the data format conversion failure and the resource data reused by the data conversion method corresponding to the second component; The middleware performs data cleaning on the intermediate resource data according to a preset cleaning strategy; wherein the preset cleaning strategy includes a time-based cleaning strategy or a usage frequency-based cleaning strategy.

6. The method according to claim 1, characterized in that The second component is configured with a page jump communication protocol, and the call request is generated based on the page jump communication protocol of the second component; the method further includes: The middleware performs real-time detection of the communication protocol of the application to obtain a detection result; If the communication protocol address included in the detection result matches the page jump communication protocol, the middleware determines that the call request is detected.

7. The method according to claim 6, characterized in that The communication protocol address is used to indicate a component function in the second component; the middleware obtains the business data carried by the call request, including: The middleware obtains a code segment identifier of an execution code segment corresponding to the second component indicated by the communication protocol address; The middleware obtains a method identifier of an instance method in the execution code segment that matches the component function indicated by the communication protocol address; The middleware creates a data acquisition function based on the code segment identifier and the method identifier; The middleware exchanges the pointer pointing to the instance method with the pointer pointing to the data acquisition function to obtain the exchanged data acquisition function; The middleware obtains the business data through the exchanged data acquisition function.

8. The method according to any one of claims 1 to 7, characterized in that The number of the application services includes multiple ones, and the first component and the second component to be called during the execution of different application services are different; The middleware calls the data conversion method corresponding to the second component to convert the data format of the business data to obtain business data matching the data format of the second component, including: The middleware obtains encryption and decryption parameters of each second component; wherein different encryption and decryption parameters correspond to different data decryption delays; The middleware determines the processing priority of the service data to be sent by the corresponding first component to each second component based on the data decryption delay corresponding to the encryption and decryption parameters of each second component; wherein the data decryption delay is inversely proportional to the processing priority; The middleware calls the data conversion method corresponding to the corresponding second component according to the processing priority of each business data, converts the data format of each business data, and obtains business data that matches the data format of the corresponding second component.

9. The method according to claim 8, characterized in that The method further comprises: The middleware receives the encrypted information sent by the server; the encrypted information includes a public key, a private key, and a service identifier of an application service that needs to be encrypted and decrypted using the public key and the private key; The middleware sends the public key to the service execution thread corresponding to the application service indicated by the service identifier in the encrypted information, and associates and stores the private key with the service identifier in the encrypted information; If the encryption and decryption parameters of any second component are used to indicate a public key algorithm, the middleware obtains a service identifier of an application service to be called by any second component; The middleware calls the private key corresponding to the acquired business identifier to decrypt any of the business data to obtain decrypted business data, so as to obtain business data matching the data format of any of the second components based on the decrypted business data.

10. A data processing system between application components, characterized in that: The system includes middleware deployed in the application, a service execution thread of the application service in the application, a first component and a second component in the application that do not match the data format, and the application service needs to call the first component and the second component during execution; The business execution thread is used to generate a call request to the second component after calling the first component; wherein the call request carries the business data to be sent by the first component to the second component; The middleware is used to obtain the business data carried by the call request if the call request is detected; The middleware is further used to obtain the data conversion method corresponding to the second component from a data conversion method library; wherein the data conversion method library is pre-set with data conversion methods corresponding to a plurality of candidate components respectively; The middleware is further used to call the data conversion method corresponding to the second component to convert the data format of the business data to obtain business data that matches the data format of the second component; The middleware is further used to send the converted business data to the second component; The second component is used to perform business processing on the converted business data to obtain a business processing result.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data processing method of the application component according to any one of claims 1 to 9 is implemented.

12. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the data processing method of the application component as described in any one of claims 1 to 9.