CN116827704A - Data transmission method, device, equipment and medium - Google Patents

Data transmission method, device, equipment and medium Download PDF

Info

Publication number
CN116827704A
CN116827704A CN202310761897.9A CN202310761897A CN116827704A CN 116827704 A CN116827704 A CN 116827704A CN 202310761897 A CN202310761897 A CN 202310761897A CN 116827704 A CN116827704 A CN 116827704A
Authority
CN
China
Prior art keywords
data
target data
module
target
message
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.)
Pending
Application number
CN202310761897.9A
Other languages
Chinese (zh)
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.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202310761897.9A priority Critical patent/CN116827704A/en
Publication of CN116827704A publication Critical patent/CN116827704A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The application relates to the technical field of communication, in particular to a data transmission method, a device, equipment and a medium, which solve the problems that in the prior art, electronic equipment possibly sends a plurality of messages carrying the same data to the same other electronic equipment, so that the data volume transmitted between two electronic equipment is overlarge and the data transmission efficiency is low. In the embodiment of the application, the electronic equipment receives the first message carrying the first target data sent by other electronic equipment, and broadcasts the first target data to each module of the message subscribed to the first object to which the first target data belongs in the target component configured by the electronic equipment, namely, the electronic equipment and each other electronic equipment only perform one-time data transmission, so that each module which is configured in the electronic equipment and needs the first target data can acquire the first target data, the data transmission quantity among the electronic equipment is reduced, and the data transmission efficiency is improved.

Description

Data transmission method, device, equipment and medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method, apparatus, device, and medium.
Background
In the related art, different components are installed in different electronic devices, and one component may be configured with a plurality of modules, each module having a different function, and each module may need to use data in other modules of other components at runtime.
Based on this, for each piece of data generated by each component, the identity of each module that stores a message that has subscribed to the object to which the data belongs in the electronic device to which the component is attached, and other electronic devices to which each module corresponds. When data transmission is carried out, the electronic equipment respectively sends messages carrying the data and the identification of the module to other electronic equipment installed by each module subscribed to the data.
However, there may be a plurality of modules in one electronic device subscribed to the data, that is, the electronic device may send a plurality of messages carrying the data to the same other electronic device, which further results in an excessive amount of data transmitted between the two electronic devices, affecting the efficiency of data transmission.
Disclosure of Invention
The application provides a data transmission method, a device, equipment and a medium, which are used for solving the problems that in the prior art, electronic equipment possibly sends a plurality of messages carrying the same data to the same other electronic equipment, so that the data quantity transmitted between two electronic equipment is overlarge and the data transmission efficiency is low.
The embodiment of the application provides a data transmission method which is applied to electronic equipment configured with a target component, and comprises the following steps:
receiving a first message carrying first target data sent by other electronic equipment, wherein the first message is sent after the first message is used for determining that the first target data to be synchronized exists in a self-configured component of the other electronic equipment;
determining a first object to which the first target data belongs according to the data carried in the first target data;
broadcasting the first target data and the first object such that each module in the target component that has subscribed to the message of the first object receives the first target data.
Further, the broadcasting the first target data and the first object includes:
determining a first interface corresponding to each first candidate module to be received with the first target data and the first object;
and scheduling a first interface corresponding to each first candidate module, and sending the first target data and the first object to the first candidate module through the first interface.
Further, the determining each first candidate module to receive the first target data and the first object includes:
Determining each module of the local configuration as the first candidate module; or alternatively, the first and second heat exchangers may be,
acquiring a target identifier of each module of the pre-stored message subscribed to the first object in the target component; and determining each module corresponding to each target identifier as each first candidate module.
Further, after receiving the first message carrying the first target data sent by the other electronic device, the method further includes:
acquiring first target data in a json data format carried in the first message and a first data type corresponding to the first target data;
determining a first mapping relation corresponding to the first data type according to the corresponding relation between the pre-stored data type and the mapping relation, wherein the first mapping relation stores the corresponding relation between each sub data in the first target data and json data field;
according to the first mapping relation, analyzing the first target data in the json data format, and converting the first target data in the json data format into a preset data format;
broadcasting the first target data and the first object includes:
and broadcasting the first target data converted into the preset data format and the first object.
Further, the method further comprises:
if the second target data to be synchronized exist in the target component, the electronic equipment determines a second object to which the second target data belongs according to the data carried in the second target data, and acquires the pre-stored information of other electronic equipment where each other component subscribed to the information of the second object is located;
and sending a second message carrying the second target data to each other electronic device, so that each module of the message subscribed to the second object in the configured component in each other electronic device acquires the second target data.
Further, the sending the second message carrying the second target data to each other electronic device includes:
acquiring a second data type carried in the second target data, and determining a second mapping relation corresponding to the second data type according to a corresponding relation between a pre-stored data type and the mapping relation;
according to the second mapping relation, converting the second target data into json data format; wherein, the second mapping relation stores the corresponding relation between each sub data in the second target data and json data field;
And sending a second message carrying the second data type and second target data converted into json data format to each other electronic device.
Further, the method further comprises:
determining a second interface corresponding to each second candidate module to be received in the electronic equipment, wherein the second interface corresponds to each second candidate module;
and scheduling a second interface corresponding to each second candidate module, and sending the second target data and the second object to the second candidate module through the second interface.
The embodiment of the application also provides a data transmission device, which comprises:
the receiving module is used for receiving a first message carrying first target data sent by other electronic equipment, wherein the first message is sent after the other electronic equipment determines that the first target data to be synchronized exists in a self-configured component;
the processing module is used for determining a first object to which the first target data belongs according to the data carried in the first target data;
and the broadcasting module is used for broadcasting the first target data and the first object, so that each module of the target assembly, which is subscribed to the message of the first object, receives the first target data.
Further, the broadcasting module is specifically configured to determine each first candidate module to receive the first target data and the first object and a first interface corresponding to each first candidate module; and scheduling a first interface corresponding to each first candidate module, and sending the first target data and the first object to the first candidate module through the first interface.
Further, the processing module is specifically configured to determine each module configured locally as each first candidate module; or, acquiring a target identifier of each module of the pre-stored message subscribed to the first object in the target component; and determining each module corresponding to each target identifier as each first candidate module.
Further, the processing module is further configured to obtain first target data in a json data format carried in the first message and a first data type corresponding to the first target data; determining a first mapping relation corresponding to the first data type according to the corresponding relation between the pre-stored data type and the mapping relation, wherein the first mapping relation stores the corresponding relation between each sub data in the first target data and json data field; according to the first mapping relation, analyzing the first target data in the json data format, and converting the first target data in the json data format into a preset data format;
The broadcasting module is specifically configured to broadcast the first target data converted into the preset data format and the first object.
Further, the processing module is further configured to determine, if it is identified that second target data to be synchronized exists in the target components, a second object to which the second target data belongs according to data carried in the second target data, and obtain information of other electronic devices where each other component of the pre-stored message subscribed to the second object is located;
the broadcasting module is further configured to send a second message carrying the second target data to each other electronic device, so that each module of the configured components in each other electronic device, which has subscribed to the message of the second object, obtains the second target data.
Further, the processing module is further configured to obtain a second data type carried in the second target data, and determine a second mapping relationship corresponding to the second data type according to a pre-stored correspondence between the data type and the mapping relationship; according to the second mapping relation, converting the second target data into json data format; wherein, the second mapping relation stores the corresponding relation between each sub data in the second target data and json data field;
And the broadcasting module is further used for sending a second message carrying the second data type and second target data converted into json data format to each other electronic device.
Further, the broadcasting module is specifically configured to determine each second candidate module in the electronic device that is to receive the second target data and the second object, and a second interface corresponding to each second candidate module; and scheduling a second interface corresponding to each second candidate module, and sending the second target data and the second object to the second candidate module through the second interface.
The embodiment of the application also provides electronic equipment, which comprises a processor, wherein the processor is used for realizing the steps of any one of the data transmission methods when executing the computer program stored in the memory.
The embodiment of the application also provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the data transmission method as described in any one of the above.
Embodiments of the present application also provide a computer program product comprising: computer program code for causing a computer to carry out the steps of any one of the data transmission methods described above when said computer program code is run on a computer.
In the embodiment of the application, the electronic equipment receives a first message carrying first target data sent by other electronic equipment, wherein the first message is sent after the other electronic equipment determines that the first target data to be synchronized exists in a self-configured component; determining a first object to which the first target data belongs according to the data carried in the first target data; the first target data and the first object are broadcast such that each module in the target component that has subscribed to the message of the first object receives the first target data. Because, in the embodiment of the application, the electronic device receives the first message carrying the first target data sent by the other electronic devices, and broadcasts the first target data to each module of the message subscribed to the first object to which the first target data belongs in the target component configured by the electronic device, namely, only one data transmission is performed between the electronic device and each other electronic device, so that each module which is configured in the electronic device and needs the first target data can acquire the first target data, thereby reducing the data transmission quantity between the electronic devices and improving the data transmission efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a data transmission process according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a data structure according to an embodiment of the present application;
fig. 3 is a schematic diagram of a first mapping relationship corresponding to the case where first target data provided in the embodiment of the present application is basic bond information;
fig. 4 is a schematic diagram of a first mapping relationship corresponding to a bond time plan according to the first target data provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In order to reduce data transmission amount between electronic devices and improve data transmission efficiency, the embodiment of the application provides a data transmission method, a device, equipment and a medium.
In the embodiment of the application, the electronic equipment receives a first message carrying first target data sent by other electronic equipment, wherein the first message is sent after the other electronic equipment determines that the first target data to be synchronized exists in a self-configured component; determining a first object to which the first target data belongs according to the data carried in the first target data; the first target data and the first object are broadcast such that each module in the target component that has subscribed to the message of the first object receives the first target data.
Example 1:
fig. 1 is a schematic diagram of a data transmission process according to an embodiment of the present application, where the process includes:
s101: and receiving a first message carrying first target data, which is sent by other electronic equipment, wherein the first message is sent after the other electronic equipment determines that the first target data to be synchronized exists in a self-configured component.
The data transmission method provided by the embodiment of the application is applied to the electronic equipment, particularly a processor which can be applied to the electronic equipment, wherein the electronic equipment can be a server, a PC (personal computer) and the like, and components are configured in the electronic equipment.
In practice, a number of components are included in the banking system, such as pricing model components, funding back office components, etc. Wherein each component is configured on an electronic device, respectively, and each component may generate data during operation, and may need to distribute the generated data to other modules of other components. For example, the bond information receiving and modifying is implemented in a pricing model component, the pricing model component stores the processed bond basic information and time plan in a database of the pricing model component, and a fund back-office component is a user of the bond basic information and time plan, and the bond basic information and time plan are needed for operation or flow processing of a plurality of modules in the fund back-office component.
In order to reduce the number of data transmissions between electronic devices and improve the transmission efficiency, in the embodiment of the present application, the same data is transmitted only once between two electronic devices. Specifically, if the first target data to be synchronized exists in the component configured by the other electronic device, the other electronic device sends a first message carrying the first target data to the electronic device.
S102: and determining a first object to which the first target data belongs according to the data carried in the first target data.
In the embodiment of the application, after the electronic equipment receives the first target data, the electronic equipment determines a first object to which the first target data belongs according to the data carried in the first target data. In the embodiment of the application, the electronic device determines the first object to which the first target data belongs, which is equivalent to the data of which product the electronic device determines the first target data specifically is. For example, the first target data may be basic information, and the first object to which the first target data belongs may be a certain bond or the like.
Specifically, in the embodiment of the present application, the structure of data includes at least two parts, where a first part is a preset field length from a first field of the data, where a data type corresponding to the data is written in the first part, a second part is another field of the data except for a field corresponding to the first part, and specific content of the data is written in the second part. In the embodiment of the application, after receiving first target data sent by other electronic devices, the electronic device determines the data type of the first target data according to the data structure, determines the field of the object to which the written data corresponding to the data type belongs according to the corresponding relation between the pre-stored data type and the written content of each field in the data of each data type, and determines the written content in the field as the first object to which the first target data belongs.
Fig. 2 is a schematic structural diagram of data provided in an embodiment of the present application, where, as shown in fig. 2, the structure of the data includes at least two parts, where a first part is "msgType" used to represent a data type, and a second part is "msgListData" used to represent specific content in the data.
The first object to which the first target data belongs may be a bond, and the first target data further carries a version number corresponding to the first target data, where the version number may be used to indicate whether the first target data is modified, updated, or newly generated based on original data.
In the embodiment of the application, after the electronic device receives the first target data and determines the data type and the first object to which the first target data belongs, the electronic device obtains the version number carried in the first target data and correspondingly stores the first target data, the version number, the data type and the first object. In addition, in order to reduce the storage pressure, the electronic device may delete the data of the data type corresponding to the first object stored previously.
S103: broadcasting the first target data and the first object such that each module in the target component that has subscribed to the message of the first object receives the first target data.
In the embodiment of the application, the electronic equipment broadcasts the first target data and the first object in the target component, so that each module of the target component of the electronic equipment, which is subscribed to the message of the first object, can receive the first target data.
Specifically, in order to enable each module to determine that the first target data is the latest data, the electronic device may also broadcast a version number of the first target data when broadcasting the first target data, and broadcast a version number of the data type corresponding to the first object that is received latest before receiving the first target data.
In addition, in the embodiment of the present application, when another module local to the target component has a need to use the data of the first object, the other module sends a request for acquiring the data of the first object. And after the electronic equipment receives the request for acquiring the data of the first object, which is sent by other local modules, and determines that the first target data belongs to the first object, the electronic equipment sends the first target data to the other modules.
In the embodiment of the application, when the first target data is synchronized, the electronic equipment receives the first message carrying the first target data from other electronic equipment, and then broadcasts the first target data to each module subscribed to the message of the first object to which the first target data belongs, thereby avoiding multiple data transmission and saving network traffic.
Example 2:
in order to avoid multiple data transmissions and save network traffic, in the above embodiment of the present application, the broadcasting the first target data and the first object includes:
determining a first interface corresponding to each first candidate module to be received with the first target data and the first object;
and scheduling a first interface corresponding to each first candidate module, and sending the first target data and the first object to the first candidate module through the first interface.
In the embodiment of the application, when the electronic device broadcasts the first target data to each module of the message subscribed to the first object in the target component, the electronic device can determine each first candidate module to receive the first target data and determine the first interface corresponding to each first candidate module so as to send the first target data and the first object to each first candidate module through each first interface.
Specifically, for each first candidate module, the electronic device schedules a first interface corresponding to the first candidate module, and sends the first target data and the first object to the first candidate module through the first interface. The first interfaces are interfaces which are preconfigured for each first candidate module and used for inter-module internal communication.
In order for each module in the target component that has subscribed to the message of the first object to receive the first target data, in the embodiments of the present application, the determining each first candidate module to receive the first target data and the first object includes:
determining each module of the local configuration as the first candidate module; or alternatively, the first and second heat exchangers may be,
acquiring a target identifier of each module of the pre-stored message subscribed to the first object in the target component; and determining each module corresponding to each target identifier as each first candidate module.
In the embodiment of the application, when the electronic device determines each first candidate module of the first object and the first target data to be received, each module configured locally can be determined as the first candidate module, and the electronic device can acquire the target identifier of each module of the message subscribed to the first object in the pre-stored target component and determine each module of each target identifier as each first candidate module.
In the embodiment of the present application, if the electronic device determines each module configured locally as each first candidate module, each first candidate module will receive the first target data and the first object, if the first candidate module has subscribed to the message of the first object, the first candidate module obtains the sub-data required by the first target data, and if the first candidate module has not subscribed to the message of the first object, the first candidate module deletes the received first target data and first object.
Example 3:
in order to meet the requirement of data transmission, in the above embodiments, after receiving the first message carrying the first target data sent by the other electronic device, the method further includes:
acquiring first target data in a json data format carried in the first message and a first data type corresponding to the first target data;
determining a first mapping relation corresponding to the first data type according to the corresponding relation between the pre-stored data type and the mapping relation, wherein the first mapping relation stores the corresponding relation between each sub data in the first target data and json data field;
according to the first mapping relation, analyzing the first target data in the json data format, and converting the first target data in the json data format into a preset data format;
broadcasting the first target data and the first object includes:
and broadcasting the first target data converted into the preset data format and the first object.
In the embodiment of the application, when data transmission is performed between electronic devices, the data is generally transmitted in json data format, and in order to meet the requirement of data transmission, in the embodiment of the application, the data format of the first target data received by the electronic device is json data format. However, the json data format data cannot be read by the module in the electronic device, and based on this, after the electronic device receives the first target data, the electronic device will convert the data format of the first target data into the preset data format. The preset data format is a data format that can be read by a module in the electronic device, such as a binary format.
Specifically, in the embodiment of the present application, the structure of data includes at least two parts, and each part includes the content described in the above embodiment. After receiving a first message carrying first target data, the electronic device determines a first data type of the first target data according to a data structure. Wherein the data types include, but are not limited to, bond basic information and bond time plans.
The electronic equipment also stores the corresponding relation between the data types and the mapping relations, and each mapping relation stores the corresponding relation between each sub data in the data of the corresponding data type and the json data field. The electronic device may determine a mapping relationship corresponding to each data type according to the corresponding relationship between the stored data types and the mapping relationship, and perform data format conversion on the data according to the mapping relationship. Specifically, the electronic device determines a first data type corresponding to the first target data, and determines a first mapping relationship corresponding to the first data type according to the first data type and the corresponding relationship between the stored data type and the mapping relationship. And the electronic equipment converts the first target data in the json data format into a preset data format according to the corresponding relation between each sub data in the data of the first data type and the json data field, which is stored in the first mapping relation.
The electronic device broadcasts, to each module, first target data converted into a preset data format and a first object to which the first target data belongs.
Fig. 3 is a schematic diagram of a first mapping relationship corresponding to the case where the first target data provided in the embodiment of the present application is Bond basic information, and as shown in fig. 3, the field "multi_tenncy_id" indicates a MULTI-entity identifier, "prim_rcrd_id" indicates a main record number, "bond_fullnm" indicates a Bond full name, "bond_shrtnm" indicates Bond short for Bond abbreviation, "bond_ecd" indicates Bond code, "bond_cd" indicates Bond code, "CcyCd" indicates a currency code, "lssu_psn_nm" indicates a issuer name, "lssu_dt" indicates an issue time, "ValDt" indicates a start time, and "ExDat" indicates an expiration time. The fields are all subfields contained in the first target data, wherein the main record number is used for representing a version number corresponding to the first target data, and the multi-entity identifier is used for representing a component for generating the first target data.
Fig. 4 is a schematic diagram of a first mapping relationship corresponding to a case where the first target data provided in the embodiment of the present application is a Bond time plan, and as shown in fig. 4, the field "multi_tenncy_id" represents a MULTI-entity identifier, "prim_rcrd_id" represents a master record number, "ulyrcrd_id" represents an upper record number, "bond_fullnm" represents a Bond full name, "bond_ecd" represents Bond code, "bond_cd" represents Bond code, "clc_rule" represents a calculation Rule, "all_seq_no" represents a full serial number, "intar_stdt" represents a count start date, "intar_eddt" represents a count end time, "int_py_dt" represents a interest payment date, "intrst_dt" represents a interest rate reset date, "intdet_dt" represents a interest rate determination date, "Pln _cf_ Amt" represents a plan stream amount, "bond_ Amt" represents a Bond amount of interest. The above fields are all subfields in the first target data, wherein the main record number is used for representing a version number corresponding to the first target data, the multi-entity identifier is used for representing a component for generating the first target data, and the upper record number is used for representing bond basic information corresponding to the bond time plan.
Example 4:
in order to implement interaction of data between components, on the basis of the above embodiments, the method further includes:
if the second target data to be synchronized exist in the target component, the electronic equipment determines a second object to which the second target data belongs according to the data carried in the second target data, and acquires the pre-stored information of other electronic equipment where each other component subscribed to the information of the second object is located;
and sending a second message carrying the second target data to each other electronic device, so that each module of the message subscribed to the second object in the configured component in each other electronic device acquires the second target data.
In the embodiment of the application, the information of other electronic equipment where each other component of the message subscribed to each object is located is stored in the electronic equipment in advance. After the electronic equipment identifies that second target data to be synchronized exist in the target components, the electronic equipment determines a second object to which the second target data belongs, acquires information of other electronic equipment where each other component of the stored information subscribed to the second object is located, and takes the other electronic equipment where each other component of the information subscribed to the second object is located as a receiver of the second target data.
Specifically, the electronic device sends a second message carrying second target data to each other electronic device, so that each other electronic device obtains the second target data, and each other electronic device forwards the second target data to each module of the message of the first object to which the second target data belongs, so that each module obtains the second target data.
When the electronic device sends the second message to each other electronic device, the electronic device sends the second message carrying the second target data to the other electronic devices according to the ip address corresponding to the other electronic devices, which is stored in advance, aiming at the other electronic devices where each other component of each message subscribed to the second object is located.
After receiving the second message, the other electronic devices determine a second object to which the second target data belongs according to the data carried in the second target data in the second message, and broadcast the second target data to each module of the message subscribed to the second object in the other electronic devices, so that each module acquires the second target data. The process of determining the second object to which the second target data belongs by the other electronic devices is consistent with the process of determining the first object to which the first target data belongs by the electronic devices, and will not be described herein.
In addition, in the embodiment of the application, only the information of other electronic equipment where each other component of the message subscribed to the second object is stored in the electronic equipment, namely, only the information of other electronic equipment is stored in the electronic equipment, and the specific information of each component in each other electronic equipment is not stored, so that the storage pressure of the electronic equipment is reduced.
Example 5:
in order to adapt to the requirement of data transmission, on the basis of the foregoing embodiments, in an embodiment of the present application, the sending, to each other electronic device, a second message carrying the second target data includes:
acquiring a second data type carried in the second target data, and determining a second mapping relation corresponding to the second data type according to a corresponding relation between a pre-stored data type and the mapping relation;
according to the second mapping relation, converting the second target data into json data format; wherein, the second mapping relation stores the corresponding relation between each sub data in the second target data and json data field;
and sending a second message carrying the second data type and second target data converted into json data format to each other electronic device.
When data transmission is performed between electronic devices, the data is generally transmitted in json data format, and in order to meet the requirement of data transmission, in the embodiment of the application, when the electronic device sends second target data to other electronic devices, the second target data can be converted into json data format and sent. Based on this, the electronic device converts the data format of the second target data into json data format before sending a second message carrying the second target data to each other electronic device.
Specifically, in the embodiment of the present application, the structure of data includes at least two parts, and each part includes the content described in the above embodiment. And the electronic equipment reads the second data type corresponding to the second target data written in the second target data according to the data structure.
The electronic equipment also stores the corresponding relation between the data types and the mapping relation, and the mapping relation stores the corresponding relation between each sub data in the data of each data type and the json data field. The electronic device may determine a mapping relationship corresponding to each data type according to the saved correspondence between the data type and the mapping relationship, and perform data format conversion on the data according to the mapping relationship. Specifically, the electronic device determines a second data type corresponding to the second target data, and determines a second mapping relationship corresponding to the second data type according to the second data type and the corresponding relationship between the stored data type and the mapping relationship. And the electronic equipment converts the second target data into a json data format according to the corresponding relation between each sub data in the data of the second data type and the json data field, which are stored in the second mapping relation.
The electronic device sends a second message carrying the second data type and second target data converted into json data format to each other electronic device.
Example 6:
in order for each module that has subscribed to the message of the second object to receive the second target data, on the basis of the above embodiments, in an embodiment of the present application, the method further includes:
determining a second interface corresponding to each second candidate module to be received in the electronic equipment, wherein the second interface corresponds to each second candidate module;
and scheduling a second interface corresponding to each second candidate module, and sending the second target data and the second object to the second candidate module through the second interface.
The electronic device may also have a module locally subscribing to the message of the second object, based on which the electronic device determines each second candidate module of the second object and each second interface corresponding to each second candidate module in itself to receive the second target data; and scheduling a second interface corresponding to each second candidate module, and sending the second target data and the second object to the second candidate module through the second interface.
When determining each second candidate module of the second object and the second target data to be received, the electronic device may determine each module configured locally as the second candidate module, and may further obtain a target identifier of each module of the pre-stored target component, which has subscribed to the message of the second object, and determine each module corresponding to each target identifier as the second candidate module.
If the electronic device determines each locally configured module as a second candidate module, each second candidate module receives the second target data and the second object, if the second candidate module has subscribed to the second object, the second candidate module obtains the sub-data required by the second target data, and if the second candidate module has not subscribed to the second object, the second candidate module deletes the received second target data and second object.
The data transmission method of the present application will be described below with a specific example:
the fund transaction background component is configured on the first electronic device, the pricing model component is configured on the second electronic device, the pricing model component generates data corresponding to each bond, wherein the data can be basic bond information, bond time plan and data type corresponding to the data. Wherein each bond is an object, and the bond basic information and bond time are data of different data types. If the fund transaction background component subscribes to the data corresponding to the bond A, when the pricing model component generates the data corresponding to the bond A, the second electronic device where the pricing model component is located converts the data corresponding to the bond A into json format data according to the data type carried in the data and the corresponding relation between the data type and the mapping relation stored in advance, and sends the data to the first electronic device where the fund transaction background component is located.
Example 7:
fig. 5 is a schematic structural diagram of a data transmission device according to an embodiment of the present application, where the device includes:
a receiving module 501, configured to receive a first message sent by another electronic device and carrying first target data, where the first message is sent after determining that, in a component configured by the other electronic device, there is first target data to be synchronized, the first message is sent;
the processing module 502 is configured to determine, according to data carried in the first target data, a first object to which the first target data belongs;
a broadcasting module 503, configured to broadcast the first target data and the first object, so that each module of the target component that has subscribed to the message of the first object receives the first target data.
In a possible implementation manner, the broadcasting module 503 is specifically configured to determine each first candidate module to receive the first target data and the first object and a first interface corresponding to each first candidate module; and scheduling a first interface corresponding to each first candidate module, and sending the first target data and the first object to the first candidate module through the first interface.
In a possible implementation manner, the processing module 502 is specifically configured to determine each module configured locally as the first candidate module; or, acquiring a target identifier of each module of the pre-stored message subscribed to the first object in the target component; and determining each module corresponding to each target identifier as each first candidate module.
In a possible implementation manner, the processing module 502 is further configured to obtain first target data in a json data format carried in the first message and a first data type corresponding to the first target data; determining a first mapping relation corresponding to the first data type according to the corresponding relation between the pre-stored data type and the mapping relation, wherein the first mapping relation stores the corresponding relation between each sub data in the first target data and json data field; according to the first mapping relation, analyzing the first target data in the json data format, and converting the first target data in the json data format into a preset data format;
the broadcasting module 503 is specifically configured to broadcast the first target data and the first object converted into the preset data format.
In a possible implementation manner, the processing module 502 is further configured to, if it is identified that there is second target data to be synchronized in the target component, determine, according to data carried in the second target data, a second object to which the second target data belongs, and obtain pre-stored information of other electronic devices where each other component subscribed to the message of the second object is located;
the broadcasting module 503 is further configured to send a second message carrying the second target data to each other electronic device, so that each module of the configured components in each other electronic device that has subscribed to the message of the second object obtains the second target data.
In a possible implementation manner, the processing module 502 is further configured to obtain a second data type carried in the second target data, and determine a second mapping relationship corresponding to the second data type according to a correspondence between a pre-stored data type and a mapping relationship; according to the second mapping relation, converting the second target data into json data format; wherein, the second mapping relation stores the corresponding relation between each sub data in the second target data and json data field;
The broadcasting module 503 is further configured to send a second message carrying the second data type and second target data converted into json data format to each of the other electronic devices.
In a possible implementation manner, the broadcasting module 503 is specifically configured to determine each second candidate module of the electronic device to receive the second target data and the second object and a second interface corresponding to each second candidate module; and scheduling a second interface corresponding to each second candidate module, and sending the second target data and the second object to the second candidate module through the second interface.
Example 8:
on the basis of the foregoing embodiments, the embodiment of the present application further provides an electronic device, and fig. 6 is a schematic structural diagram of the electronic device provided by the embodiment of the present application, as shown in fig. 6, including: processor 61, communication interface 62, memory 63 and communication bus 64, wherein processor 61, communication interface 62, memory 63 accomplish the mutual communication through communication bus 64;
the memory 63 has stored therein a computer program which, when executed by the processor 61, causes the processor 61 to perform the steps of:
Receiving a first message carrying first target data sent by other electronic equipment, wherein the first message is sent after the first message is used for determining that the first target data to be synchronized exists in a self-configured component of the other electronic equipment;
determining a first object to which the first target data belongs according to the data carried in the first target data;
broadcasting the first target data and the first object such that each module in the target component that has subscribed to the message of the first object receives the first target data.
In one possible implementation, the processor is further configured to:
determining a first interface corresponding to each first candidate module to be received with the first target data and the first object;
and scheduling a first interface corresponding to each first candidate module, and sending the first target data and the first object to the first candidate module through the first interface.
In one possible implementation, the processor is further configured to:
determining each module of the local configuration as the first candidate module; or alternatively, the first and second heat exchangers may be,
acquiring a target identifier of each module of the pre-stored message subscribed to the first object in the target component; and determining each module corresponding to each target identifier as each first candidate module.
In one possible implementation, the processor is further configured to:
acquiring first target data in a json data format carried in the first message and a first data type corresponding to the first target data;
determining a first mapping relation corresponding to the first data type according to the corresponding relation between the pre-stored data type and the mapping relation, wherein the first mapping relation stores the corresponding relation between each sub data in the first target data and json data field;
according to the first mapping relation, analyzing the first target data in the json data format, and converting the first target data in the json data format into a preset data format;
broadcasting the first target data and the first object includes:
and broadcasting the first target data converted into the preset data format and the first object.
In one possible implementation, the processor is further configured to:
if the second target data to be synchronized exist in the target component, the electronic equipment determines a second object to which the second target data belongs according to the data carried in the second target data, and acquires the pre-stored information of other electronic equipment where each other component subscribed to the information of the second object is located;
And sending a second message carrying the second target data to each other electronic device, so that each module of the message subscribed to the second object in the configured component in each other electronic device acquires the second target data.
In one possible implementation, the processor is further configured to:
acquiring a second data type carried in the second target data, and determining a second mapping relation corresponding to the second data type according to a corresponding relation between a pre-stored data type and the mapping relation;
according to the second mapping relation, converting the second target data into json data format; wherein, the second mapping relation stores the corresponding relation between each sub data in the second target data and json data field;
and sending a second message carrying the second data type and second target data converted into json data format to each other electronic device.
In one possible implementation, the processor is further configured to:
determining a second interface corresponding to each second candidate module to be received in the electronic equipment, wherein the second interface corresponds to each second candidate module;
And scheduling a second interface corresponding to each second candidate module, and sending the second target data and the second object to the second candidate module through the second interface.
Since the principle of the electronic device for solving the problem is similar to that of the data transmission method, the implementation of the electronic device can refer to the embodiment of the method, and the repetition is omitted.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus. The communication interface 62 is used for communication between the above-described electronic device and other devices. The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; but also digital instruction processors (Digital Signal Processing, DSP), application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
Example 9:
on the basis of the above embodiments, the embodiments of the present invention further provide a computer readable storage medium, in which a computer program executable by a processor is stored, which when executed on the processor causes the processor to implement the steps of:
receiving a first message carrying first target data sent by other electronic equipment, wherein the first message is sent after the first message is used for determining that the first target data to be synchronized exists in a self-configured component of the other electronic equipment;
determining a first object to which the first target data belongs according to the data carried in the first target data;
broadcasting the first target data and the first object such that each module in the target component that has subscribed to the message of the first object receives the first target data.
In one possible implementation, the broadcasting the first target data and the first object includes:
determining a first interface corresponding to each first candidate module to be received with the first target data and the first object;
and scheduling a first interface corresponding to each first candidate module, and sending the first target data and the first object to the first candidate module through the first interface.
In one possible implementation, the determining each first candidate module to receive the first target data and the first object includes:
determining each module of the local configuration as the first candidate module; or alternatively, the first and second heat exchangers may be,
acquiring a target identifier of each module of the pre-stored message subscribed to the first object in the target component; and determining each module corresponding to each target identifier as each first candidate module.
In one possible implementation manner, after the receiving the first message carrying the first target data sent by the other electronic device, the method further includes:
acquiring first target data in a json data format carried in the first message and a first data type corresponding to the first target data;
Determining a first mapping relation corresponding to the first data type according to the corresponding relation between the pre-stored data type and the mapping relation, wherein the first mapping relation stores the corresponding relation between each sub data in the first target data and json data field;
according to the first mapping relation, analyzing the first target data in the json data format, and converting the first target data in the json data format into a preset data format;
broadcasting the first target data and the first object includes:
and broadcasting the first target data converted into the preset data format and the first object.
In one possible embodiment, the method further comprises:
if the second target data to be synchronized exist in the target component, the electronic equipment determines a second object to which the second target data belongs according to the data carried in the second target data, and acquires the pre-stored information of other electronic equipment where each other component subscribed to the information of the second object is located;
and sending a second message carrying the second target data to each other electronic device, so that each module of the message subscribed to the second object in the configured component in each other electronic device acquires the second target data.
In a possible implementation manner, the sending, to each other electronic device, a second message carrying the second target data includes:
acquiring a second data type carried in the second target data, and determining a second mapping relation corresponding to the second data type according to a corresponding relation between a pre-stored data type and the mapping relation;
according to the second mapping relation, converting the second target data into json data format; wherein, the second mapping relation stores the corresponding relation between each sub data in the second target data and json data field;
and sending a second message carrying the second data type and second target data converted into json data format to each other electronic device.
In one possible embodiment, the method further comprises:
determining a second interface corresponding to each second candidate module to be received in the electronic equipment, wherein the second interface corresponds to each second candidate module;
and scheduling a second interface corresponding to each second candidate module, and sending the second target data and the second object to the second candidate module through the second interface.
Since the principle of the above-mentioned computer readable storage medium for solving the problem is similar to that of the file verification method, the implementation of the above-mentioned computer readable storage medium can refer to the embodiment of the method, and the repetition is not repeated.
Example 10:
the embodiment of the application also provides a computer program product, which when being executed by a computer, realizes the data transmission method of any method embodiment applied to electronic equipment.
Because, in the embodiment of the application, the electronic device receives the first message carrying the first target data sent by the other electronic devices, and broadcasts the first target data to each module of the message subscribed to the first object to which the first target data belongs in the target component configured by the electronic device, namely, only one data transmission is performed between the electronic device and each other electronic device, so that each module which is configured in the electronic device and needs the first target data can acquire the first target data, thereby reducing the data transmission quantity between the electronic devices and improving the data transmission efficiency.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (17)

1. A data transmission method applied to an electronic device configured with a target component, the method comprising:
receiving a first message carrying first target data sent by other electronic equipment, wherein the first message is sent after the first message is used for determining that the first target data to be synchronized exists in a self-configured component of the other electronic equipment;
determining a first object to which the first target data belongs according to the data carried in the first target data;
Broadcasting the first target data and the first object such that each module in the target component that has subscribed to the message of the first object receives the first target data.
2. The method of claim 1, wherein the broadcasting the first target data and the first object comprises:
determining a first interface corresponding to each first candidate module to be received with the first target data and the first object;
and scheduling a first interface corresponding to each first candidate module, and sending the first target data and the first object to the first candidate module through the first interface.
3. The method of claim 2, wherein the determining each first candidate block to receive the first target data and the first object comprises:
determining each module of the local configuration as the first candidate module; or alternatively, the first and second heat exchangers may be,
acquiring a target identifier of each module of the pre-stored message subscribed to the first object in the target component; and determining each module corresponding to each target identifier as each first candidate module.
4. The method of claim 1, wherein after receiving the first message carrying the first target data sent by the other electronic device, the method further comprises:
acquiring first target data in a json data format carried in the first message and a first data type corresponding to the first target data;
determining a first mapping relation corresponding to the first data type according to the corresponding relation between the pre-stored data type and the mapping relation, wherein the first mapping relation stores the corresponding relation between each sub data in the first target data and json data field;
according to the first mapping relation, analyzing the first target data in the json data format, and converting the first target data in the json data format into a preset data format;
broadcasting the first target data and the first object includes:
and broadcasting the first target data converted into the preset data format and the first object.
5. The method according to claim 1, wherein the method further comprises:
if the second target data to be synchronized exist in the target component, the electronic equipment determines a second object to which the second target data belongs according to the data carried in the second target data, and acquires the pre-stored information of other electronic equipment where each other component subscribed to the information of the second object is located;
And sending a second message carrying the second target data to each other electronic device, so that each module of the message subscribed to the second object in the configured component in each other electronic device acquires the second target data.
6. The method of claim 5, wherein the sending a second message carrying the second target data to each of the other electronic devices comprises:
acquiring a second data type carried in the second target data, and determining a second mapping relation corresponding to the second data type according to a corresponding relation between a pre-stored data type and the mapping relation;
according to the second mapping relation, converting the second target data into json data format; wherein, the second mapping relation stores the corresponding relation between each sub data in the second target data and json data field;
and sending a second message carrying the second data type and second target data converted into json data format to each other electronic device.
7. The method of claim 5, wherein the method further comprises:
Determining a second interface corresponding to each second candidate module to be received in the electronic equipment, wherein the second interface corresponds to each second candidate module;
and scheduling a second interface corresponding to each second candidate module, and sending the second target data and the second object to the second candidate module through the second interface.
8. A data transmission apparatus applied to an electronic device configured with a target component, the apparatus comprising:
the receiving module is used for receiving a first message carrying first target data sent by other electronic equipment, wherein the first message is sent after the other electronic equipment determines that the first target data to be synchronized exists in a self-configured component;
the processing module is used for determining a first object to which the first target data belongs according to the data carried in the first target data;
and the broadcasting module is used for broadcasting the first target data and the first object, so that each module of the target assembly, which is subscribed to the message of the first object, receives the first target data.
9. The apparatus of claim 8, wherein the broadcast module is specifically configured to determine each first candidate module to receive the first target data and the first object and a first interface corresponding to each first candidate module; and scheduling a first interface corresponding to each first candidate module, and sending the first target data and the first object to the first candidate module through the first interface.
10. The apparatus according to claim 8, wherein the processing module is specifically configured to determine each module configured locally as the each first candidate module; or, acquiring a target identifier of each module of the pre-stored message subscribed to the first object in the target component; and determining each module corresponding to each target identifier as each first candidate module.
11. The apparatus of claim 8, wherein the processing module is further configured to obtain first target data in a json data format carried in the first message and a first data type corresponding to the first target data; determining a first mapping relation corresponding to the first data type according to the corresponding relation between the pre-stored data type and the mapping relation, wherein the first mapping relation stores the corresponding relation between each sub data in the first target data and json data field; according to the first mapping relation, analyzing the first target data in the json data format, and converting the first target data in the json data format into a preset data format;
the broadcasting module is specifically configured to broadcast the first target data converted into the preset data format and the first object.
12. The apparatus of claim 8, wherein the processing module is further configured to, if it is identified that there is second target data to be synchronized in the target component, determine, according to data carried in the second target data, a second object to which the second target data belongs, and obtain pre-stored information of other electronic devices where each other component that has subscribed to the message of the second object is located;
the broadcasting module is further configured to send a second message carrying the second target data to each other electronic device, so that each module of the configured components in each other electronic device, which has subscribed to the message of the second object, obtains the second target data.
13. The apparatus of claim 12, wherein the processing module is further configured to obtain a second data type carried in the second target data, and determine a second mapping relationship corresponding to the second data type according to a correspondence between a pre-stored data type and a mapping relationship; according to the second mapping relation, converting the second target data into json data format; wherein, the second mapping relation stores the corresponding relation between each sub data in the second target data and json data field;
And the broadcasting module is further used for sending a second message carrying the second data type and second target data converted into json data format to each other electronic device.
14. The apparatus of claim 12, wherein the broadcasting module is specifically configured to determine each second candidate module in the electronic device that is to receive the second target data and the second object and a second interface corresponding to each second candidate module; and scheduling a second interface corresponding to each second candidate module, and sending the second target data and the second object to the second candidate module through the second interface.
15. An electronic device, characterized in that it comprises a processor for implementing the steps of the data transmission method according to any of claims 1-7 when executing a computer program stored in a memory.
16. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the steps of the data transmission method according to any one of claims 1-7.
17. A computer program product, the computer program product comprising: computer program code for causing a computer to perform the steps of the data transmission method as claimed in any one of the preceding claims 1 to 7 when said computer program code is run on a computer.
CN202310761897.9A 2023-06-26 2023-06-26 Data transmission method, device, equipment and medium Pending CN116827704A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310761897.9A CN116827704A (en) 2023-06-26 2023-06-26 Data transmission method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310761897.9A CN116827704A (en) 2023-06-26 2023-06-26 Data transmission method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN116827704A true CN116827704A (en) 2023-09-29

Family

ID=88142427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310761897.9A Pending CN116827704A (en) 2023-06-26 2023-06-26 Data transmission method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN116827704A (en)

Similar Documents

Publication Publication Date Title
CN108537528B (en) Batch file auditing and payment-for-delivery method and system
CN113554513B (en) Data processing method, device and system
CN110060139B (en) Accounting processing method and device
CN110910230A (en) Accounting method, accounting system and storage medium
CN110278264B (en) Block chain-based cross-link communication method and device and transaction system
CN111651494B (en) Data processing method, device, equipment and computer readable storage medium
CN101196831A (en) Method, system and device for distributed multi-service logic asynchronous processing
CN111506932A (en) Block chain calculation uplink implementation method
CN108242021B (en) Accounting data processing system, method and device
CN111260421A (en) Block chain-based electronic invoice management and control method and device
CN110874728A (en) Online payment system, online payment method, device, medium and server
CN108009916B (en) Transaction dynamic adjustment-based universal payment accounting method and system
CN113034178A (en) Multi-system integral calculation method and device, terminal equipment and storage medium
CN110336872B (en) Method, device and system for acquiring third-party data
CN116827704A (en) Data transmission method, device, equipment and medium
CN115983991A (en) Flow adjusting method, device, equipment and medium
CN105787791B (en) Service request processing method and device
CN114581088A (en) Aggregated payment method, device and system for SaaS (software as a service) system
CN115408173A (en) Event processing method and device, electronic equipment and storage medium
CN115034674A (en) Charging management method, system and electronic equipment
CN111796854B (en) Module hot upgrading method and device, electronic equipment and readable storage medium
CN114186267A (en) Virtual asset data processing method and device and computer readable storage medium
CN111709728A (en) Virtual resource splitting deduction replacing method and device, computer equipment and storage medium
CN111639936A (en) Transaction information acquisition method and device, electronic equipment and readable storage medium
CN108614737B (en) Resource recovery method and device and server

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