CN111162879A - Data transmission method and device, electronic equipment and storage medium - Google Patents
Data transmission method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111162879A CN111162879A CN201911340623.2A CN201911340623A CN111162879A CN 111162879 A CN111162879 A CN 111162879A CN 201911340623 A CN201911340623 A CN 201911340623A CN 111162879 A CN111162879 A CN 111162879A
- Authority
- CN
- China
- Prior art keywords
- data
- acquisition request
- data acquisition
- control layer
- feedback
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/1607—Details of the supervisory signal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2212/00—Encapsulation of packets
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application provides a data transmission method, a data transmission device, electronic equipment and a storage medium, wherein a control layer sends a data acquisition request set to an intermediate layer, the intermediate layer inquires target data from a database of an application program according to the data acquisition request set after receiving the data acquisition request set sent by a control layer of the application program, encapsulates all the target data into a feedback data set, and sends the feedback data set to the control layer through a control layer interface. And after the control layer receives the feedback data set sent by the middle layer, the control layer renders the user interface of the front end by using the feedback data in the feedback data set. Therefore, in the data transmission method provided by the application, the data acquisition request and the feedback data can be transmitted in a set manner, so that the transmission times are reduced, and the transmission efficiency is improved. Meanwhile, the control layer is directly arranged at the front end, so that the process that the control end sends feedback data to the front end can be reduced, and the rendering efficiency is improved.
Description
Technical Field
The present application relates to the field of data processing, and in particular, to a data transmission method and apparatus, an electronic device, and a storage medium.
Background
When a user uses an application program, the application program needs to display a corresponding user interface according to actual operation of the user, specifically, a display process of the user interface is actually a data rendering process, and the data rendering process can be summarized as a transmission process of data for rendering the user interface. Fig. 1 shows a control structure diagram commonly used in a data transmission process, and as shown in fig. 1, a front end of an application generates a corresponding data acquisition request according to a display requirement generated by a user to acquire data for rendering a corresponding user interface. The data acquisition request is then sent by the front end to a WF (workflow framework) layer, which forwards the data acquisition request to an SCF (simple configuration)Simply configured door) layer, the SCF layer queries and extracts corresponding feedback data from a database located at the back end of the application program according to the data acquisition request. And then, the SCF layer sends the feedback data to the WF layer, the WF layer sends the feedback data to the front end again, and the front end renders a corresponding user interface according to the feedback data by using a rendering tool and the like so as to display the user.
Therefore, the process of acquiring rendering data by the front end needs to depend on the WF layer and the SCF layer, and the process of acquiring data needs to be closely related to the front end and the back end, resulting in the coupling of the front end and the back end. Meanwhile, due to the nature of the WF layer, whether receiving a data acquisition request, forwarding a data acquisition request, or receiving feedback data, only data corresponding to a single request can be received, but data of multiple requests cannot be processed simultaneously, which seriously affects the efficiency of data transmission.
Disclosure of Invention
The application provides a data transmission method, a data transmission device, electronic equipment and a storage medium, so as to improve data transmission efficiency.
In a first aspect, the present application provides a data transmission method, applied to a control layer of an application program, where the method includes:
the control layer sends a data acquisition request set to an intermediate layer, the control layer is positioned at the front end of the application program and has the capacity of simultaneously sending a plurality of requests and simultaneously receiving a plurality of feedbacks, the intermediate layer is positioned between the control layer and a database and is used for forwarding the requests and data, and the data acquisition request set comprises a plurality of data acquisition requests;
receiving a feedback data set sent by the middle layer, wherein the feedback data set comprises a plurality of feedback data, and the feedback data corresponds to the data acquisition request;
rendering a user interface of the front end using the feedback data in the set of feedback data.
In a possible implementation manner of the first aspect of the embodiment of the present invention, the sending, by the control layer, the data acquisition request set to the intermediate layer includes:
acquiring a data acquisition request initiated by a user through the front end;
marking a unique identifier for each data acquisition request;
packaging all the data acquisition requests and the corresponding unique identifiers into a data acquisition request set;
and sending the data acquisition request set to a middle layer.
In a possible implementation manner of the first aspect of the embodiment of the present invention, the rendering the user interface of the front end by using the feedback data in the feedback data set includes:
analyzing the feedback data set to obtain each feedback data and a unique identifier of a data acquisition request corresponding to the feedback data;
and according to each unique identifier, rendering the user interface of the front end by using the corresponding feedback data so as to process the corresponding data acquisition request.
In a second aspect, the present application provides a data transmission method, applied to an intermediate layer of an application program, the method including:
receiving a data acquisition request set sent by a control layer of the application program, wherein the control layer is positioned at the front end of the application program and has the capability of simultaneously sending a plurality of requests and simultaneously receiving a plurality of feedbacks, the middle layer is positioned between the control layer and a database and is used for forwarding the request and the data, and the data acquisition request set comprises a plurality of data acquisition requests;
inquiring target data from a database of the application program according to the data acquisition request set, wherein the target data is data corresponding to each data acquisition request in the data acquisition request set;
packaging all the target data into a feedback data set;
and sending the feedback data set to the control layer through a control layer interface so that the control layer renders the user interface of the front end by using the feedback data in the feedback data set, wherein the control layer interface is a data transmission interface exposed to the middle layer at the front end of the control layer.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the querying, according to the data acquisition request set, target data from the database of the application program includes:
analyzing the data acquisition request set to obtain each data acquisition request;
and inquiring corresponding target data from the database according to each data acquisition request.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the encapsulating all the target data into one feedback data set includes:
acquiring a unique identifier corresponding to each data acquisition request from the data acquisition request set;
establishing a corresponding relation between the target data and the unique identification of the corresponding data acquisition request;
and packaging all the target data, all the unique identifiers and all the corresponding relations into a feedback data set so that the control layer can determine the target data corresponding to each data acquisition request by using the unique identifiers and the corresponding relations.
In a third aspect, the present application provides a data transmission apparatus, applied to a control layer of an application program, the apparatus including:
a data acquisition request sending module, configured to send a data acquisition request set to an intermediate layer, where the control layer is located at a front end of the application program and has a capability of sending multiple requests and receiving multiple feedbacks at the same time, the intermediate layer is located between the control layer and a database and is used for forwarding a request and data, and the data acquisition request set includes multiple data acquisition requests;
a feedback data receiving module, configured to receive a feedback data set sent by the intermediate layer, where the feedback data set includes multiple feedback data, and the feedback data corresponds to the data acquisition request;
a rendering module to render the user interface of the front end using the feedback data in the set of feedback data.
In a possible implementation manner of the third aspect of the embodiment of the present invention, the data obtaining request sending module includes:
the request acquisition module is used for acquiring a data acquisition request initiated by a user through the front end;
the marking module is used for marking a unique identifier for each data acquisition request;
the packaging module is used for packaging all the data acquisition requests and the corresponding unique identifiers into a data acquisition request set;
and the sending module is used for sending the data acquisition request set to the middle layer.
In a possible implementation manner of the third aspect of the embodiment of the present invention, the rendering module includes:
the first analysis module is used for analyzing the feedback data set to obtain each feedback data and a unique identifier of a data acquisition request corresponding to the feedback data;
and the corresponding rendering module is used for rendering the user interface of the front end by using the corresponding feedback data according to each unique identifier so as to process the corresponding data acquisition request.
In a fourth aspect, the present application provides a data transmission method, which is applied to an intermediate layer of an application program, where the apparatus includes:
a data acquisition request receiving module, configured to receive a data acquisition request set sent by a control layer of the application program, where the control layer is located at a front end of the application program and has a capability of sending multiple requests and receiving multiple feedbacks at the same time, the intermediate layer is a layer located between the control layer and a database and used for forwarding requests and data, and the data acquisition request set includes multiple data acquisition requests;
the query module is used for querying target data from the database of the application program according to the data acquisition request set, wherein the target data is data corresponding to each data acquisition request in the data acquisition request set;
the feedback data packaging module is used for packaging all the target data into a feedback data set;
and the feedback data sending module is used for sending the feedback data set to the control layer through a control layer interface so that the control layer renders the user interface of the front end by using the feedback data in the feedback data set, and the control layer interface is a data transmission interface exposed to the middle layer by the control layer at the front end.
In a possible implementation manner of the fourth aspect of the embodiment of the present invention, the query module includes:
the second analysis module is used for analyzing the data acquisition request set to obtain each data acquisition request;
and the target query module is used for querying corresponding target data from the database according to each data acquisition request.
In a possible implementation manner of the fourth aspect of the embodiment of the present invention, the feedback data encapsulation module includes:
the unique identifier acquisition module is used for acquiring a unique identifier corresponding to each data acquisition request from the data acquisition request set;
the corresponding relation establishing module is used for establishing the corresponding relation between the target data and the unique identification of the corresponding data acquisition request;
and the data encapsulation module is used for encapsulating all the target data, all the unique identifiers and all the corresponding relations into a feedback data set so that the control layer can determine the target data corresponding to each data acquisition request by using the unique identifiers and the corresponding relations.
In a fifth aspect, an embodiment of the present invention provides an electronic device, applied to a control layer of an application program, including:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data transmission method via execution of the executable instructions.
In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, which is applied to a control layer of an application program, and a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the data transmission method.
In a seventh aspect, an embodiment of the present invention provides an electronic device, which is applied to an intermediate layer of an application program, and includes:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data transmission method via execution of the executable instructions.
In an eighth aspect, an embodiment of the present invention provides a computer-readable storage medium, which is applied to an intermediate layer of an application program, and on which a computer program is stored, where the computer program, when executed by a processor, implements the data transmission method.
According to the technical scheme, the data transmission method, the data transmission device, the electronic equipment and the storage medium are provided. And after the control layer receives the feedback data set sent by the middle layer, the control layer renders the user interface of the front end by using the feedback data in the feedback data set. Therefore, in the data transmission method provided by the application, the data acquisition request and the feedback data can be transmitted in a set manner, so that the transmission times are reduced, and the transmission efficiency is improved. Meanwhile, the control layer is directly arranged at the front end, so that the process that the control end sends feedback data to the front end can be reduced, and the rendering efficiency is improved.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a schematic diagram of a control structure commonly used in data transmission processes provided herein;
fig. 2 is a schematic diagram of a data transmission method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 4 is a schematic diagram of a data acquisition request sending method according to an embodiment of the present application;
FIG. 5 is a diagram illustrating a method for querying target data according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a method for encapsulating a feedback data set according to an embodiment of the present application;
fig. 7 is a schematic diagram of a method for parsing a feedback data set according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a first data transmission apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a second data transmission apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a third data transmission apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a fourth data transmission apparatus according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a fifth data transmission apparatus according to an embodiment of the present invention;
fig. 13 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention;
fig. 14 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 2 is a schematic diagram of a data transmission method provided in an embodiment of the present application, and as shown in fig. 2, the method includes:
s1, sending a data acquisition request set to a middle layer, wherein the control layer is located at the front end of the application program and has the capability of simultaneously sending a plurality of requests and simultaneously receiving a plurality of feedbacks, the middle layer is located between the control layer and a database and is used for forwarding requests and data, and the data acquisition request set comprises a plurality of data acquisition requests.
Fig. 3 is a schematic structural diagram of a data transmission device according to an embodiment of the present disclosure, and it can be seen that a control layer is located at a front end, so that the control layer can directly receive data acquisition requests generated by a user according to operations such as clicking, text input, and the like of the user on an application program.
Further, in the embodiment of the present application, the control layer may be node.js, that is, a JavaScript operating environment based on Chrome V8 engine to receive and transmit the data acquisition request. The control layer has the capability of simultaneously sending a plurality of requests, so that after receiving data acquisition requests generated by a user, the control layer can simultaneously send the requests to the middle layer in an aggregate form, thereby saving the time wasted by sending the data acquisition requests one by one.
Specifically, as shown in fig. 4, a schematic diagram of a data acquisition request sending method provided in an embodiment of the present application is shown, where the method includes:
s101, acquiring a data acquisition request initiated by a user through the front end;
s102, marking a unique identifier for each data acquisition request;
s103, packaging all the data acquisition requests and the corresponding unique identifiers into a data acquisition request set;
and S104, sending the data acquisition request set to the middle layer.
The method comprises the steps that a user initiates a data acquisition request through a front end, wherein the front end can be any user interface of an application program. Because a plurality of data acquisition requests can be transmitted simultaneously in the data transmission method provided by the embodiment of the application, in order to distinguish the data acquisition requests to ensure the accuracy and effectiveness of data transmission, a unique mark can be marked for each data acquisition request, wherein the unique marks can be marks with uniqueness and representativeness such as numbers, characters and the like. Therefore, the data acquisition requests and the corresponding unique identifiers are packaged together, and each data acquisition request can be accurately identified while a data acquisition request set is formed.
S2, receiving a data acquisition request set sent by a control layer of the application program, where the control layer is located at a front end of the application program and has a capability of sending multiple requests and receiving multiple feedbacks at the same time, the middle layer is located between the control layer and a database and is used for forwarding requests and data, and the data acquisition request set includes multiple data acquisition requests.
In the embodiment of the application, the SCF can be used as an intermediate layer, supports cross-platform, can process high-concurrency data requests, has high reliability, and can provide an asynchronous, multi-protocol and event-driven service framework. Through the steps, the control layer can send the data acquisition request set to the middle layer in one sending process by calling the interface of the middle layer, and correspondingly, the middle layer needs to make a receiving action on the data acquisition request set so as to be used for subsequently inquiring data from the database.
And S3, inquiring target data from the database of the application program according to the data acquisition request set, wherein the target data is data corresponding to each data acquisition request in the data acquisition request set.
After receiving the data acquisition request set, the intermediate layer needs to query corresponding target data in the database according to each data acquisition request in the data acquisition request set.
Further, as shown in fig. 5, a schematic diagram of a method for querying target data provided in an embodiment of the present application is shown, where the method includes:
s301, analyzing the data acquisition request set to obtain each data acquisition request;
s302, inquiring corresponding target data from the database according to each data acquisition request.
By analyzing the data acquisition request set, the data acquisition request set can be split to obtain each data acquisition request, so that each data acquisition request can be obtained, and the intermediate layer can inquire corresponding target data from the database according to each data acquisition request.
As can be seen from the above, the unique identifier corresponding to each data acquisition request is obtained after the data acquisition request set is analyzed, and therefore, when the intermediate layer queries the target data from the database, each target data actually corresponds to one unique identifier.
And S4, packaging all the target data into a feedback data set.
Specifically, as shown in fig. 6, a schematic diagram of a method for encapsulating a feedback data set provided in an embodiment of the present application is shown, where the method includes:
s401, acquiring a unique identifier corresponding to each data acquisition request from the data acquisition request set;
s402, establishing a corresponding relation between the target data and the unique identification of the corresponding data acquisition request;
and S403, packaging all the target data, all the unique identifiers and all the corresponding relations into a feedback data set, so that the control layer can determine the target data corresponding to each data acquisition request by using the unique identifiers and the corresponding relations.
As can be seen from the above, the target data queried by the intermediate layer from the database according to each data acquisition request corresponds to a unique identifier, that is, the target data and the unique identifier corresponding to the data acquisition request have a mapping relationship, and when the target data is fed back, the target data, the unique identifier and the corresponding relationship need to be encapsulated at the same time to form a feedback data set, so that the control layer can determine the target data corresponding to each data acquisition request from the feedback data set, so as to further render the user interface by using the target data.
S5, sending the feedback data set to the control layer through a control layer interface so that the control layer renders the user interface of the front end by using the feedback data in the feedback data set, wherein the control layer interface is a data transmission interface exposed to the middle layer by the control layer at the front end.
Furthermore, the middle layer calls the control layer interface to transmit the feedback data set, and as can be seen, the control layer can receive a plurality of feedback data fed back by the middle layer at one time, so that the time wasted by sending the feedback data for many times can be effectively saved.
S6, receiving a feedback data set sent by the middle layer, wherein the feedback data set comprises a plurality of feedback data, and the feedback data corresponds to the data acquisition request.
And corresponding to the step S5, the control layer receives the feedback data set sent by the middle layer, and uses the feedback data in the feedback data set as the data basis for the subsequent rendering.
S7, rendering the user interface of the front end by using the feedback data in the feedback data set.
Specifically, as shown in fig. 7, a schematic diagram of a method for parsing a feedback data set provided in an embodiment of the present application is shown, where the method includes:
s701, analyzing the feedback data set to obtain each feedback data and a unique identifier of a data acquisition request corresponding to the feedback data;
s702, according to each unique identifier, rendering the user interface of the front end by using the corresponding feedback data so as to process the corresponding data acquisition request.
After receiving the feedback data set, the control layer needs to parse the feedback data set to obtain each feedback data included in the feedback data set and the unique identifier corresponding to the feedback data. The control layer can correspondingly find the feedback data according to each unique identifier, and render the user interface corresponding to the data acquisition request by using the feedback data. For example, the data acquisition request a is to acquire data of the rendering area a, and the unique identifier of the data acquisition request a is 1, then the control layer may find the unique identifier 1 and the feedback data AA corresponding to the unique identifier 1 by analyzing the feedback data set, and at this time, the control layer may render the area a by using the feedback data AA to process the data acquisition request a. Therefore, the corresponding relation between the unique identifier and the feedback data can be used for accurately rendering the feedback data at the corresponding position, so that a correct user interface is obtained, and the experience of a user is guaranteed.
Fig. 8 is a schematic structural diagram of a first data transmission apparatus according to an embodiment of the present invention, where the apparatus includes: a data acquisition request sending module 1, configured to send a data acquisition request set to an intermediate layer, where the control layer is located at a front end of the application program and has a capability of sending multiple requests and receiving multiple feedbacks at the same time, the intermediate layer is located between the control layer and a database and is used for forwarding requests and data, and the data acquisition request set includes multiple data acquisition requests; a feedback data receiving module 2, configured to receive a feedback data set sent by the intermediate layer, where the feedback data set includes multiple feedback data, and the feedback data corresponds to the data acquisition request; a rendering module 3, configured to render the user interface of the front end using the feedback data in the feedback data set. A data acquisition request receiving module 4, configured to receive a data acquisition request set sent by a control layer of the application program, where the control layer is located at a front end of the application program and has a capability of sending multiple requests and receiving multiple feedbacks at the same time, the intermediate layer is located between the control layer and a database and is used for forwarding a request and a data, and the data acquisition request set includes multiple data acquisition requests; the query module 5 is configured to query target data from the database of the application program according to the data acquisition request set, where the target data is data corresponding to each data acquisition request in the data acquisition request set; a feedback data encapsulation module 6, configured to encapsulate all the target data into a feedback data set; a feedback data sending module 7, configured to send the feedback data set to the control layer through a control layer interface, so that the control layer renders the user interface of the front end by using the feedback data in the feedback data set, where the control layer interface is a data transmission interface exposed to the middle layer at the front end of the control layer.
Fig. 9 is a schematic structural diagram of a second embodiment of a data transmission device according to the present invention, where the data obtaining request sending module 1 includes: a request obtaining module 11, configured to obtain a data obtaining request initiated by a user through the front end; a marking module 12, configured to mark a unique identifier for each data acquisition request; the encapsulating module 13 is configured to encapsulate all the data acquisition requests and the corresponding unique identifiers into a data acquisition request set; a sending module 14, configured to send the data acquisition request set to an intermediate layer.
Fig. 10 is a schematic structural diagram of a third embodiment of a data transmission device according to the present invention, where the rendering module 3 includes: the first analyzing module 31 is configured to analyze the feedback data set to obtain each feedback data and a unique identifier of a data acquisition request corresponding to the feedback data; and a corresponding rendering module 32, configured to render the front-end user interface with the corresponding feedback data according to each unique identifier, so as to process the corresponding data acquisition request.
Fig. 11 is a schematic structural diagram of a fourth embodiment of the data transmission apparatus provided in the embodiment of the present invention, where the query module 5 includes: a second parsing module 51, configured to parse the data acquisition request set to obtain each data acquisition request; and the target query module 52 is configured to query the corresponding target data from the database according to each data acquisition request.
Fig. 12 is a schematic structural diagram of a fifth embodiment of a data transmission apparatus according to the present invention, where the feedback data encapsulation module 6 includes: a unique identifier obtaining module 61, configured to obtain a unique identifier corresponding to each data obtaining request from the data obtaining request set; a correspondence establishing module 62, configured to establish a correspondence between the target data and the unique identifier of the corresponding data acquisition request; a data encapsulation module 63, configured to encapsulate all the target data, all the unique identifiers, and all the corresponding relationships into a feedback data set, so that the control layer determines the target data corresponding to each data acquisition request by using the unique identifiers and the corresponding relationships.
Fig. 13 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. A control layer applied to an application, the electronic device comprising: a memory 101 and a processor 102;
a memory 101 for storing a computer program;
the processor 102 is configured to execute the computer program stored in the memory to implement the data transmission method in the above embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 101 may be separate or integrated with the processor 102.
When the memory 101 is a device independent of the processor 102, the electronic apparatus may further include:
a bus 103 for connecting the memory 101 and the processor 102.
Fig. 14 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. An intermediate layer applied to an application, the electronic device comprising: a memory 104 and a processor 105;
a memory 104 for storing a computer program;
a processor 105 for executing the computer program stored in the memory to implement the data transmission method in the above-described embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 104 may be separate or integrated with the processor 105.
When the memory 104 is a device independent of the processor 105, the electronic apparatus may further include:
a bus 106 for connecting the memory 104 and the processor 105.
The electronic device provided in the embodiment of the present invention may be configured to execute any one of the data transmission methods shown in the above embodiments, and the implementation manner and the technical effect are similar, and details of the embodiment of the present invention are not described herein again.
An embodiment of the present invention further provides a readable storage medium, in which a computer program is stored, and when at least one processor of a message sending apparatus executes the computer program, the message sending apparatus executes the data transmission method described in any of the above embodiments.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program described above may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention.
Claims (16)
1. A data transmission method applied to a control layer of an application program, the method comprising:
the control layer sends a data acquisition request set to an intermediate layer, the control layer is positioned at the front end of the application program and has the capacity of simultaneously sending a plurality of requests and simultaneously receiving a plurality of feedbacks, the intermediate layer is positioned between the control layer and a database and is used for forwarding the requests and data, and the data acquisition request set comprises a plurality of data acquisition requests;
receiving a feedback data set sent by the middle layer, wherein the feedback data set comprises a plurality of feedback data, and the feedback data corresponds to the data acquisition request;
rendering a user interface of the front end using the feedback data in the set of feedback data.
2. The method of claim 1, wherein the control layer sending a set of data acquisition requests to the middle layer comprises:
acquiring a data acquisition request initiated by a user through the front end;
marking a unique identifier for each data acquisition request;
packaging all the data acquisition requests and the corresponding unique identifiers into a data acquisition request set;
and sending the data acquisition request set to a middle layer.
3. The method of claim 2, wherein the rendering the user interface of the front end using the feedback data of the set of feedback data comprises:
analyzing the feedback data set to obtain each feedback data and a unique identifier of a data acquisition request corresponding to the feedback data;
and according to each unique identifier, rendering the user interface of the front end by using the corresponding feedback data so as to process the corresponding data acquisition request.
4. A data transmission method is applied to an intermediate layer of an application program, and is characterized by comprising the following steps:
receiving a data acquisition request set sent by a control layer of the application program, wherein the control layer is positioned at the front end of the application program and has the capability of simultaneously sending a plurality of requests and simultaneously receiving a plurality of feedbacks, the middle layer is positioned between the control layer and a database and is used for forwarding the request and the data, and the data acquisition request set comprises a plurality of data acquisition requests;
inquiring target data from a database of the application program according to the data acquisition request set, wherein the target data is data corresponding to each data acquisition request in the data acquisition request set;
packaging all the target data into a feedback data set;
and sending the feedback data set to the control layer through a control layer interface so that the control layer renders the user interface of the front end by using the feedback data in the feedback data set, wherein the control layer interface is a data transmission interface exposed to the middle layer at the front end of the control layer.
5. The method of claim 4, wherein querying the database of the application for target data in accordance with the set of data acquisition requests comprises:
analyzing the data acquisition request set to obtain each data acquisition request;
and inquiring corresponding target data from the database according to each data acquisition request.
6. The method of claim 5, wherein said encapsulating all of said target data into a feedback data set comprises:
acquiring a unique identifier corresponding to each data acquisition request from the data acquisition request set;
establishing a corresponding relation between the target data and the unique identification of the corresponding data acquisition request;
and packaging all the target data, all the unique identifiers and all the corresponding relations into a feedback data set so that the control layer can determine the target data corresponding to each data acquisition request by using the unique identifiers and the corresponding relations.
7. A data transmission apparatus applied to a control layer of an application program, the apparatus comprising:
a data acquisition request sending module, configured to send a data acquisition request set to an intermediate layer, where the control layer is located at a front end of the application program and has a capability of sending multiple requests and receiving multiple feedbacks at the same time, the intermediate layer is located between the control layer and a database and is used for forwarding a request and data, and the data acquisition request set includes multiple data acquisition requests;
a feedback data receiving module, configured to receive a feedback data set sent by the intermediate layer, where the feedback data set includes multiple feedback data, and the feedback data corresponds to the data acquisition request;
a rendering module to render the user interface of the front end using the feedback data in the set of feedback data.
8. The apparatus of claim 7, wherein the data acquisition request sending module comprises:
the request acquisition module is used for acquiring a data acquisition request initiated by a user through the front end;
the marking module is used for marking a unique identifier for each data acquisition request;
the packaging module is used for packaging all the data acquisition requests and the corresponding unique identifiers into a data acquisition request set;
and the sending module is used for sending the data acquisition request set to the middle layer.
9. The apparatus of claim 8, wherein the rendering module comprises:
the first analysis module is used for analyzing the feedback data set to obtain each feedback data and a unique identifier of a data acquisition request corresponding to the feedback data;
and the corresponding rendering module is used for rendering the user interface of the front end by using the corresponding feedback data according to each unique identifier so as to process the corresponding data acquisition request.
10. A data transmission apparatus applied to an intermediate layer of an application program, the apparatus comprising:
a data acquisition request receiving module, configured to receive a data acquisition request set sent by a control layer of the application program, where the control layer is located at a front end of the application program and has a capability of sending multiple requests and receiving multiple feedbacks at the same time, the intermediate layer is a layer located between the control layer and a database and used for forwarding requests and data, and the data acquisition request set includes multiple data acquisition requests;
the query module is used for querying target data from the database of the application program according to the data acquisition request set, wherein the target data is data corresponding to each data acquisition request in the data acquisition request set;
the feedback data packaging module is used for packaging all the target data into a feedback data set;
and the feedback data sending module is used for sending the feedback data set to the control layer through a control layer interface so that the control layer renders the user interface of the front end by using the feedback data in the feedback data set, and the control layer interface is a data transmission interface exposed to the middle layer by the control layer at the front end.
11. The apparatus of claim 10, wherein the query module comprises:
the second analysis module is used for analyzing the data acquisition request set to obtain each data acquisition request;
and the target query module is used for querying corresponding target data from the database according to each data acquisition request.
12. The apparatus of claim 11, wherein the feedback data encapsulation module comprises:
the unique identifier acquisition module is used for acquiring a unique identifier corresponding to each data acquisition request from the data acquisition request set;
the corresponding relation establishing module is used for establishing the corresponding relation between the target data and the unique identification of the corresponding data acquisition request;
and the data encapsulation module is used for encapsulating all the target data, all the unique identifiers and all the corresponding relations into a feedback data set so that the control layer can determine the target data corresponding to each data acquisition request by using the unique identifiers and the corresponding relations.
13. An electronic device applied to a control layer of an application, the 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 of claims 1-3 via execution of the executable instructions.
14. A computer-readable storage medium for application at the control layer of an application, on which a computer program is stored, which computer program, when being executed by a processor, is adapted to carry out the data transmission method of any one of claims 1 to 3.
15. An electronic device applied to an intermediate layer of an application program, the 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 of claims 4-6 via execution of the executable instructions.
16. A computer-readable storage medium for application in an intermediate layer of an application, on which a computer program is stored, which computer program, when being executed by a processor, is adapted to carry out the data transmission method of any one of claims 4 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911340623.2A CN111162879A (en) | 2019-12-23 | 2019-12-23 | Data transmission method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911340623.2A CN111162879A (en) | 2019-12-23 | 2019-12-23 | Data transmission method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111162879A true CN111162879A (en) | 2020-05-15 |
Family
ID=70558102
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911340623.2A Pending CN111162879A (en) | 2019-12-23 | 2019-12-23 | Data transmission method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111162879A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116049268A (en) * | 2023-03-22 | 2023-05-02 | 广东粤港澳大湾区国家纳米科技创新研究院 | Method and device for realizing local dynamic form display |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103166964A (en) * | 2013-03-06 | 2013-06-19 | 中国人民解放军国防科学技术大学 | Front end and back end real time communication method for super computer system monitoring |
CN105760159A (en) * | 2016-02-01 | 2016-07-13 | 四川长虹电器股份有限公司 | Website developing method and system |
CN106656920A (en) * | 2015-10-30 | 2017-05-10 | 北京国双科技有限公司 | HTTP service processing method and device |
CN107229480A (en) * | 2017-06-19 | 2017-10-03 | 郑州云海信息技术有限公司 | A kind of desktop application construction method and device based on web technology |
CN107315784A (en) * | 2017-06-07 | 2017-11-03 | 北京奇艺世纪科技有限公司 | A kind of data access method and browser |
CN110221871A (en) * | 2019-04-22 | 2019-09-10 | 腾讯科技(深圳)有限公司 | Webpage acquisition methods, device, computer equipment and storage medium |
-
2019
- 2019-12-23 CN CN201911340623.2A patent/CN111162879A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103166964A (en) * | 2013-03-06 | 2013-06-19 | 中国人民解放军国防科学技术大学 | Front end and back end real time communication method for super computer system monitoring |
CN106656920A (en) * | 2015-10-30 | 2017-05-10 | 北京国双科技有限公司 | HTTP service processing method and device |
CN105760159A (en) * | 2016-02-01 | 2016-07-13 | 四川长虹电器股份有限公司 | Website developing method and system |
CN107315784A (en) * | 2017-06-07 | 2017-11-03 | 北京奇艺世纪科技有限公司 | A kind of data access method and browser |
CN107229480A (en) * | 2017-06-19 | 2017-10-03 | 郑州云海信息技术有限公司 | A kind of desktop application construction method and device based on web technology |
CN110221871A (en) * | 2019-04-22 | 2019-09-10 | 腾讯科技(深圳)有限公司 | Webpage acquisition methods, device, computer equipment and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116049268A (en) * | 2023-03-22 | 2023-05-02 | 广东粤港澳大湾区国家纳米科技创新研究院 | Method and device for realizing local dynamic form display |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110022289B (en) | Data transmission method, device and system | |
CN110380970B (en) | Self-adaptive data message forwarding method and device suitable for heterogeneous network | |
WO2019085073A1 (en) | Interface test method and apparatus, computer device, and storage medium | |
CN104301443B (en) | A kind of method and system that end ability interface is called on web page | |
CN102780613B (en) | A kind of method and apparatus of distributed apparatus communication between plates | |
CN110765001B (en) | Modularized automatic test method and device for application system | |
US20140297809A1 (en) | Apparatus and method for processing multiple open apis | |
CN102487403B (en) | Method and device for executing JS (JavaScript) by server side | |
EP3026856B1 (en) | Gre packet encapsulation method, decapsulation method, and corresponding apparatuses | |
CN109343975B (en) | Method and apparatus for inter-page asynchronous communication | |
CN109327511B (en) | Data request method and server based on HTTP (hyper text transport protocol) | |
CN103729292A (en) | Cross-host cross-platform remote command invoking method and system | |
CN111639275A (en) | Routing information processing method and device, electronic equipment and computer storage medium | |
CN111368172A (en) | Sensor data processing method and device, computer equipment and storage medium | |
EP3142316B1 (en) | Attribute operating method and apparatus | |
CN114500690A (en) | Interface data processing method and device, electronic equipment and storage medium | |
CN111162879A (en) | Data transmission method and device, electronic equipment and storage medium | |
CN113973111B (en) | Data forwarding method, device, gateway equipment and computer readable storage medium | |
CN110581792B (en) | Message transmission method and device | |
CN112732513B (en) | Memory monitoring method, memory monitoring device, computer readable storage medium and computer equipment | |
CN112702191A (en) | Link tracking method and terminal | |
CN113765722A (en) | Configurable multi-protocol message processing method and device and electronic equipment | |
CN107635009A (en) | Method of servicing, system, request of data device and the data supplying device of middleware | |
CN113973105A (en) | System and method for simplifying SOAP message on service bus | |
CN113676521A (en) | Service request response method and device and electronic equipment |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200515 |
|
RJ01 | Rejection of invention patent application after publication |