Data conversion method, device, electronic device and readable medium
By using class loader registration services in component containers, service registration and data conversion for user-defined needs are realized, which solves the shortcomings of diversified data formats and methods in the prior art, and improves the flexibility and efficiency of data conversion.
Patent Information
- Application Number
- CN201910759664.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-16
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2039-08-16
AI Technical Summary
In the exchange of data files between enterprises, the prior art is difficult to meet the diversified needs of data formats and methods, and the document content conversion system cannot fully combine with the business characteristics of the docking system, resulting in insufficient expansion and flexibility of template conversion methods.
Register services in component containers through class loaders and customize services according to user needs, enhancing the scalability of services, and implementing target services through unified interfaces to realize data conversion.
It realizes service registration for user-defined needs, enhances the scalability of services, provides a more flexible data conversion method, avoids the serialization and deserialization process between class loaders, and improves operational efficiency.
Smart Images

Figure CN112445850B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a data conversion method, device, electronic device and computer-readable medium. Background Art
[0002] At present, data files are frequently exchanged between enterprises, and the demand for electronic data exchange is very high. In practical applications, the exchange data formats and methods are diversified, the communication protocols are numerous, and the communication messages and files are even more complicated.
[0003] To achieve electronic data exchange transmission, the internal business documents of enterprise systems are usually in a fixed format, such as object notation (JSON). At this time, there is generally a document content conversion system to configure a customized conversion template, and convert the data in the object notation format into the demand message of each docking supplier according to the docking supplier template, and then send it according to the protocol.
[0004] However, the extensibility and flexibility of the template conversion method cannot meet the needs. For example, users cannot convert according to the customized requirements of their own systems, and the document content conversion system of the data sender usually only focuses on its own business operation process and does not fully integrate the business characteristics of the docking system (data receiver). In this case, the template conversion method will not be able to meet the above requirements.
[0005] Therefore, a new data conversion method, device, electronic device and computer-readable medium are needed.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0007] In view of this, the embodiments of the present disclosure provide a data conversion method, device, electronic device and computer-readable medium, which can customize the registration of services according to user needs through a class loader, enhance the scalability of the service, and achieve data conversion in a more flexible manner.
[0008] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0009] According to the first aspect of an embodiment of the present disclosure, a data conversion method is proposed, which includes: registering at least one service in a component container through at least one class loader; obtaining a task to be converted, wherein the task to be converted includes data to be converted and at least one split task to be converted; determining at least one target service in at least one service of the component container according to the at least one split task to be converted; and executing the at least one target service in sequence through a unified interface to convert the data to be converted.
[0010] In an exemplary embodiment of the present disclosure, registering at least one service in a component container through at least one class loader includes: obtaining at least one class compression package to be loaded from each class loader; filtering the at least one class compression package to be loaded according to the existing class compression packages in the component container to obtain at least one filtered class compression package to be loaded; and loading the at least one filtered class compression package to be loaded as at least one service through each class loader.
[0011] In an exemplary embodiment of the present disclosure, determining at least one target service in at least one service of the component container based on the at least one split task to be converted includes: taking the at least one split task to be converted as an index, each class loader is loaded in at least one service of the component container in the order of the class loader, the platform class loader and the system class loader to determine at least one target service.
[0012] In an exemplary embodiment of the present disclosure, registering at least one service in a component container through at least one class loader includes: obtaining at least one class compression package to be loaded from each class loader; and registering at least one service label class file and at least one service consumer in each class compression package to be loaded as at least one service and at least one service agent, respectively.
[0013] In an exemplary embodiment of the present disclosure, determining at least one target service in at least one service of the component container according to the at least one split task to be converted includes: determining and calling the at least one target service agent in at least one service agent of the component container according to the at least one split task to be converted; and searching for the at least one target service through the at least one target service agent.
[0014] In an exemplary embodiment of the present disclosure, the method further includes: unloading a service of at least one class loader in the component container through at least one class loader.
[0015] In an exemplary embodiment of the present disclosure, the method further includes: injecting at least one service in the component container into a software component model so that a data receiver applies the service in the software component model.
[0016] According to the second aspect of an embodiment of the present disclosure, a data conversion device is proposed, which includes: a service registration module, used to register at least one service in a component container through at least one class loader; a task acquisition module, used to acquire tasks to be converted, wherein the tasks to be converted include data to be converted and at least one split task to be converted; a service search module, used to determine at least one target service in at least one service of the component container according to the at least one split task to be converted; and a data conversion module, used to execute the at least one target service in sequence through a unified interface to convert the data to be converted.
[0017] According to the third aspect of an embodiment of the present disclosure, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement any of the data conversion methods described above.
[0018] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, wherein the program implements the data conversion method as described in any one of the above items when executed by a processor.
[0019] According to the data conversion method, device, electronic device and computer-readable medium provided by certain embodiments of the present disclosure, at least one service is registered in the component container through the class loader, which can realize service registration according to user customized requirements, enhance the scalability of the service, and realize data conversion in a more flexible way; at the same time, after obtaining the task to be converted, at least one target service is executed through a unified interface, which can realize cross-class loader calls between different services to realize the function of dynamically running various services, and can avoid the serialization and deserialization process when passing parameters between class loaders, thereby improving the operation efficiency.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. The drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can also be obtained based on these drawings without creative work.
[0022] Figure 1 The present invention is a system block diagram showing a data conversion method and device according to an exemplary embodiment.
[0023] Figure 2 The figure is a flow chart of a data conversion method according to an exemplary embodiment.
[0024] Figure 3 is a flow chart of a data conversion method according to another exemplary embodiment.
[0025] Figure 4 Shown according to Figure 3 Schematic diagram of the filtering process of step S304.
[0026] Figure 5 Shown according to Figure 3 Schematic diagram of the loading process of step S310.
[0027] Figure 6 is a flow chart of a data conversion method according to yet another exemplary embodiment.
[0028] Figure 7 The invention is a block diagram of a data conversion device according to an exemplary embodiment.
[0029] Figure 8 The diagram is an architecture diagram of a data conversion system according to an exemplary embodiment.
[0030] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment.
[0031] Fig.10 The present invention is a schematic diagram showing a computer-readable storage medium according to an exemplary embodiment. DETAILED DESCRIPTION
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0033] The described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0034] The accompanying drawings are only schematic illustrations of the present invention, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0035] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0036] Exemplary embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0037] Figure 1 The present invention is a system block diagram showing a data conversion method and device according to an exemplary embodiment.
[0038] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the data conversion system operated by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as the task request to be converted, and feed back the processing result (such as the converted data - only an example) to the terminal device.
[0039] The server 105 may, for example, register at least one service in the component container through at least one class loader; the server 105 may, for example, obtain a task to be converted, the task to be converted including data to be converted and at least one split task to be converted; the server 105 may, for example, determine at least one target service in at least one service of the component container according to the at least one split task to be converted. The server 105 may, for example, sequentially execute the at least one target service through a unified interface to convert the data to be converted.
[0040] The server 105 may be a physical server, or may be composed of multiple servers, a part of the server 105 may be used as a data conversion task submission system in the present disclosure, for obtaining tasks that will execute data conversion commands; and a part of the server 105 may be used as a data conversion system in the present disclosure, for registering at least one service in a component container through at least one class loader; obtaining tasks to be converted, the tasks to be converted including data to be converted and at least one split task to be converted; determining at least one target service in at least one service of the component container according to the at least one split task to be converted; and executing the at least one target service in sequence through a unified interface to convert the data to be converted.
[0041] According to the data conversion method and device provided by the embodiments of the present disclosure, services can be registered in a custom manner according to user needs through a class loader, thereby enhancing the scalability of the service and achieving data conversion in a more flexible manner.
[0042] Figure 2 1 is a flowchart of a data conversion method according to an exemplary embodiment. The data conversion method provided in the embodiment of the present disclosure can be executed by any electronic device with computing and processing capabilities, such as terminal devices 101, 102, 103 and / or server 105. In the following embodiments, the server executing the method is used as an example for illustration, but the present disclosure is not limited to this. The data conversion method 20 provided in the embodiment of the present disclosure may include steps S202 to S208.
[0043] like Figure 2 As shown, in step S202, at least one service is registered in the component container through at least one class loader.
[0044] In an exemplary embodiment, a user can upload at least one service customized and created according to user needs to a server through a client. After receiving the service, the server registers the at least one service in a component container through a class loader.
[0045] In the embodiment of the present disclosure, the component container may be a basic container provided by the data sender (data provider) for managing the installation, uninstallation, registration, search, etc. of the custom components of the data receiver. The data sender may include a process processing engine, and the method of the embodiment of the present disclosure may be executed by the process processing engine. For example, the process processing engine may obtain multiple components from the component container and perform process orchestration.
[0046] In an exemplary embodiment, the component container can adopt a hot loading mechanism so that during the actual operation, the process engine on the container side operates according to a predefined processing flow. At each specific processing node, it can dynamically find the services provided by each component according to the conversion process, and then perform corresponding processing.
[0047] In an exemplary embodiment, the method may further include: unloading the services of at least one class loader in the component container by at least one class loader. When the component container adopts a hot loading mechanism, the user can unload the services previously registered in the component container at any time according to his / her customized needs, so as to realize data conversion and function extension and definition in a more flexible way.
[0048] In an exemplary embodiment, the method may further include: injecting at least one service in the component container into a software component model so that a data receiver applies the service in the software component model.
[0049] In the disclosed embodiment, the software component model is a reusable component written in Java language. The software component model exposes member properties of internal domains by providing public methods that conform to consistent design patterns, that is, shares its public methods with various components to facilitate external calls by data recipients.
[0050] In step S204, a task to be converted is obtained, where the task to be converted includes data to be converted and at least one split task to be converted.
[0051] In the embodiment of the present disclosure, the server may initiate a data conversion request. After receiving the data conversion request, the server extracts the data to be converted according to the data conversion, and obtains at least one specific split task to be converted based on the analysis of the data conversion request to generate a task to be converted. Among them, the conversion request may include multiple conversion processes, and the analysis of the conversion request may be split to obtain multiple split tasks to be converted. The split tasks to be converted may be, for example: object notation (Json) in Java to extensible markup language (xml), extensible markup language (xml) to comma separated value file (csv), etc., but the present disclosure does not make special limitations on this.
[0052] In step S206, at least one target service is determined in at least one service of the component container according to the at least one split task to be converted.
[0053] In an exemplary embodiment, the process processing engine may dynamically search for at least one service in the component container to determine at least one target service.
[0054] In step S208, the at least one target service is executed in sequence through the unified interface to convert the data to be converted.
[0055] In the disclosed embodiment, the component container can provide a standard interface as a unified interface, which can ensure that the component container has a unified calling entry and parameter passing entry for each service component in the container. The unified interface of the disclosed embodiment does not need to be loaded by the class loader of each component plug-in, but is uniformly loaded by the outer application class loader, which can achieve the purpose of directly copying parameters and calling methods between various component services, so as to avoid the serialization and deserialization process when different services call each other.
[0056] According to the data conversion method provided by the embodiment of the present disclosure, by registering at least one service in the component container through the class loader, service registration for user-defined requirements can be realized, the scalability of the service is enhanced, and data conversion can be realized in a more flexible way; at the same time, after obtaining the task to be converted, at least one target service is executed through a unified interface, and cross-class loader calls between different services can be realized to realize the function of dynamically running various services, and the serialization and deserialization process when passing parameters between class loaders can be avoided, thereby improving the operating efficiency.
[0057] Figure 3 The data conversion method 30 provided in the embodiment of the present disclosure may include steps S302 to S312.
[0058] like Figure 3 As shown, in step S302, at least one class compression package to be loaded is obtained from each class loader.
[0059] In step S304, the at least one compressed class package to be loaded is filtered according to the existing compressed class packages in the component container to obtain the filtered at least one compressed class package to be loaded.
[0060] In the embodiment of the present disclosure, when a user uploads at least one service customized according to user needs to a server through a client, the at least one service can be compressed to generate a compressed package of the class to be loaded, and the compressed package can be uploaded to the server. After receiving the at least one compressed package of the class to be loaded, the server can compare the at least one compressed package of the class to be loaded with multiple compressed packages of classes already in the component container. If at least one compressed package of the class to be loaded contains a compressed package of classes already in the component container, the compressed package of the class to be loaded is filtered out. In the embodiment of the present disclosure, filtering of at least one compressed package of the class to be loaded can reduce the operation of repeated compressed packages of classes and reduce the system resource occupancy rate. Figure 4 Shown according to Figure 3The type of compressed package to be loaded may further include at least one compressed package, a third-party package, etc. The compressed package to be loaded may have a compressed package directory to record each compressed package. Figure 4 As shown, in step S402, multiple class compression packages to be loaded under the directory of the class compression package to be loaded can be parsed, and then compared with the class compression package set in the platform class loader. If it is included, step S404 is executed, otherwise step S406 is executed to implement the filtering operation. Among them, the platform class loader is connected to the component container and can perform operations such as searching and traversing in the component container.
[0061] In step S306, at least one filtered compressed class package to be loaded is loaded into at least one service through each class loader.
[0062] In step S308, a task to be converted is obtained, where the task to be converted includes data to be converted and at least one split task to be converted.
[0063] In step S310, taking the at least one split task to be converted as an index, each class loader is loaded in at least one service of the component container in the order of the class loader, the platform class loader and the system class loader to determine at least one target service.
[0064] In the embodiment of the present disclosure, Figure 5 Shown according to Figure 3 Schematic diagram of the loading process of step S310 in FIG. Figure 5 As shown, the plug-in class loaders are isolated from each other and cannot pass parameters to each other (in the case of non-serialization and deserialization). In this case, the same class cannot be shared. In this embodiment, each class loader first searches for the class compression package contained in itself to obtain some services; then searches for services in the component container through the platform class loader; and finally searches for services through the system class loader to load and obtain at least one target service.
[0065] In step S312, the at least one target service is executed in sequence through a unified interface to convert the data to be converted.
[0066] Figure 6 The data conversion method 60 provided in the embodiment of the present disclosure may include steps S602 to S306.
[0067] like Figure 6 As shown, in step S602, at least one compressed package of classes to be loaded is obtained from each class loader.
[0068] In step S604, at least one service label class file and at least one service consumer in each class compression package to be loaded are registered as at least one service and at least one service agent, respectively.
[0069] Each file in the compressed package of the class to be loaded contains a label, and the label may include a service label class and a service consumer, and the service consumer is used to generate a dynamic proxy to find a service.
[0070] In step S606, a task to be converted is obtained, where the task to be converted includes data to be converted and at least one split task to be converted.
[0071] In step S608, at least one target service agent is determined and called in at least one service agent of the component container according to the at least one split task to be converted.
[0072] In step S610, the at least one target service is searched through the at least one target service agent.
[0073] In step S612, the at least one target service is executed in sequence through a unified interface to convert the data to be converted.
[0074] According to the data conversion method provided by the embodiment of the present disclosure, a common class compression package is registered in a component container through a filtering operation when registering a service, so that services can be loaded by a unified interface to achieve the function of directly assigning parameters and calling methods between services; at the same time, it can reduce the operation of repeated class compression packages and reduce the system resource occupancy.
[0075] According to the data conversion method provided by the embodiment of the present disclosure, when the class compression package in the plug-in class loader has the same package name as the class compression package in the component container but the same version, the class compression package therein can be loaded first through the plug-in class loader to facilitate the version upgrade of the service.
[0076] It should be clearly understood that the present disclosure describes how to form and use specific examples, but the principles of the present disclosure are not limited to any details of these examples. On the contrary, based on the teachings of the contents disclosed in the present disclosure, these principles can be applied to many other embodiments.
[0077] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a central processing unit (CPU). When the computer program is executed by the central processing unit (CPU), the above functions defined by the above method provided by the present disclosure are executed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk or an optical disk, etc.
[0078] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0079] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0080] Figure 7 is a block diagram of a data conversion device according to an exemplary embodiment. Figure 7 The data conversion device 70 provided in the embodiment of the present disclosure may include: a service registration module 702 , a task acquisition module 704 , a service search module 706 and a data conversion module 708 .
[0081] In the data conversion device 70, the service registration module 702 can be used to register at least one service in the component container through at least one class loader.
[0082] In an exemplary embodiment, the service registration module 702 may include a compressed package acquisition module for acquiring at least one compressed package of the class to be loaded for each class loader; a filtering module for filtering the at least one compressed package of the class to be loaded according to the existing class compressed packages in the component container to obtain at least one filtered compressed package of the class to be loaded; and a filtering loading module for loading the at least one filtered compressed package of the class to be loaded as at least one service through each class loader.
[0083] In an exemplary embodiment, the service registration module 702 may include a compressed package acquisition module for acquiring at least one compressed package of the class to be loaded for each class loader; and a registration module for registering at least one service tag class file and at least one service consumer in each compressed package of the class to be loaded as at least one service and at least one service agent, respectively.
[0084] The task acquisition module 704 may be used to acquire a task to be converted, where the task to be converted includes data to be converted and at least one split task to be converted.
[0085] The service search module 706 may be configured to determine at least one target service in at least one service of the component container according to the at least one split task to be converted.
[0086] In an exemplary embodiment, the service lookup module 706 can be used to use the at least one split task to be converted as an index, and each class loader is loaded in at least one service of the component container in the order of the class loader, the platform class loader and the system class loader to determine at least one target service.
[0087] In an exemplary embodiment, the service search module 706 may include an agent calling module for determining and calling the at least one target service agent in the at least one service agent of the component container according to the at least one split task to be converted; and a service search module for searching the at least one target service through the at least one target service agent.
[0088] The data conversion module 708 may be configured to execute the at least one target service in sequence through a unified interface to convert the data to be converted.
[0089] In an exemplary embodiment, the data conversion device 70 may further include a service unloading module for unloading a service of at least one class loader in the component container through at least one class loader.
[0090] In an exemplary embodiment, the data conversion device 70 may further include a software component model module, which is used to inject at least one service in the component container into the software component model so that the data receiver can apply the service in the software component model.
[0091] According to the data conversion device provided by the embodiment of the present disclosure, by registering at least one service in the component container through the class loader, it is possible to realize service registration according to user customized requirements, enhance the scalability of the service, and realize data conversion in a more flexible way; at the same time, after obtaining the task to be converted, at least one target service is executed through a unified interface, which can realize cross-class loader calls between different services to realize the function of dynamically running various services, and can avoid the serialization and deserialization process when passing parameters between class loaders, thereby improving the operation efficiency.
[0092] Figure 8 is an architecture diagram of a data conversion system according to another exemplary embodiment.
[0093] like Figure 8 As shown, the data provider can provide a platform as a component container to manage the installation, uninstallation, registration, and search of the data receiver's custom components. The process processing engine can obtain multiple components from this container to perform process orchestration to execute tasks.
[0094] The component container provides a unified interface, which is implemented by each component. The purpose of this standard interface is to ensure that the container has a unified calling entry and parameter passing entry for each component, and to avoid the serialization and deserialization process between different service calls. The specific implementation content and expansion business can be defined by the user.
[0095] The component container uses a hot loading mechanism to load components. During the actual operation, the process processing engine on the container side operates according to the pre-defined processing flow. At each specific processing node, it can dynamically find the services provided by each component according to the conversion process, and then perform corresponding processing.
[0096] The component container of the data provider supports multi-version management of components. Only one version of the same component can be activated at the same time, and the remaining versions are waiting to be activated. Free switching of different versions is supported.
[0097] The software component model that component services can be injected into the application APP means that the data recipient (interconnection supplier) can use the software component model in the conversion service developed by itself, that is, share its own functions with various components through the application.
[0098] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment.
[0099] Refer to the following Fig. 9 The electronic device 200 according to this embodiment of the present disclosure is described. Fig. 9 The electronic device 200 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0100] like Fig. 9 As shown, the electronic device 200 is in the form of a general computing device. The components of the electronic device 200 may include, but are not limited to: at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different system components (including the storage unit 220 and the processing unit 210), a display unit 240, etc.
[0101] The storage unit stores a program code, which can be executed by the processing unit 210, so that the processing unit 210 executes the steps according to various exemplary embodiments of the present disclosure described in the electronic prescription circulation processing method section of this specification. For example, the processing unit 210 can execute the following steps: Figure 2 , Figure 3 , Figure 6 Follow the steps shown in .
[0102] The storage unit 220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 2201 and / or a cache memory unit 2202 , and may further include a read-only memory unit (ROM) 2203 .
[0103] The storage unit 220 may also include a program / utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0104] Bus 230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0105] The electronic device 200 may also communicate with one or more external devices 300 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 200, and / or communicate with any device that enables the electronic device 200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 250. Furthermore, the electronic device 200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0106] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation of the present disclosure.
[0107] Fig.10A schematic diagram of a computer-readable storage medium in an exemplary embodiment of the present disclosure is schematically shown.
[0108] refer to Fig.10 As shown, a program product 400 for implementing the above method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0109] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0110] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0111] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0112] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the computer-readable medium implements the following functions: registering at least one service in a component container through at least one class loader; obtaining a task to be converted, wherein the task to be converted includes data to be converted and at least one split task to be converted; determining at least one target service in at least one service of the component container according to the at least one split task to be converted; and executing the at least one target service in sequence through a unified interface to convert the data to be converted.
[0113] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0114] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0115] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.
Claims
1. A data conversion method, characterized in that: include: registering at least one service in a component container via at least one class loader; Acquire a task to be converted, wherein the task to be converted includes data to be converted and at least one split task to be converted; Determine at least one target service in at least one service of the component container according to the at least one split task to be converted; Executing the at least one target service in sequence through a unified interface provided by the component container, and calling different target services across class loaders in the component container to convert the data to be converted; Wherein, registering at least one service in the component container through at least one class loader includes: Obtain at least one compressed package of the class to be loaded from each class loader, wherein the compressed package of the class to be loaded includes at least one compressed package and a compressed package directory, and the compressed package directory records the at least one compressed package; Based on the compressed package directory, filtering the at least one compressed package of the class to be loaded according to the existing compressed packages of the class in the component container to obtain a compressed package in the filtered at least one compressed package of the class to be loaded; Each class loader loads the compressed package in the filtered at least one compressed package of the class to be loaded as at least one service.
2. The method according to claim 1, characterized in that Determining at least one target service in at least one service of the component container according to the at least one split task to be converted includes: Taking the at least one split task to be converted as an index, each class loader loads at least one service of the component container in the order of the class loader, the platform class loader and the system class loader to determine at least one target service.
3. The method according to claim 1, characterized in that Registering at least one service in a component container through at least one class loader includes: Get at least one compressed package of classes to be loaded from each class loader; At least one service label class file and at least one service consumer in each class compression package to be loaded are registered as at least one service and at least one service agent respectively.
4. The method according to claim 3, characterized in that Determining at least one target service in at least one service of the component container according to the at least one split task to be converted includes: Determine and call the at least one target service agent in the at least one service agent of the component container according to the at least one split task to be converted; The at least one target service is searched through the at least one target service agent.
5. The method according to claim 1, characterized in that Also includes: Unloading a service of at least one class loader in the component container by at least one class loader.
6. The method according to claim 1 is characterized in that Also includes: At least one service in the component container is injected into the software component model so that a data receiver can apply the service in the software component model.
7. A data conversion device, characterized in that: include: A service registration module, used to register at least one service in a component container through at least one class loader; A task acquisition module, used to acquire a task to be converted, wherein the task to be converted includes data to be converted and at least one split task to be converted; A service search module, configured to determine at least one target service in at least one service of the component container according to the at least one split task to be converted; A data conversion module, used to execute the at least one target service in sequence through a unified interface provided by the component container, and different target services are called across class loaders in the component container to convert the data to be converted; Among them, the service registration module is used to obtain at least one compressed package of the class to be loaded for each class loader, the compressed package of the class to be loaded includes at least one compressed package and a compressed package directory, and the compressed package directory records the at least one compressed package; based on the compressed package directory, the at least one compressed package of the class to be loaded is filtered according to the existing class compressed packages in the component container to obtain the compressed package in the filtered at least one compressed package of the class to be loaded; and the compressed package in the filtered at least one compressed package of the class to be loaded is loaded as at least one service through each class loader.
8. An electronic device, characterized in that: include: one or more processors; as well as A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Software service implementation method and system, as well as Java platform
CN103294455A
Data filtering method and device
CN106649831A