CN109669787B - Data transmission method and device, storage medium and electronic equipment - Google Patents

Data transmission method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN109669787B
CN109669787B CN201811479205.7A CN201811479205A CN109669787B CN 109669787 B CN109669787 B CN 109669787B CN 201811479205 A CN201811479205 A CN 201811479205A CN 109669787 B CN109669787 B CN 109669787B
Authority
CN
China
Prior art keywords
service module
module
receiving
sending
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811479205.7A
Other languages
Chinese (zh)
Other versions
CN109669787A (en
Inventor
陈静
朱金奇
黄成�
戴英花
石忠杰
周冬生
董攀峰
胡细笔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hundsun Technologies Inc
Original Assignee
Hundsun Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hundsun Technologies Inc filed Critical Hundsun Technologies Inc
Priority to CN201811479205.7A priority Critical patent/CN109669787B/en
Publication of CN109669787A publication Critical patent/CN109669787A/en
Application granted granted Critical
Publication of CN109669787B publication Critical patent/CN109669787B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure relates to the field of computer technologies, and in particular, to a data transmission method and apparatus, a storage medium, and an electronic device. The method can comprise the following steps: responding to a command of sending data by the first service module, and creating a sending object of the first service module based on the theme identifier transmitted by the first service module; searching whether a receiving object corresponding to the subject identification exists in the receiving container; and if so, registering the callback function of the second service module corresponding to the receiving object to the sending object so that the sending object sends the received data sent by the first service module to the second service module according to the callback function. When the data transmission is in-process transmission, the data is transmitted directly through the sending object of the callback function of the second service module without the need of transmitting the data in a network transmission mode, so that a data transmission path is simplified, the occupancy rate of a network bandwidth is reduced, and the data transmission efficiency is improved.

Description

Data transmission method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data transmission method and apparatus, a storage medium, and an electronic device.
Background
In a large project system, the project system is generally divided into a plurality of modules according to different functions in the project system. The types of the modules can be divided into two types, one type is a service module used for processing data according to the functions of the service module, one service module corresponds to a single function, and the other type is a communication module used for transmitting data between the service modules. Namely, the project system is formed by assembling service modules with different functions and a communication module. The data transmission process in the project system comprises the following steps: and after the service module finishes processing the data, transmitting the data to the next service module through the communication module. In other words, the different business modules are like production workshops and are responsible for processing different business data, and the communication modules are like crawlers for transmitting data in the production workshops.
Generally, in actual deployment, due to different functional requirements, limitation of hardware resources, and the like, flexible assembly and deployment of the service module and the communication module are performed, and thus, a phenomenon that a plurality of service modules are deployed in the same process may occur. Based on this, data transmission in the project system is divided into intra-process data transmission (i.e., data transmission between service modules in the same process) and inter-process data transmission (i.e., data transmission between service modules of different processes). At present, data transmission in a process and data transmission between processes are transmitted in a network data transmission mode, that is, a communication module receives data transmitted by a service module sending the data, and the data is lost into a network card through a TCP/IP protocol so as to transmit the data to the service module receiving the data through the TCP/IP protocol.
Obviously, in the existing data transmission method, no matter whether the service module for transmitting data is in the same process, that is, no matter whether data transmission between processes or data transmission within processes, data is transmitted by adopting a network data transmission mode. Because the way of network data transmission has the problems of complex path, high occupancy rate of network bandwidth and low efficiency, it is important to simplify the data transmission path in the process, reduce the occupancy rate of network bandwidth and improve the transmission efficiency.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure aims to provide a data transmission method and apparatus, a storage medium, and an electronic device, so as to overcome the problems of complex data transmission path, high occupancy rate of network bandwidth, and low efficiency in a process at least to a certain extent.
According to an aspect of the present disclosure, there is provided a data transmission method including:
responding to a command of sending data by a first service module, and creating a sending object of the first service module based on the theme identification transmitted by the first service module;
searching whether a receiving object corresponding to the subject identification exists in a receiving container;
if the callback function exists, the callback function of the second service module corresponding to the receiving object is registered to the sending object, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
In an exemplary embodiment of the disclosure, the creating a sending object of the first business module based on the topic identification transmitted by the first business module includes:
loading a configuration file, and searching a target address and a target port corresponding to the subject identifier from the configuration file;
and creating a sending object of the first business module based on the target address and the target port.
In an exemplary embodiment of the present disclosure, the method further comprises:
and storing the subject identification and the sending object of the callback function registered in the second service module to a sending container.
In an exemplary embodiment of the present disclosure, the method further comprises:
receiving the theme identification transmitted by the second service module and the callback function of the second service module;
creating a receiving object of the second service module based on the callback function;
and storing the subject identification and the receiving object to a receiving container.
In an exemplary embodiment of the present disclosure, the first service module is a service module that transmits the subject identifier through a first interface;
and the second service module is a service module for transmitting the theme identifier and the callback function through a second interface.
According to an aspect of the present disclosure, there is provided a data transmission apparatus including:
the first creating module is used for responding to a command of sending data by the first business module and creating a sending object of the first business module based on the theme identification transmitted by the first business module;
the searching module is used for searching whether a receiving object corresponding to the subject identification exists in the receiving container;
and if the callback function exists, registering the callback function of the second service module corresponding to the receiving object to the sending object so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
In an exemplary embodiment of the present disclosure, the first creating module includes:
the loading and searching unit is used for loading a configuration file and searching a target address and a target port corresponding to the subject identifier from the configuration file;
and the creating unit is used for creating a sending object of the first business module based on the target address and the target port.
In an exemplary embodiment of the present disclosure, the apparatus further includes:
the receiving module is used for receiving the theme identifier transmitted by the second service module and the callback function of the second service module;
the second creating module is used for creating a receiving object of the second service module based on the callback function;
and the storage module is used for storing the subject identification and the receiving object to a receiving container.
According to an aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a data transmission method as recited in any one of the above.
According to an aspect of the present disclosure, there is provided an electronic device including:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data transmission method of any one of the above via execution of the executable instructions.
The invention discloses a data transmission method and device, a storage medium and electronic equipment. Creating a sending object of a first business module based on the theme identification transmitted by the first business module; searching whether a receiving object corresponding to the subject identification exists in a receiving container; if the callback function exists, the callback function of the second service module corresponding to the receiving object is registered to the sending object, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function. On one hand, whether a receiving object corresponding to the subject identification exists or not is searched in the receiving container, whether the first service module and the second service module belong to the same process or not is judged, namely whether data transmission in the process is judged or not, the judging step is simple, and the method is easy to realize; on the other hand, if a receiving object corresponding to the topic identifier exists, namely when the first service module and the second service module belong to the same process, the callback function of the second service module is registered to the sending object of the first service module, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The above and other features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. In the drawings:
FIG. 1 is a flow chart of a data transmission method of the present disclosure;
FIG. 2 is a flow diagram of creating a send object for a first business module provided in an exemplary embodiment of the present disclosure;
FIG. 3 is a flow chart of creating a receiving object for a second business module provided in an exemplary embodiment of the present disclosure;
FIG. 4 is a block diagram of a data transmission device of the present disclosure;
FIG. 5 is a block diagram of an electronic device in an exemplary embodiment of the present disclosure;
fig. 6 is a schematic diagram of a program product in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the embodiments of the disclosure can be practiced without one or more of the specific details, or with other methods, components, materials, devices, steps, and so forth. In other instances, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in the form of software, or in one or more software-hardened modules, or in different networks and/or processor devices and/or microcontroller devices.
The exemplary embodiment first discloses a data transmission method, which is applied to a system comprising a plurality of processes, wherein each process comprises a communication module and at least one service module. The communication module in each process comprises a receiving container and a sending container. The sending container is used for storing the theme identification transmitted when each business module in the corresponding process sends data and the created sending object, and the receiving container is used for storing the theme identification transmitted when each business module in the corresponding process receives data and the created receiving object. It should be noted that one service module may receive data and may also send data, that is, one service module may be a service module that receives data and may also be a service module that sends data. It should be noted that the execution main body in the embodiment of the present invention may be a communication module in a process, where data transmission exists between service modules in the process or between the process and service modules of other processes.
As shown in fig. 1, the method may include the steps of:
step S110, responding to a data sending instruction of a first service module, and creating a sending object of the first service module based on a theme mark transmitted by the first service module;
step S120, searching whether a receiving object corresponding to the subject identification exists in a receiving container;
step S130, if the callback function exists, registering the callback function of the second service module corresponding to the receiving object to the sending object, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
According to the data transmission method in the exemplary embodiment, on one hand, whether the first service module and the second service module belong to the same process is judged by searching whether a receiving object corresponding to the subject identifier exists in the receiving container, that is, whether the data transmission in the process is judged, and the judgment step is simple and easy to implement; on the other hand, if a receiving object corresponding to the topic identifier exists, namely when the first service module and the second service module belong to the same process, the callback function of the second service module is registered to the sending object of the first service module, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
Next, the data transmission method in the present exemplary embodiment will be further described with reference to fig. 1.
In step S110, in response to an instruction of sending data by a first service module, a sending object of the first service module is created based on the topic identifier transmitted by the first service module.
In this exemplary embodiment, the first service module may be a service module that transmits the topic identifier through the first interface, and it may also be a service module that transmits data. The communication module may include a plurality of interfaces, wherein the first interface is one of the plurality of interfaces on the communication module.
After the first service module transmits the instruction of the first service module for sending data and the subject identifier to the communication module through the first interface, the communication module responds to the instruction of the first service module for sending data, and creates a sending object of the first service module based on the subject identifier transmitted by the first service module. The subject mark is used for marking the target address and the target port of the business module for receiving the data sent by the first business module. The target address may be 192.168.1.1 or 192.168.1.2, for example, which is not limited in this exemplary embodiment. The destination port may refer to, for example, a number of a port on a traffic module receiving data, for example, 1234, which is not specifically limited in this exemplary embodiment.
Specifically, as shown in fig. 2, the creating of the sending object of the first service module based on the topic identifier transmitted by the first service module includes steps S210 and S220, where:
in step S210, a configuration file is loaded, and a target address and a target port corresponding to the subject identifier are searched from the configuration file.
In this exemplary embodiment, each topic identifier, and a target address and a target port corresponding to each topic identifier are stored in the configuration file, for example: topic identification a 192.168.1.1: 1234, where 192.168.1.1 is the destination address and 1234 is the destination port. When the first service module transmits the subject identifier to the communication module, the communication module loads a configuration file, matches the subject identifier transmitted by the first service module with each subject identifier in the configuration file, and determines a target address and a target port corresponding to the successfully-matched subject identifier as a target address and a target port corresponding to the subject identifier transmitted by the first service module.
It should be noted that the destination address and the destination port corresponding to the subject identifier may also be directly transmitted to the communication module by the first service module through the first interface, and are not required to be obtained by the communication module by loading the configuration file.
In step S220, a sending object of the first service module is created based on the destination address and the destination port. In the exemplary embodiment, the sending object of the first business module is created based on the target address and the target port corresponding to the topic identifier transmitted by the first business module. It should be noted that the above-mentioned manner for creating the transmission object of the first module is only exemplary, and is not intended to limit the present invention.
In step S120, whether a receiving object corresponding to the subject identifier exists is searched for from the receiving container.
In the present exemplary embodiment, the receiving container here refers to a receiving container maintained in a communication module in the same process to which the first service module belongs. The receiving container stores all receiving objects in the process and the corresponding theme identifications of all the receiving objects. It should be noted that the receiving container may also include the first service module as a receiving object for the topic identification and creation transmitted by the service module for receiving data.
And matching the subject identifier transmitted by the first service module with each subject identifier in the receiving container, and searching whether a receiving object corresponding to the subject identifier transmitted by the first service module exists or not by judging whether the subject identifier matched with the subject identifier transmitted by the first service module exists or not, namely determining the receiving object corresponding to the subject identifier successfully matched with the subject identifier transmitted by the first service module as the receiving object corresponding to the subject identifier transmitted by the first service module if the subject identifier matched with the subject identifier transmitted by the first service module exists.
In step S130, if the callback function exists, the callback function of the second service module corresponding to the receiving object is registered in the sending object, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
In this exemplary embodiment, the service module receiving the data is the second service module, and if a receiving object corresponding to the subject identifier transmitted by the first service module exists in the receiving container, it is described that the first service module and the second service module corresponding to the receiving object (i.e., the service module that needs to receive the data sent by the first service module) belong to the same process, so that this data transmission is data transmission in the process.
And when the data transmission is in-process data transmission, registering a callback function of a second service module corresponding to the receiving object to the sending object, and sending the received data sent by the first service module to the second service module by the sending object according to the callback function.
In this exemplary embodiment, if there is no receiving object corresponding to the topic identifier transmitted by the first service module in the receiving container, it is described that the first service module and a second service module corresponding to the receiving object (i.e., a service module that needs to receive data sent by the first service module) belong to different processes, that is, this data transmission is inter-process data transmission.
When the data transmission is judged to be interprocess data transmission, the first service module sends the data to a sending object, and the sending object discards the received data to the network card through a TCP/IP protocol so as to transmit the data to the service module for receiving the data through the TCP/IP protocol.
To facilitate management of the send object, the topic identification and the send object of the callback function that registers the second business module may be stored to a send container. The sending container here refers to a sending container maintained in the communication module in the process to which the first service module belongs.
Before step S120, as shown in fig. 3, the method may further include steps S310 to S330, wherein:
in step S310, the topic identifier transmitted by the second service module and the callback function of the second service module are received.
In this exemplary embodiment, the second service module is a service module that transmits the topic identifier and the callback function through the second interface, that is, the second service module transmits the topic identifier and the callback function of the second service module to the communication module through the second interface. The second service module here is a service module that receives data. The communication module comprises a plurality of interfaces, and the second interface is one of the plurality of interfaces on the communication module. The subject identification has been described above and is not described herein.
In step S320, a receiving object of the second service module is created based on the callback function.
In step S330, the subject identifier and the receiving object are stored in a receiving container.
In the present exemplary embodiment, the receiving container herein refers to a receiving container maintained in a communication module in the same process as the second service module. If the second service module and the first service module belong to the same process, the receiving container in this case is the same receiving container as the receiving container in step S120. If the second service module and the first service module do not belong to the same process, the receiving container here is a different receiving container from the receiving container in step S120.
In summary, whether a receiving object corresponding to the subject identifier exists or not is searched in the receiving container, so as to determine whether the first service module and the second service module belong to the same process, that is, whether data transmission in the process is performed or not is determined, and the determining step is simple and easy to implement; in addition, if a receiving object corresponding to the theme identifier exists, namely when the first service module and the second service module belong to the same process, the callback function of the second service module is registered to the sending object of the first service module, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
It should be noted that, in the above process, the receiving object corresponding to the subject identifier is searched from the receiving container, so as to determine whether the data transmission is an in-process data transmission. In other exemplary embodiments of the present disclosure, it may also be determined whether the data transmission is data transmission in a process by searching for a sending object corresponding to the subject identifier from the sending container. The specific process can include: the communication module receives the theme identification transmitted by the second service module and the callback function of the second service module; creating a receiving object of the second service module based on the callback function; storing the subject identification and the receiving object into a receiving container maintained in a communication module in the same process as the second service module; the communication module receives a subject identifier transmitted by a first service module (the subject identifier is the same as the subject identifier transmitted by a second service), creates a sending object of the first service module based on the subject identifier, and stores the subject identifier and the sending object into a sending container maintained in the communication module in the same process as the first service module; and searching whether a sending object corresponding to the theme identifier transmitted by the second service module exists in a sending container maintained in the communication module in the same process as the second service module, if so, indicating that the first service module and the second service module belong to the same process, and registering a callback function of the second service module into the sending object so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
In an exemplary embodiment of the present disclosure, there is also provided a data transmission apparatus, as shown in fig. 4, the apparatus 400 may include: a first creating module 401, a searching module 402, and a registering module 403, wherein:
a first creating module 401, configured to respond to an instruction for a first service module to send data, and create a sending object of the first service module based on a topic identifier transmitted by the first service module;
a searching module 402, which may be configured to search from a receiving container whether a receiving object corresponding to the subject identifier exists;
the registering module 403 may be configured to register, if the callback function exists, the callback function of the second service module corresponding to the receiving object with the sending object, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
In an exemplary embodiment of the present disclosure, the first creating module 401 may include: loading a lookup unit and a creation unit, wherein:
the loading and searching unit may be configured to load a configuration file, and search a target address and a target port corresponding to the subject identifier from the configuration file;
a creating unit, configured to create a sending object of the first traffic module based on the destination address and the destination port.
In an exemplary embodiment of the present disclosure, the apparatus 400 may further include: a receiving module, a second creating module and a storing module, wherein:
the receiving module may be configured to receive the topic identifier transmitted by the second service module and the callback function of the second service module;
a second creating module, configured to create a receiving object of the second service module based on the callback function;
the storage module may be configured to store the subject identifier and the receiving object in a receiving container.
The specific details of each data transmission device module are already described in detail in the corresponding data transmission method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the apparatus for performing are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 500 according to this embodiment of the invention is described below with reference to fig. 5. The electronic device 500 shown in fig. 5 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the electronic device 500 is embodied in the form of a general purpose computing device. The components of the electronic device 500 may include, but are not limited to: the at least one processing unit 510, the at least one memory unit 520, a bus 530 connecting various system components (including the memory unit 520 and the processing unit 510), and a display unit 540.
Wherein the storage unit stores program code that is executable by the processing unit 510 to cause the processing unit 510 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 510 may execute step S110 shown in fig. 1, in response to an instruction for a first service module to send data, create a sending object of the first service module based on the topic identifier transmitted by the first service module; step S120, searching whether a receiving object corresponding to the subject identification exists in a receiving container; step S130, if the callback function exists, registering the callback function of the second service module corresponding to the receiving object to the sending object, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function.
The memory unit 520 may include a readable medium in the form of a volatile memory unit, such as a random access memory unit (RAM)5201 and/or a cache memory unit 5202, and may further include a read only memory unit (ROM) 5203.
Storage unit 520 may also include a program/utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 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 thereof, may comprise an implementation of a network environment.
Bus 530 may be one or more of any 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.
The electronic device 500 may also communicate with one or more external devices 570 (e.g., keyboard, pointing device, Bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 500, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 500 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 550. Also, the electronic device 500 may 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 the network adapter 560. As shown, the network adapter 560 communicates with the other modules of the electronic device 500 over the bus 530. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 6, a program product 600 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind 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).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.

Claims (10)

1. A data transmission method is applied to a system comprising a plurality of processes, each process comprises a communication module and at least one business module, the communication module in each process comprises a receiving container and a sending container, wherein the sending container is used for storing a theme identifier transmitted when each business module in the corresponding process sends data and a created sending object, and the receiving container is used for storing the theme identifier transmitted when each business module in the corresponding process receives the data and a created receiving object, and the method comprises the following steps:
responding to a command of sending data by a first service module, and creating a sending object of the first service module by a communication module based on a theme identifier transmitted by the first service module;
the communication module searches whether a receiving object corresponding to the subject identification exists in the receiving container or not;
if the first service module and the second service module corresponding to the receiving object belong to the same process, the communication module registers a callback function of the second service module corresponding to the receiving object to the sending object, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function;
and if the data does not exist, the communication module transmits the received data sent by the first service module to a service module for receiving the data in a network transmission mode.
2. The data transmission method of claim 1, wherein the communication module creating the sending object of the first business module based on the topic identification transmitted by the first business module comprises:
the communication module loads a configuration file, and searches a target address and a target port corresponding to the subject identifier from the configuration file;
the communication module creates a sending object of the first traffic module based on the destination address and the destination port.
3. The data transmission method of claim 1, further comprising:
and the communication module stores the theme identifier and the sending object of the callback function registered in the second service module to a sending container.
4. The data transmission method of claim 1, further comprising:
the communication module receives the theme identifier transmitted by the second service module and the callback function of the second service module;
the communication module creates a receiving object of the second service module based on the callback function;
the communication module stores the subject identification and the receiving object to a receiving container.
5. The data transmission method according to claim 1, wherein the first service module is a service module that transmits the subject identifier through a first interface;
and the second service module is a service module for transmitting the theme identifier and the callback function through a second interface.
6. A data transmission device is applied to a system comprising a plurality of processes, each process comprises a communication module and at least one business module, the communication module in each process comprises a receiving container and a sending container, wherein the sending container is used for storing a theme identifier transmitted when each business module in the corresponding process sends data and a created sending object, and the receiving container is used for storing the theme identifier transmitted when each business module in the corresponding process receives data and a created receiving object, and the data transmission device comprises:
the first creating module is used for responding to a command of sending data by the first business module and creating a sending object of the first business module based on the theme identification transmitted by the first business module;
the searching module is used for searching whether a receiving object corresponding to the subject identification exists in the receiving container;
if the first service module and the second service module corresponding to the receiving object belong to the same process, registering a callback function of the second service module corresponding to the receiving object to the sending object, so that the sending object sends the received data sent by the first service module to the second service module according to the callback function;
and if the data does not exist, the communication module transmits the received data sent by the first service module to a service module for receiving the data in a network transmission mode.
7. The data transmission apparatus according to claim 6, wherein the first creation module comprises:
the loading and searching unit is used for loading a configuration file and searching a target address and a target port corresponding to the subject identifier from the configuration file;
and the creating unit is used for creating a sending object of the first business module based on the target address and the target port.
8. The data transmission apparatus of claim 6, wherein the apparatus further comprises:
the receiving module is used for receiving the theme identifier transmitted by the second service module and the callback function of the second service module;
the second creating module is used for creating a receiving object of the second service module based on the callback function;
and the storage module is used for storing the subject identification and the receiving object to a receiving container.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the data transmission method according to any one of claims 1 to 5.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data transmission method of any one of claims 1-5 via execution of the executable instructions.
CN201811479205.7A 2018-12-05 2018-12-05 Data transmission method and device, storage medium and electronic equipment Active CN109669787B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811479205.7A CN109669787B (en) 2018-12-05 2018-12-05 Data transmission method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811479205.7A CN109669787B (en) 2018-12-05 2018-12-05 Data transmission method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN109669787A CN109669787A (en) 2019-04-23
CN109669787B true CN109669787B (en) 2021-05-25

Family

ID=66144936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811479205.7A Active CN109669787B (en) 2018-12-05 2018-12-05 Data transmission method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN109669787B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764745B (en) * 2019-09-16 2024-02-02 平安科技(深圳)有限公司 Variable transmission and collection method, device and computer readable storage medium
CN112181542A (en) * 2020-09-30 2021-01-05 微医云(杭州)控股有限公司 Function calling method and device, electronic equipment and storage medium
CN112596824A (en) * 2021-01-04 2021-04-02 天津中新智冠信息技术有限公司 Information interaction method and device, electronic equipment and storage medium
CN112925568B (en) * 2021-03-28 2022-07-26 杭州迪普信息技术有限公司 Data transmission method and control device between modules

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1306430C (en) * 2002-12-31 2007-03-21 上海科泰世纪科技有限公司 User self-defining event mechanism based on structure
CN103677975A (en) * 2013-12-09 2014-03-26 北京恒华伟业科技股份有限公司 System and method for having access to internal objects of application systems
CN104580209B (en) * 2015-01-06 2017-08-01 烽火通信科技股份有限公司 Realize the device and method of multi-platform Message Processing
CN107515793A (en) * 2017-08-22 2017-12-26 四川长虹电器股份有限公司 A kind of module communication means for supporting message mechanism

Also Published As

Publication number Publication date
CN109669787A (en) 2019-04-23

Similar Documents

Publication Publication Date Title
CN109669787B (en) Data transmission method and device, storage medium and electronic equipment
US11050814B2 (en) Method, device and vehicle for message deduplication
CN109213611B (en) Cross-process communication method, device, terminal and storage medium
CN109766082B (en) Method and device for application program page jump
CN109936587B (en) Control method, control device, electronic apparatus, and storage medium
CN111177112A (en) Database blocking method and device based on operation and maintenance management system and electronic equipment
CN107404418B (en) Internet product testing method, device, equipment and storage medium
CN111432000A (en) Control method, device, equipment and storage medium of Internet of things equipment
CN109672722B (en) Data deployment method and device, computer storage medium and electronic equipment
CN110990081A (en) Microservice registration and discovery method and device, storage medium and electronic equipment
US11934287B2 (en) Method, electronic device and computer program product for processing data
CN107817962B (en) Remote control method, device, control server and storage medium
CN113761428A (en) Page rendering method, device and system, storage medium and electronic equipment
CN112328272B (en) Algorithm upgrading method, device, equipment and storage medium
US20130232509A1 (en) Dynamic user interface aggregation through smart eventing with non-instantiated content
CN113992759B (en) Combined analysis device and method applied to local area network and electronic equipment
CN103380593B (en) A kind of in system upgrade process to method, device and equipment that business processes
CN112948138A (en) Method and device for processing message
CN111857546A (en) Method, network adapter and computer program product for processing data
CN113434089B (en) Data moving method and device and PCIE system
CN115412993A (en) Relay discovery method, system, device and storage medium
CN111949862B (en) Method and device for managing business task flow and electronic equipment
CN112711602B (en) Method and device for running stored procedure, database system and storage medium
CN112187842B (en) Local area network data processing system and local area network data processing method
CN114237684A (en) Component management system, method, device, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant