Data processing method, device, electronic device and storage medium
By introducing a public channel into the class file loader, using the instances generated by the parent class loader for data transmission, the data interoperability problem caused by high coupling between class files is solved, and efficient data interaction between instances and system security is achieved. sex.
Patent Information
- Application Number
- CN202011338047.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-25
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-11-25
AI Technical Summary
In the prior art, the coupling between class files is high, resulting in the inability to communicate with the data between different types of files and the inability to achieve effective data interaction.
By determining a common channel between two different instances, the channel consists of at least one instance generated by the parent class loader, data transmission is implemented to ensure that the public channel can be accessed for data interaction between instances generated by the different class loader.
It realizes data interoperability between different instances, improves the efficiency of data interaction, and improves the security of the system.
Smart Images

Figure CN112328329B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] In the related art, class files are usually loaded using a single class loader or a multi-class loader system, which makes each class file highly coupled, resulting in data between different class files being unable to communicate with each other. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a data processing method, device, electronic device and storage medium to at least solve the problem that data between different types of files cannot be communicated with each other in the related art.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application provides a data processing method, the method comprising:
[0006] Determine a common channel corresponding to two different instances; the two different instances are generated by different class loaders respectively;
[0007] Data is transmitted between the two different instances through the determined corresponding public channel; wherein,
[0008] The common channel is characterized as a data transmission channel composed of instances generated by each parent class loader in at least one parent class loader; the at least one parent class loader includes at least a parent class loader corresponding to the instance that transfers data into the common channel.
[0009] In the above solution, the parent class loaders of the different class loaders are the same or different.
[0010] In the above solution, the parent class loader of the different class loaders is the same; and the determining of the corresponding common channel between two different instances includes:
[0011] The first instance is determined as the common channel corresponding to the two different instances; wherein,
[0012] The first instance is generated by a parent class loader of the different class loaders.
[0013] In the above solution, the parent class loaders of the different class loaders are different; and the determining of the corresponding common channel between two different instances includes:
[0014] The second instance, the third instance, and the common channel corresponding to the second instance and the third instance are determined as the common channel corresponding to the two different instances; wherein,
[0015] The second instance is an instance generated by a parent class loader corresponding to one of the two different instances; and the third instance is an instance generated by a parent class loader corresponding to another of the two different instances.
[0016] In the above solution, the transmitting of data between the two different instances through the determined corresponding public channel includes:
[0017] The fourth instance sends a first request to the fifth instance through the determined corresponding public channel; the first request is used to request data from the fifth instance;
[0018] The fifth instance returns a first response to the fourth instance through the determined corresponding public channel; the first response carries the data requested by the first request.
[0019] In the above solution, the different class loaders include two equal class loaders or two unequal class loaders.
[0020] In the above solution, before transmitting data between the two different instances through the determined corresponding public channel, the method further includes:
[0021] Instruct each parent class loader of the at least one parent class loader to load a corresponding class file and generate a corresponding instance.
[0022] The present application also provides a data processing device, including:
[0023] A determination unit, used to determine a corresponding common channel between two different instances; the two different instances are generated by different class loaders respectively;
[0024] A transmission unit, configured to transmit data between the two different instances through the determined corresponding public channel; wherein,
[0025] The common channel is characterized as a data transmission channel composed of instances generated by each parent class loader in at least one parent class loader; the at least one parent class loader includes at least a parent class loader corresponding to the instance that transfers data into the common channel.
[0026] The present application also provides an electronic device, including: a processor and a memory for storing a computer program that can be run on the processor.
[0027] Wherein, the processor is used to execute the steps of any of the above methods when running the computer program.
[0028] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0029] In an embodiment of the present application, a corresponding common channel is determined between two different instances, the two different instances are generated by different class loaders, and data is transmitted between the two different instances through the determined corresponding common channel, wherein the common channel is characterized as a data transmission channel composed of instances generated by each parent class loader in at least one parent class loader, and at least one parent class loader includes at least a parent class loader corresponding to the instance that transfers data to the common channel, so that data interaction can be carried out between the instances through the common channel, so that two-way communication can be achieved between different instances, thereby improving the efficiency of data interaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of an implementation flow of a data processing method provided in an embodiment of the present application;
[0031] Figure 2 A schematic diagram of a flow chart of direct access between instances provided in one embodiment of the present application;
[0032] Figure 3 A data flow diagram provided for an embodiment of the present application;
[0033] Figure 4 A data flow diagram provided for another embodiment of the present application;
[0034] Figure 5 A schematic diagram of an implementation flow of a data processing method provided in an embodiment of the present application;
[0035] Figure 6 A schematic diagram of the structure of a data processing device provided in one embodiment of the present application;
[0036] Figure 7 A schematic diagram of the hardware structure of an electronic device is provided for one embodiment of the present application. DETAILED DESCRIPTION
[0037] The present application is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0038] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0039] It should be noted that the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0040] In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0041] The present application embodiment provides a data processing method, Figure 1 Schematic diagram of a data processing method according to an embodiment of the present application. Figure 1 As shown, the method includes:
[0042] S101: Determine a common channel corresponding to two different instances; the two different instances are generated by different class loaders respectively.
[0043] Here, the corresponding public channel between two different instances is determined. Two different instances are generated by different class loaders. Class files are loaded and instantiated by class loaders to obtain corresponding instances. In actual applications, two instances generated by different class loaders are isolated and cannot access each other, so data cannot be exchanged. For example, Figure 2 As shown, Figure 2 This is a flowchart of direct access between instances. Figure 2 It is shown that the first type of file is loaded by class loader Loader1 to generate instance A, and the second type of file is loaded by class loader Loader2 to generate instance B. Instance A and instance B cannot access each other. In order to realize data interaction between two different instances, it is necessary to determine the corresponding public channel between the two different instances, and different instances can access the public channel. In practical applications, each instance is generated by a corresponding different class loader, and each instance is independent of each other and does not affect each other, so that when an instance in operation fails, other instances will not be affected, thereby improving the security of the system.
[0044] S102: transmitting data between the two different instances through the determined corresponding public channel; wherein,
[0045] The common channel is characterized as a data transmission channel composed of instances generated by each parent class loader in at least one parent class loader; the at least one parent class loader includes at least a parent class loader corresponding to the instance that transfers data into the common channel.
[0046] Here, data is transmitted between two different instances through a determined corresponding public channel. Since the two different instances can access the corresponding public channel, data transmission between the two different instances can be achieved based on the corresponding public channel, wherein the public channel represents a data transmission channel composed of instances generated by each parent class loader in at least one parent class loader, and at least one parent class loader includes at least a parent class loader corresponding to the instance that transfers data to the public channel. The instance that transfers data to the public channel is the instance that needs to perform data interaction. Based on the parent class loader corresponding to the instance that transfers data to the public channel, a corresponding public instance can be generated, and a class loader corresponding to the instance that transfers data to the public channel is generated as a child class loader of the parent class loader. The instance that transfers data to the public channel can access the public instance, thereby transmitting the data to be transmitted to the corresponding instance through the data transmission channel composed of the instances generated by the parent class loader, and data access between instances generated by different child class loaders can be achieved.
[0047] In the above embodiment, a corresponding common channel is determined between two different instances, the two different instances are generated by different class loaders respectively, and data is transmitted between the two different instances through the determined corresponding common channel, wherein the common channel is characterized as a data transmission channel composed of instances generated by each parent class loader in at least one parent class loader, and at least one parent class loader includes at least a parent class loader corresponding to the instance that transfers data to the common channel, so that data between different instances can be transmitted through the common channel, thereby enabling data intercommunication between different instances, which is conducive to improving data interaction efficiency.
[0048] In one embodiment, the parent class loaders of the different class loaders are the same or different.
[0049] Here, different class loaders correspond to the same parent class loader or different parent class loaders. In practical applications, when there are multiple instances, the data interaction between instances becomes complicated. The data transmission channel composed of public instances generated by a single parent class loader cannot meet the data interaction requirements between instances. In this case, more parent class loaders can be derived, and the public instances generated by the derived parent class loaders are lower-level public instances. Therefore, the parent class loaders of the class loaders corresponding to the instances that need to access data can be the same or different.
[0050] In one embodiment, the parent class loaders of the different class loaders are the same; and determining the corresponding common channel between two different instances includes:
[0051] The first instance is determined as the common channel corresponding to the two different instances; wherein,
[0052] The first instance is generated by a parent class loader of the different class loaders.
[0053] Here, when the parent class loaders of different class loaders are the same, it means that the instances generated by different class loaders correspond to the same first instance, and in actual applications, the instances generated by different class loaders can access the corresponding first instance, so that the first instance can be determined as the corresponding public channel between two different instances, wherein the first instance is generated by the parent class loaders of different class loaders. Figure 3 As shown, Figure 3 A data flow diagram is shown. Figure 3 In the example, the parent class loader of the class loaders corresponding to instance A and instance B is the same, so the first instance generated by the same parent class loader can be determined as a public channel. Since both instance A and instance B can access the first instance, instance A and instance B can complete data interaction based on the first instance.
[0054] In the above embodiment, when the parent class loaders of different class loaders are the same, the first instance is determined as the corresponding common channel between two different instances, wherein the first instance is generated by the parent class loaders of different class loaders, and the corresponding common channel can be determined according to the situation of the parent class loader, thereby improving the rate of data interaction.
[0055] In one embodiment, the parent class loaders of the different class loaders are different; and determining the corresponding common channel between two different instances includes:
[0056] The second instance, the third instance, and the common channel corresponding to the second instance and the third instance are determined as the common channel corresponding to the two different instances; wherein,
[0057] The second instance is an instance generated by a parent class loader corresponding to one of the two different instances; and the third instance is an instance generated by a parent class loader corresponding to another of the two different instances.
[0058] Here, when the parent class loaders of different class loaders are different, the instances generated by the parent class loaders corresponding to the class files generated by different class loaders are different. For example, the class loader corresponding to instance A is Loader1, the class loader corresponding to instance B is Loader2, the parent class loader corresponding to Loader1 is LoaderP1, and the parent class loader corresponding to Loader2 is LoaderP2. Then the instances generated by the parent class loaders LoaderP1 and LoaderP2 are different. Instance A can access the instance generated by LoaderP1 but cannot access the instance generated by LoaderP2. Instance B can access the instance generated by LoaderP2. However, the instance generated by LoaderP1 cannot be accessed. In order to enable instances generated by different class loaders with different parent class loaders to access each other, the second instance, the third instance, and the public channels corresponding to the second and third instances are determined as the public channels corresponding to the two different instances, wherein the second instance is an instance generated by the parent class loader corresponding to one of the two different instances. By way of example, the second instance can be an instance generated by the parent class loader LoaderP1 corresponding to instance A, and the third instance is an instance generated by the parent class loader LoaderP2 corresponding to the other of the two different instances. By way of example, the third instance can be an instance generated by the parent class loader LoaderP2 corresponding to instance B. In actual applications, when there are multiple class files, the public channel composed of instances generated by a single parent class loader cannot meet the transmission requirements. For this reason, a lower-level public instance can be derived based on the instance generated by a single parent class loader, so that parent class loaders corresponding to different class loaders will appear, such as Figure 4 As shown, Figure 4 A schematic diagram of data flow is shown. Figure 4 In the example, the class loaders of instance A and instance C correspond to the same parent class loader LoaderP1, so instance A and instance C can access the second instance generated by the parent class loader LoaderP1, and the class loaders of instance B and instance D correspond to the same parent class loader LoaderP2, so instance B and instance D can access the third instance generated by the parent class loader LoaderP2. However, since the class loaders of instance A and instance B correspond to different parent class loaders, instance A cannot access the third instance, and instance B cannot access the second instance. In order to realize data interaction between instance A and instance B, since the bottom-level public instance is derived from the second instance and the third instance, the upper-level public instance of the second instance and the third instance is determined. The upper-level public instance is the corresponding public channel between the second instance and the third instance. Figure 4, instance E is the corresponding public channel between the second instance and the third instance, so that when data interaction is required between instance A and instance B, instance A transmits data to the third instance through the second instance and the corresponding public channel between the second instance and the third instance, and instance B can obtain the corresponding data by accessing the third instance. Similarly, instance A can obtain the data transmitted by instance B through the third instance and the corresponding public channel between the second instance and the third instance by accessing the second instance. In practical applications, when the parent class loader corresponding to the class loader of the second instance is different from the parent class loader corresponding to the class loader of the third instance, the corresponding public channel between the two different instances can be determined according to the above method. For example, the corresponding public channel between the second instance, the third instance, the instance generated by the parent class loader corresponding to the class loader of the second instance, the instance generated by the parent class loader corresponding to the class loader of the third instance, and the instance generated by the parent class loader corresponding to the class loader of the second instance and the instance generated by the parent class loader corresponding to the class loader of the third instance are determined as the corresponding public channel between the two different instances.
[0059] In the above embodiment, when the parent class loaders of different class loaders are different, the second instance, the third instance, and the common channels corresponding to the second instance and the third instance are determined as the common channels corresponding to the two different instances, wherein the second instance is an instance generated by the parent class loader corresponding to one of the two different instances, and the third instance is an instance generated by the parent class loader corresponding to the other of the two different instances. Data interaction can be completed according to multiple common channels, thereby enabling data intercommunication between instances in a complex environment, thereby satisfying data interaction in different environments and improving the efficiency of data interaction.
[0060] In one embodiment, if Figure 5 As shown, the transmitting of data between the two different instances through the determined corresponding public channel includes:
[0061] S501: The fourth instance sends a first request to the fifth instance through the determined corresponding public channel; the first request is used to request data from the fifth instance.
[0062] Here, the fourth instance sends a first request to the fifth instance through the determined corresponding public channel. The first request is used to request data from the fifth instance. Data interaction occurs between the fourth instance and the fifth instance, so that the two instances that need to interact with data can be determined according to the first request. When data interaction is not required between the two instances, there is no need to determine the public channel corresponding to the instance. When data interaction is required between the two instances, a request for requesting data will be issued.
[0063] S502: The fifth instance returns a first response to the fourth instance through the determined corresponding public channel; the first response carries the data requested by the first request.
[0064] Here, the fifth instance returns a first response to the fourth instance through the determined corresponding public channel, and the first response carries the data requested by the first request. In actual applications, after the fifth instance receives the first request issued by the fourth instance through the public channel, it determines the data requested by the first request based on the first request, and returns the data requested by the first request to the fourth instance through the public channel, so that the fourth instance can obtain the requested data, thereby realizing data interaction between the two instances.
[0065] In the above embodiment, the fourth instance sends a first request to the fifth instance through the determined corresponding public channel to request data from the fifth instance, and the fifth instance returns a first response to the fourth instance through the determined corresponding public channel. The first response carries the data requested by the first request, and the two instances that need to interact with data can be determined, so that data interaction between the two instances can be achieved according to the data request, thereby improving the efficiency of data interaction.
[0066] In one embodiment, the different class loaders include two equal class loaders or two unequal class loaders.
[0067] Here, different class loaders include two equal class loaders or two unequal class loaders, wherein the equal class loaders may be two class loaders as parent class loaders, or two class loaders as child class loaders, and the unequal class loaders may be one class loader as parent class loader and one class loader as child class loader. For example, data interaction is required between instance A and instance B, instance A is generated by child class loader Loader1, and instance B is generated by child class loader Loader2, Loader1 and Loader2 are two different and equal class loaders, or the parent class loader LoaderP1 corresponding to child class loader Loader1 and the parent class loader LoaderP2 corresponding to the child class loader are two different and equal class loaders, while the child class loaders Loader1, Loader2 and the parent class loaders LoaderP1, LoaderP2 are unequal class loaders.
[0068] In the above embodiment, the class loaders that are not passed include two equal class loaders or two unequal class loaders, which can determine the common channel between different instances generated by different class loaders, realize data interaction between instances generated by different class loaders, and improve the efficiency of data interaction.
[0069] In one embodiment, before transmitting data between the two different instances through the determined corresponding common channel, the method further includes:
[0070] Instruct each parent class loader of the at least one parent class loader to load a corresponding class file and generate a corresponding instance.
[0071] Here, since the two different embodiments transmit data through the corresponding public channel determined, and the public channel is composed of instances generated by the parent class loader, it is necessary to instruct each parent class loader in at least one parent class loader to load the corresponding class file and generate the corresponding instance. In actual applications, when instructing the parent class loader to load the corresponding class file, the parent class loaders corresponding to the two instances of the corresponding public channel that need to be determined can be instructed to load the corresponding class file. In actual applications, after the parent class loader loads the corresponding class file and generates the corresponding instance, more and lower-level instances can be derived based on the generated instance, thereby satisfying the data interaction between instances in complex scenarios.
[0072] In the above embodiment, before transmitting data between two different instances through the corresponding public channel determined, each parent class loader in at least one parent class loader is instructed to load the corresponding class file and generate a corresponding instance, thereby generating a public channel between different instances, and the instances generated by the parent class loader can be split into different levels, thereby meeting the needs of complex data interaction between instances and improving the efficiency of data interaction between instances.
[0073] To implement the method of the embodiment of the present application, the embodiment of the present application also provides a class file loading device, such as Figure 6 As shown, the device comprises:
[0074] A determination unit 601 is used to determine a common channel corresponding to two different instances; the two different instances are generated by different class loaders respectively;
[0075] The transmission unit 602 is used to transmit data between the two different instances through the determined corresponding public channel; wherein,
[0076] The common channel is characterized as a data transmission channel composed of instances generated by each parent class loader in at least one parent class loader; the at least one parent class loader includes at least a parent class loader corresponding to the instance that transfers data into the common channel.
[0077] In one embodiment, the parent class loaders of different class loaders in the determining unit 601 are the same or different.
[0078] In one embodiment, the parent class loaders of the different class loaders are the same; the determining unit 601 determines the corresponding common channel between two different instances, including:
[0079] The first instance is determined as the common channel corresponding to the two different instances; wherein,
[0080] The first instance is generated by a parent class loader of the different class loaders.
[0081] In one embodiment, the parent class loaders of the different class loaders are different; the determining unit 601 determines the corresponding common channel between two different instances, including:
[0082] The second instance, the third instance, and the common channel corresponding to the second instance and the third instance are determined as the common channel corresponding to the two different instances; wherein,
[0083] The second instance is an instance generated by a parent class loader corresponding to one of the two different instances; and the third instance is an instance generated by a parent class loader corresponding to another of the two different instances.
[0084] In one embodiment, the determining unit 601 transmits data between the two different instances through the determined corresponding public channel, including:
[0085] The fourth instance sends a first request to the fifth instance through the determined corresponding public channel; the first request is used to request data from the fifth instance;
[0086] The fifth instance returns a first response to the fourth instance through the determined corresponding public channel; the first response carries the data requested by the first request.
[0087] In one embodiment, the different class loaders in the determining unit 601 include two equal class loaders or two unequal class loaders.
[0088] In one embodiment, before the determining unit 601 transmits data between the two different instances through the determined corresponding common channel, the apparatus further includes:
[0089] The generating unit is used to instruct each parent class loader of the at least one parent class loader to load the corresponding class file and generate the corresponding instance.
[0090] In actual application, the determination unit 601 and the transmission unit 602 can be implemented by a processor in a data processing device. Of course, the processor needs to run the program stored in the memory to implement the functions of the above program modules.
[0091] It should be noted that the above Figure 6 The data processing device provided in the embodiment only uses the division of the above-mentioned program modules as an example to illustrate when performing data processing. In actual applications, the above-mentioned processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the above-mentioned processing. In addition, the data processing device provided in the above embodiment and the data processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0092] Based on the hardware implementation of the above program module, and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an electronic device, Figure 7 Schematic diagram of the hardware structure of the electronic device of the present application embodiment. Figure 7 As shown, the electronic equipment includes:
[0093] Communication interface 1, capable of exchanging information with other devices such as network devices;
[0094] The processor 2 is connected to the communication interface 1 to realize information exchange with other devices and is used to execute the data processing method provided by one or more technical solutions when running a computer program. The computer program is stored in the memory 3.
[0095] Of course, in actual application, the various components in the electronic device are coupled together through the bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 4 .
[0096] The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.
[0097] It can be understood that the memory 3 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 3 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.
[0098] The method disclosed in the above embodiment of the present application can be applied to the processor 2, or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 2 or the instruction in the form of software. The above processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 3, and the processor 2 reads the program in the memory 3 and completes the steps of the above method in combination with its hardware.
[0099] When the processor 2 executes the program, the corresponding processes in the various methods of the embodiments of the present application are implemented, which will not be repeated here for the sake of brevity.
[0100] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, a memory 3 storing a computer program, and the computer program can be executed by a processor 2 to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.
[0101] In the several embodiments provided in the present application, it should be understood that the disclosed devices, terminals and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0102] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0103] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0104] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.
[0105] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0106] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: include: Determine the corresponding common channels between two different instances; The two different instances are generated by different class loaders respectively; the parent class loaders of the different class loaders are different; Data is transmitted between the two different instances through the determined corresponding public channel; wherein, The public channel is characterized as a data transmission channel composed of instances generated by each parent class loader in at least one parent class loader; the at least one parent class loader includes at least a parent class loader corresponding to the instance that transfers data into the public channel; The determining of the corresponding common channel between two different instances includes: The second instance, the third instance, and the common channel corresponding to the second instance and the third instance are determined as the common channel corresponding to the two different instances; wherein, The second instance is an instance generated by a parent class loader corresponding to one of the two different instances; and the third instance is an instance generated by a parent class loader corresponding to another of the two different instances.
2. The data processing method according to claim 1, characterized in that: The transmitting data between the two different instances through the determined corresponding public channel includes: The fourth instance sends a first request to the fifth instance through the determined corresponding public channel; the first request is used to request data from the fifth instance; The fifth instance returns a first response to the fourth instance through the determined corresponding public channel; the first response carries the data requested by the first request.
3. The data processing method according to claim 1, characterized in that: The different class loaders include two equal class loaders or two unequal class loaders.
4. The data processing method according to claim 1, characterized in that: Before transmitting data between the two different instances through the determined corresponding common channel, the method further includes: Instruct each parent class loader of the at least one parent class loader to load a corresponding class file and generate a corresponding instance.
5. A data processing device, characterized in that: include: A determination unit, used for determining a corresponding common channel between two different instances; The two different instances are generated by different class loaders respectively; A transmission unit, configured to transmit data between the two different instances through the determined corresponding public channel; wherein, The public channel is characterized as a data transmission channel composed of instances generated by each parent class loader in at least one parent class loader; the at least one parent class loader includes at least a parent class loader corresponding to the instance that transfers data into the public channel; Different class loaders in the determination unit have different parent class loaders; The determining unit is further configured to determine the second instance, the third instance, and the common channel corresponding to the second instance and the third instance as the common channel corresponding to the two different instances; wherein, The second instance is an instance generated by a parent class loader corresponding to one of the two different instances; and the third instance is an instance generated by a parent class loader corresponding to another of the two different instances.
6. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the method described in any one of claims 1 to 4.
7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
