CN113055348B - Cross-platform data request method and device and electronic equipment - Google Patents

Cross-platform data request method and device and electronic equipment Download PDF

Info

Publication number
CN113055348B
CN113055348B CN201911375877.8A CN201911375877A CN113055348B CN 113055348 B CN113055348 B CN 113055348B CN 201911375877 A CN201911375877 A CN 201911375877A CN 113055348 B CN113055348 B CN 113055348B
Authority
CN
China
Prior art keywords
platform
data
request
request information
login
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911375877.8A
Other languages
Chinese (zh)
Other versions
CN113055348A (en
Inventor
雷元生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies 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 Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN201911375877.8A priority Critical patent/CN113055348B/en
Publication of CN113055348A publication Critical patent/CN113055348A/en
Application granted granted Critical
Publication of CN113055348B publication Critical patent/CN113055348B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0815Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a cross-platform data request method, a cross-platform data request device and electronic equipment, wherein the method comprises the following steps: acquiring data request information sent by a front end of a first platform, wherein the data request information comprises first data request information for requesting data of a back end of a second platform, and the back end of the second platform is one or more; rewriting the first data request information according to a preset request mapping relation between the first platform and the second platform; and sending the rewritten first data request information to the second platform back end to request the second platform back end data. The invention can solve the problems that the forwarding service for realizing the cross-platform data fusion has various code types, is inconvenient to manage and has low cross-platform data fusion efficiency in the prior art.

Description

Cross-platform data request method and device and electronic equipment
Technical Field
The invention relates to the technical field of data sharing, in particular to a cross-platform data request method, a cross-platform data request device and electronic equipment.
Background
The current data platforms are various, and because different programming languages or development modes are used during development of each data platform, the communication standards in different platforms are different, and further, direct communication between different platforms cannot be achieved. The following reasons are specific: 1. there are different login tokens between platforms. 2. When more detailed information of a piece of data needs to be displayed, a background interface of a platform where the data is located needs to be called, and under the condition that the front end is not customized and developed, the front end cannot identify a source platform of the piece of data. 3. When one request needs to return the fusion data and the request parameters only carry the data of the platform, the data of the other platform can be returned for fusion processing only by making a request on the data of the other platform by using the related data of the other platform. When data of a plurality of platforms need to be fused, a separate forwarding service needs to be established between every two different data platforms for fusion processing. But due to the complexity of the traffic, some differentiated handling is required for different forwarding services. Different research and development personnel have different code habits, and if the forwarding service is realized without a certain realization standard, the problems that the forwarding service has various code types, is inconvenient to manage and has low cross-platform data fusion efficiency can be caused.
Disclosure of Invention
The embodiment of the invention provides a cross-platform data request method, which can solve the problems that in the prior art, the forwarding service for realizing cross-platform data fusion has various code types, is inconvenient to manage and has low cross-platform data fusion efficiency.
In a first aspect, an embodiment of the present invention provides a cross-platform data request method, where the method includes:
acquiring data request information sent by a front end of a first platform, wherein the data request information comprises first data request information for requesting data of a back end of a second platform, and the back end of the second platform is one or more;
rewriting the first data request information according to a preset request mapping relation between the first platform and the second platform;
and sending the rewritten first data request information to the second platform back end to request the second platform back end data.
Optionally, the preset request mapping relationship includes a preset request header mapping relationship and a preset request content mapping relationship, and the first data request information includes a request header and request content; the step of rewriting the first data request information according to a preset request mapping relationship between the first platform and the second platform includes:
rewriting the request head according to the preset request head mapping relation;
rewriting the request content according to the preset request content mapping relation;
and obtaining the rewritten first data request information according to the rewritten second platform request head and the rewritten second platform request content.
Optionally, the data request information further includes second data request information for requesting backend data of the first platform, and the method further includes:
and directly forwarding the second data request information to the first platform backend to request the first platform backend data.
Optionally, the method further includes:
receiving the first platform backend data returned by the first platform backend and the second platform backend data returned by the second platform backend;
and fusing the first platform back-end data and the second platform back-end data, and returning the fused data to the first platform front end.
Optionally, before the obtaining of the data request information sent by the first platform front end, the method includes:
acquiring login request information sent by the front end of the first platform, wherein the login request information comprises account information and password information of a user;
and forwarding the login request information to the first platform and the second platform so as to log in the first platform and the second platform once according to the account information and the password information of the user.
Optionally, the login request information includes first platform login request information for requesting to login to the first platform and second platform login request information for requesting to login to the second platform, and the step of forwarding the login request information to the first platform and the second platform so as to perform login once on the first platform and the second platform according to the account information and the password information of the user includes:
forwarding the first platform login request information to the first platform;
receiving a first platform login token returned by the first platform;
and forwarding the second platform login request information to the second platform;
receiving a second platform login token returned by the second platform according to a preset corresponding relation between the first platform login token and the second platform login token;
logging in the first platform and the second platform according to the first platform login token and the second platform login token.
In a second aspect, an embodiment of the present invention further provides a cross-platform data request apparatus, where the apparatus includes:
the data request information acquisition module is used for acquiring data request information sent by a front end of a first platform, wherein the data request information comprises first data request information used for requesting data of a back end of a second platform, and the back end of the second platform is one or more;
the rewriting module is used for rewriting the first data request information according to a preset request mapping relation between the first platform and the second platform;
and the first data request information sending module is used for sending the rewritten first data request information to the second platform back end so as to request the second platform back end data.
In a third aspect, an embodiment of the present invention further provides a cross-platform data request system, including: a first platform front end, a first platform back end corresponding to the first platform front end, at least one second platform end, and the cross-platform data request device provided in the foregoing embodiments.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including: the cross-platform data request method comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of the cross-platform data request method provided by the embodiment.
In a fifth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where 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 steps in the cross-platform data request method provided in the foregoing embodiment.
In the embodiment of the invention, data request information sent by a front end of a first platform is obtained, wherein the data request information comprises first data request information for requesting back end data of a second platform; rewriting the first data request information according to a preset request mapping relation between the first platform and the second platform; and sending the rewritten first data request information to the second platform back end to request the second platform back end data. The invention can realize cross-platform data fusion by using the same forwarding service among a plurality of different platforms. The data request information which is sent by a front end of a certain platform and used for requesting the data of the back ends of a plurality of platforms can be rewritten or recombined in the same forwarding service only by one forwarding service code so as to be suitable for requesting the data of the back ends of different platforms, thereby solving the problems that the forwarding service for realizing cross-platform data fusion in the prior art has various code types, is inconvenient to manage and has low cross-platform data fusion efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a diagram of a system architecture provided by an embodiment of the present invention;
FIG. 2 is a flowchart of a cross-platform data request method according to an embodiment of the present invention;
FIG. 3 is a flow chart of another cross-platform data request method provided by an embodiment of the invention;
FIG. 4 is a schematic diagram illustrating an example of rewriting information of a data request according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a cross-platform data requesting device according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of another cross-platform data request device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram 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 clearly and completely described below with reference to the 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.
To explain the technical solution of the present invention more clearly, as shown in fig. 1, fig. 1 is a system architecture diagram provided in the embodiment of the present invention, and the system architecture 100 may include a platform-one front end 101, a platform-two front end 102, a middle forwarding element 103, a platform-one back end 105 corresponding to the platform-one front end 101, and a platform-two back end 104 corresponding to the platform-two front end 102. The intermediate forwarding component 103 is configured to provide a medium of a communication link between the first platform front end 101 and the second platform back end 104, between the second platform front end 102 and the first platform back end 105, between the first platform front end 101 and the second platform back end 104, and between the second platform front end 102 and the first platform back end 105, and is configured to forward and rewrite data request information, and to forward and merge data of the first platform back end 105 and data of the second platform back end 104. The communication means between the intermediate forwarding element 103 and the platform-one front end 101 and the platform-two back end 104, between the platform-two front end 102 and the platform-one back end 105, between the platform-one front end 101 and the platform-two back end 104, and between the platform-two front end 102 and the platform-one back end 105 may include various connection types, such as wired, wireless communication links, or fiber optic cables. In the system architecture, two sets of different platforms are adopted for the first platform and the second platform, but the service provided by the first platform and the second platform can be the same, namely, part of service data provided by the first platform and the second platform can be the same type.
The user may use the platform-one front end 101 to interact with the platform-one back end 105 and the platform-two back end 104 through the intermediate forwarding element 103 to request and receive messages of the platform-one back end 105 and the platform-two back end 104, and the like. The user may also use the platform two front-end 102 to interact with the platform one back-end 105 and the platform two back-end 104 through the intermediate forwarding element 103 to request and receive messages of the platform one back-end 105 and the platform two back-end 104, and the like.
The first platform front end 101 and the second platform front end 102 may be disposed in various electronic devices or terminals having a display screen and supporting web browsing, where the electronic devices include, but are not limited to, smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like. The first platform back end 105 and the second platform back end 104 are generally disposed in a server corresponding to the terminal where the first platform front end 101 and the second platform front end 102 are located. Various communication client applications, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, a management application, and the like, may be installed in the electronic device or the terminal.
It should be noted that, the cross-platform data request method provided in the embodiment of the present application is generally executed by the intermediate forwarding component 103, and accordingly, the cross-platform data request apparatus is generally disposed in the intermediate forwarding component 103.
It should be understood that the number of platform one front ends 101, platform two front ends 102, intermediate forwarders 103, platform one back ends 105, and platform two back ends 104 in fig. 1 is merely illustrative. There may be any number of platform one front ends 101, platform two front ends 102, intermediate forwarders 103, platform one back ends 105, and platform two back ends 104, as desired for an implementation.
It should be noted that the first platform front end, the first platform back end, the cross-platform data requesting device, the second platform front end, and the second platform back end mentioned in the following embodiments may all correspond to the first platform front end 101, the second platform front end 102, the intermediate forwarding element 103, the first platform back end 105, and the second platform back end 104 in fig. 1. Wherein, the cross-platform data request device mentioned in the following embodiments may be directly replaced with the intermediate forwarding component 103 in fig. 1. The cross-platform data request device mentioned in the embodiments described below may also be provided in the intermediate forwarding component 103 of fig. 1.
Referring to fig. 2, fig. 2 is a flowchart of a cross-platform data request method according to an embodiment of the present invention, where the cross-platform data request method is used for requesting at least one cross-platform backend data through a platform front end, as shown in fig. 1, the cross-platform data request method includes the following steps:
step 201, obtaining data request information sent by a front end of a first platform.
The data request information is request information for requesting first platform backend data and/or second platform backend data. The data request information includes first data request information for requesting second platform backend data. The data request information further includes second data request information for requesting the backend data of the first platform. The data request information further includes second data request information for requesting the first platform backend data.
The first platform front end is a platform front end currently used by a user. The front end of the platform is a front end of the platform where a user obtains a plurality of back end data of the platform, for example, in an application system, an interface capable of interacting with the user is a front end of the application system, or for example, in a certain browsing system, a webpage corresponding to the browsing system is a front end corresponding to the browsing system. Specifically, the first platform front end is equivalent to a client, and the first platform front end is generally disposed in various electronic devices or terminals having a display screen and supporting web browsing, where the electronic devices or terminals may include, but are not limited to, smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
Specifically, when a user wants to acquire certain data, the user may edit request information of the data through the first platform front end, and send the edited request information to the intermediate forwarding component through the first platform front end, or directly trigger the request information of the data through the first platform front end, and send the request information to the intermediate forwarding component. The intermediate forwarding component can receive the request information of the data.
It should be noted that, because the platform front end is disposed in the electronic device or the terminal, the user can operate each electronic device or terminal, and further implement to operate the platform front end and send the request information to the intermediate forwarding component. For example, if a user wants to obtain the backend data of the system a, the user needs to obtain the backend data of the system a by operating the front end of the web page of the system a on an electronic device such as a computer, a notebook, or a mobile phone, and editing or triggering request information of the data in the front end interface of the web page.
It should be noted that the first platform front end and the second platform front end are only for identification, and are not limited to each platform, and which platform front end sends the data request information and which platform front end is the first platform front end. Of course, the same applies to the second platform backend, which platform backend is requested to be accessed by another platform front-end, and which platform backend is the second platform backend. The corresponding first platform back end and second platform front end are also interchangeable. It is only necessary to ensure that the data request information is a cross-platform request.
Step 202, rewriting the first data request information according to a preset request mapping relation between the first platform and the second platform.
The preset request mapping relationship is a request corresponding relationship pre-established between the first platform and the second platform. The preset request mapping relationship comprises a preset request header mapping relationship and a preset request content mapping relationship. The request header mapping relationship is also a preset corresponding relationship between the first platform and the second platform. The request header (header) is self-contained interactive information between the platform front end and the platform back end. The request header may be, for example, a content-type (content type of the content submitted by the display request), a token (access token in the authentication information), a cookie (browser-side cookie), a Referer (containing a URL from which the user accesses the currently requested page), and so on. In a specific embodiment, the request header mapping relationship may be, for example, in the case of a token, when a user logs in to a platform, the login token of each platform must be different. In order to log in one platform and the other platform simultaneously, a corresponding relationship between the login tokens of the two platforms can be established in advance. When the previous platform is logged in, the previous platform firstly generates a corresponding login token to log in the platform, but the token of the other platform can be inquired through the token of the previous platform according to the corresponding relation of the login token between the two platforms, and the login of the other platform can be realized.
The preset request content mapping relationship is also a preset corresponding relationship between the first platform and the second platform. The request content may be an interface, a parameter, a file, etc. of each platform, such as url (Uniform Resource Locator), method (request method), param (request parameter), body (request body), file (request file), etc. In a specific implementation, the preset mapping relationship of the request content may be, for example, when, for param, a parameter value of param corresponding to the a service data on the first platform is a, and a parameter value of param corresponding to the a service data on the second platform is b, a corresponding relationship between a and b may be established in advance. When the data of the service data a on the first platform is requested, the corresponding data can be acquired on the first platform according to the parameter value a. When the data of the service data A on the second platform is requested, the corresponding data can be acquired on the second platform according to the parameter value b.
The first data request information comprises a request header and request content, so that when the request information of certain service data is sent to a certain platform, platform backend data corresponding to the service data can be acquired according to the request header and the request content.
The number of the second platforms may be one or more. For example, when the second platform is one, the user may request the first platform backend data and the second platform backend data through the first platform front end, that is, may request two platform backend data. When the number of the second platforms is two and the types of the two second platforms are different, the user can request the data of the back end of the first platform through the front end of the first platform, and the data of the back ends of the two different types of second platforms can request the data of the back ends of the three platforms. In the embodiment of the present invention, the kind and number of the second stages are not further limited.
Specifically, the request header is rewritten according to the preset request header mapping relationship. In specific implementation, each platform has its own request header, for example, each platform has its own access token (token), so in order to adapt to request backend data of different platforms, the access token in the request information needs to be modified into the access token of the corresponding platform. Because the request head mapping relation is preset between the platforms, the access token of another platform can be inquired only according to the access token of the platform corresponding to the front end of the platform sending the data request, and the inquired access token replaces the former access token.
Of course, content-type, cookie, referer, etc. may be rewritten according to the type of requested service data and the correspondence of request headers between platforms, so as to adapt to the request header of its corresponding platform.
Furthermore, the request content is rewritten according to a preset request content mapping relation. Specifically, each service data has its own request content on each platform, for example, each service data has its own request parameter (param) on each platform, so in order to adapt to the backend data requesting different platforms, the request parameter in the request information needs to be modified into the request parameter of the corresponding platform. Because the request content mapping relation is preset between the platforms, the request parameter of another platform can be inquired only according to the request parameter of the platform corresponding to the front end of the platform sending the data request, and the inquired request parameter replaces the former request parameter.
Of course, url, method, body, file, etc. may be rewritten according to the type of the requested service data and the corresponding relationship of the requested content between the platforms, so as to adapt to the requested content of the corresponding platform.
Furthermore, the rewritten first data request information is obtained according to the rewritten request header and the rewritten request content. Specifically, after the request header and the request content in the first data request information are replaced with the request header and the request content of the second platform, the data request information for the second platform can be obtained, that is, the rewritten first data request information is obtained.
Step 203, sending the rewritten first data request information to the second platform backend to request the second platform backend data.
The rewritten first data request information includes a second platform request header and second platform request content, and is thus suitable for requesting second platform backend data.
Specifically, after the rewritten first data request information is obtained, the first data request information may be sent to the second platform backend, and then the rewritten first data request information is used to request the second platform backend data.
It should be noted that, the front-end and back-end structures of the first platform and the second platform are not modified in the execution of steps 201 to 203, so that the specific structures of the first platform and the second platform are not affected. But simply through rewriting or reorganizing the requested information to accommodate requests for data between different types of platforms.
As another embodiment, the front end of the first platform in steps 201 to 203 may be replaced by the front end of the second platform, and the rear end of the second platform may be replaced by the rear end of the first platform. As long as the data request information is guaranteed to be a cross-platform request.
As a further embodiment, the first platform front-end may also request only the first platform backend data when the first platform front-end does not need to request backend data of another platform. When the first platform front-end does not need to request the first platform back-end data, the first platform front-end may also only need to request the data of the other platform back-end.
In the embodiment of the invention, by acquiring the data request information sent by the front end of the first platform, the data request information comprises first data request information for requesting the back end data of the second platform; rewriting first data request information according to a preset request mapping relation between a first platform and a second platform; and sending the rewritten first data request information to the second platform back end to request the second platform back end data. The invention can realize cross-platform data fusion by using the same forwarding service among a plurality of different platforms. The data request information which is sent by a front end of a certain platform and used for requesting the data of the back ends of a plurality of platforms can be rewritten or recombined in the same forwarding service only by one forwarding service code so as to be suitable for requesting the data of the back ends of different platforms, thereby solving the problems that the forwarding service for realizing cross-platform data fusion in the prior art has various code types, is inconvenient to manage and has low cross-platform data fusion efficiency.
Referring to fig. 3 and fig. 3, which are flowcharts of another cross-platform data request method provided by the embodiment of the present invention, the data request information further includes second data request information for requesting backend data of the first platform. On the basis of fig. 2, the cross-platform data request method further includes:
step 301, directly forwarding the second data request message to the first platform backend to request the first platform backend data.
The second data request information includes a corresponding request header and request content, and is used for requesting the first platform backend data.
Specifically, since the second data request information is sent from the first platform front end and is request information for requesting data at the first platform back end, and the first platform front end and the first platform back end belong to the same platform, the second data request information can be directly sent to the first platform back end for requesting data at the first platform back end without rewriting the second data request information. Of course, when receiving data request information for requesting data of the same platform backend sent by the same platform front end, the data request information can be directly forwarded without rewriting the data request information. Or directly using the default request information to request the same platform backend data. The default implementation makes it unnecessary to rewrite all requests and request contents, which greatly improves the reusability of the code.
For example, referring to fig. 4, fig. 4 is a schematic diagram illustrating rewriting of data request information according to an embodiment of the present invention. To avoid repetition, details in fig. 3 are not described.
In the embodiment of the invention, the data request information sent by the front end of the first platform can request the data of the back end of the first platform and the data of the back end of the second platform, and further the data of the back ends of at least two different platforms can be fused to a user. Therefore, the data of at least two platforms at the back end is requested through one platform at the front end, and the sharing effect of the data among multiple platforms is further improved.
Optionally, the cross-platform data request method further includes the steps of:
and receiving first platform back-end data returned by the first platform back-end and second platform back-end data returned by the second platform back-end.
And fusing the first platform back-end data and the second platform back-end data, and returning the fused data to the first platform front end.
The first platform rear end is mainly used for providing various service data required by each platform front end. If the front end of the first platform is a client, the back end of the first platform is a server corresponding to the client. For another example, if the front end of the first platform is a terminal, the back end of the first platform is a server corresponding to the terminal. Of course, the back end of the second platform corresponds to the front end of the second platform, and the back end of the second platform is mainly used for providing various service data required by the front end of each platform. If the front end of the second platform is a client, the back end of the second platform is a server corresponding to the client. For another example, if the front end of the second platform is a terminal, the back end of the second platform is a server corresponding to the terminal.
Specifically, after the first platform backend receives the second data request information, the corresponding data (first platform backend data) may be returned according to the request header and the request content in the second data request information. Of course, after the second platform backend receives the first data request information, corresponding data (second platform backend data) is also returned according to the request header and the request content in the first data request information.
After data returned by the first platform rear end and the second platform rear end are received, the two data can be subjected to data fusion. The data fusion process may be sorting the first platform back-end data and the second platform back-end data according to a time sequence to obtain a time sequence queue. Or sorting the first platform rear-end data and the second platform rear-end data according to attributes, request values, data types of data sizes and the like, and further obtaining corresponding data queues. And finally, the fused data is forwarded to the front end of the first platform, and the front end of the first platform receives the data of two different platforms. For example, there are two requirements 1. The platform 1 interface only requires the face of the platform 1 to collect data. 2. When the platform 1 interface searches the human face, the search results of the platform 1 and the platform 2 are required to be returned. In specific implementation, when the 1 st requirement is realized, only the request needs to be forwarded to the back end of the platform 1, and when the 1 st requirement request is received by the back end of the platform 1, corresponding data can be returned according to the request information. When the requirement 2 is realized, the request needs to be forwarded to the back ends of the platform 1 and the platform 2, then the data returned by the two platforms are subjected to fusion processing, and the fused data is sent to the front end of the platform 1. Of course, the request sent to the backend of the platform 2 needs to be rewritten according to the mapping relationship between the platform 1 and the platform 2 to adapt to the backend data of the requesting platform 2.
As an embodiment, after receiving the data fusing two different platforms, the first platform front end may present the data to the user. The display mode may be display through various display devices, the display devices may be display screens, display players, and the like, and the data may also be played in the form of sound through audio playing devices, such as speakers, MP3 players, and the like, and provided to the user. It may also be provided to the user by printing out with an image generating device, such as a printer, etc.
In the embodiment of the invention, the first platform back-end data and the second platform back-end data can be obtained through the data request information sent by the first platform front-end, and the obtained first platform back-end data and the second platform back-end data are fused and returned to the first platform front-end, so that the data can be conveniently provided for users. The fusion efficiency of data among a plurality of platforms is further improved.
Optionally, before obtaining the data request information sent by the first platform front end, the method includes:
and acquiring login request information sent by the front end of the first platform, wherein the login request information comprises account information and password information of a user.
And forwarding the login request information to the first platform and the second platform so as to log in the first platform and the second platform once according to the account information and the password information of the user.
Wherein the login request information comprises first platform login request information for requesting to login a first platform and second platform login request information for requesting to login a second platform,
specifically, when login request information sent by a user through a front end of a first platform is received, whether the login request information comprises first login request information and second login request information is judged, and if the login request information comprises the first login request information and the second login request information at the same time, the first login request information and the second login request information are judged. The step of forwarding the login request information to the first platform and the second platform to perform one login on the first platform and the second platform according to the account information and the password information of the user includes:
and forwarding the first platform login request information to the first platform.
And receiving a first platform login token returned by the first platform.
And forwarding the second platform login request information to the second platform.
And receiving a second platform login token returned by the second platform according to the preset corresponding relation between the first platform login token and the second platform login token.
And logging in the first platform and the second platform according to the first platform login token and the second platform login token.
The preset corresponding relation between the first platform login token and the second login token is preset by a user. Specifically, after determining that the login request information simultaneously includes the first login request information and the second login request information, respectively forwarding the first login request information and the second login request information to the corresponding first platform back end and the corresponding second platform back end. And receiving a first login token returned by the back end of the first platform. Therefore, the first platform can log in the rear end of the first platform according to the account information and the password information of the user in the login information of the first platform and the login information of the first platform returned by the first platform. Certainly, when logging in the back end of the second platform, the second login token corresponding to the first login token is found according to the first login token returned by the back end of the first platform, and the user logs in the back end of the second platform according to the account information and the password information of the user in the login request information.
In the embodiment of the invention, the first platform and the second platform can be logged in at one time through the login request information sent by the front end of the first platform. Of course, if there are a plurality of types and numbers of the second platforms, all the platforms can be logged in at one time through the login request information sent by the front end of the first platform. The method further improves the data fusion efficiency among a plurality of platforms and solves the problem that the forwarding service realizing the cross-platform data fusion has various code types and is inconvenient to manage.
Referring to fig. 5 and fig. 5 are schematic structural diagrams of a cross-platform data request apparatus according to an embodiment of the present invention, where the cross-platform data request apparatus 400 includes:
the data request information obtaining module 401 is configured to obtain data request information sent by a front end of a first platform, where the data request information includes first data request information for requesting data at a back end of a second platform, and the back end of the second platform is one or more types.
The rewriting module 402 is configured to rewrite the first data request information according to a preset request mapping relationship between the first platform and the second platform.
Specifically, the preset request mapping relationship includes a preset request header mapping relationship and a preset request content mapping relationship, and the first data request information includes a second platform request header and a second platform request content. The rewrite module 402 includes:
and the first rewriting unit is used for rewriting the request head of the second platform according to the preset request head mapping relation.
And the second rewriting unit is used for rewriting the request content of the second platform according to the preset request content mapping relation.
And the third rewriting unit is used for obtaining the rewritten first data request information according to the rewritten second platform request header and the rewritten second platform request content.
The first data request information sending module 403 is configured to send the rewritten first data request information to the second platform backend to request the second platform backend data.
Referring to fig. 6 and fig. 6 are schematic structural diagrams of another cross-platform data request apparatus according to an embodiment of the present invention, where the data request information further includes second data request information for requesting backend data of the first platform, and on the basis of fig. 5, the cross-platform data request apparatus 400 further includes:
the second data request information sending module 404 is configured to directly forward the second data request information to the first platform backend to request the first platform backend data.
Optionally, on the basis of fig. 6, the cross-platform data requesting apparatus 400 further includes:
and the receiving module is used for receiving the first platform back-end data returned by the first platform back-end and the second platform back-end data returned by the second platform back-end.
And the fusion module is used for fusing the first platform back-end data and the second platform back-end data and returning the fused data to the first platform front end.
Optionally, on the basis of fig. 5, before the data request information obtaining module, the cross-platform data requesting apparatus 400 includes:
and the login request information acquisition module is used for acquiring login request information sent by the front end of the first platform, wherein the login request information comprises account information and password information of a user.
And the login request information forwarding module is used for forwarding the login request information to the first platform and the second platform so as to perform login once on the first platform and the second platform according to the account information and the password information of the user.
Optionally, the login request information includes first platform login request information for requesting to login to the first platform and second platform login request information for requesting to login to the second platform, and the login request information forwarding module includes:
and the first platform login request information forwarding unit is used for forwarding the first platform login request information to the first platform.
And the first platform login token receiving unit is used for receiving the first platform login token returned by the first platform.
And the second platform login request information forwarding unit is used for forwarding the second platform login request information to the second platform.
And the second platform login token receiving unit is used for receiving a second platform login token returned by the second platform according to the preset corresponding relation between the first platform login token and the second platform login token.
And the login unit is used for logging in the first platform and the second platform according to the first platform login token and the second platform login token.
The cross-platform data request device 400 provided in the embodiment of the present invention can implement each implementation manner in the foregoing method embodiments and corresponding beneficial effects, and for avoiding repetition, details are not described here.
The embodiment of the invention also provides a cross-platform data request system, which comprises: a first platform front end, a first platform back end corresponding to the first platform front end, at least one second platform end, and the cross-platform data request device provided in the foregoing embodiments.
In the embodiment of the invention, the data request information sent by the front end of one platform can be rewritten or recombined under the condition of not changing the front end and the back end of the two platforms so as to be suitable for requesting the back end data of different platforms, thereby realizing the effect of cross-platform request of the back end data of the other platform through the front end of one platform, further improving the fusion efficiency of data among a plurality of platforms and solving the problem that the forwarding service for realizing cross-platform data fusion has various code types and is not convenient to manage.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 500 includes: the memory 502, the processor 501 and a computer program stored in the memory 502 and capable of running on the processor 501, when the processor 501 executes the computer program, the steps in the cross-platform data request method provided by the above embodiments are implemented, and the processor 501 executes the following steps:
the method comprises the steps of obtaining data request information sent by a front end of a first platform, wherein the data request information comprises first data request information used for requesting data of a back end of a second platform, and the back end of the second platform is one or more.
And rewriting the first data request information according to a preset request mapping relation between the first platform and the second platform.
And sending the rewritten first data request information to the second platform back end to request the second platform back end data.
Optionally, the preset request mapping relationship includes a preset request header mapping relationship and a preset request content mapping relationship, and the first data request information includes a request header and request content; the step executed by the processor 501 for rewriting the first data request information according to the preset request mapping relationship between the first platform and the second platform includes:
and rewriting the request header according to a preset request header mapping relation.
And rewriting the request content according to a preset request content mapping relation.
And obtaining the rewritten first data request information according to the rewritten request header and the rewritten request content.
Optionally, the data request information further includes second data request information for requesting backend data of the first platform. The processor 501 also performs the following steps:
and directly forwarding the second data request information to the first platform backend to request the first platform backend data.
Optionally, the processor 501 further performs the following steps:
and receiving first platform back-end data returned by the first platform back-end and second platform back-end data returned by the second platform back-end.
And fusing the first platform back-end data and the second platform back-end data, and returning the fused data to the first platform front end.
Optionally, before the processor 501 performs obtaining the data request information sent by the front end of the first platform, the processor 501 further performs the following steps:
obtaining login request information sent by a front end of a first platform, wherein the login request information comprises account information and password information of a user.
And forwarding the login request information to the first platform and the second platform so as to log in the first platform and the second platform once according to the account information and the password information of the user.
Optionally, the login request information includes first platform login request information for requesting to login to the first platform and second platform login request information for requesting to login to the second platform. The step executed by the processor 501 of forwarding the login request information to the first platform and the second platform to perform a login on the first platform and the second platform according to the account information and the password information of the user includes:
and forwarding the first platform login request information to the first platform.
And receiving a first platform login token returned by the first platform.
And forwarding the second platform login request information to the second platform.
And receiving a second platform login token returned by the second platform according to the preset corresponding relation between the first platform login token and the second platform login token.
And logging in the first platform and the second platform according to the first platform login token and the second platform login token.
It should be noted that the electronic device 500 may be a smart terminal, a mobile phone, a tablet computer, or the like of each platform system.
The electronic device 500 provided in the embodiment of the present invention can implement each implementation manner in the foregoing method embodiments and corresponding beneficial effects, and for avoiding repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor 501, the computer program implements each process in the cross-platform data request method provided in the embodiment of the present invention, and can achieve the same technical effect, and is not described herein again to avoid repetition.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (9)

1. A cross-platform data request method, the method comprising:
acquiring data request information sent by a front end of a first platform, wherein the data request information comprises first data request information for requesting data of a back end of a second platform, and the back end of the second platform is one or more;
rewriting the first data request information according to a preset request mapping relation between the first platform and the second platform;
sending the rewritten first data request information to the second platform back end to request the second platform back end data;
the preset request mapping relation comprises a preset request header mapping relation and a preset request content mapping relation, and the first data request information comprises a request header and request content; the step of rewriting the first data request information according to a preset request mapping relationship between the first platform and the second platform includes:
rewriting the request head according to the preset request head mapping relation;
rewriting the request content according to the preset request content mapping relation;
acquiring rewritten first data request information according to the rewritten request header and the rewritten request content;
the request header comprises an access token, and the step of rewriting the request header according to the preset request header mapping relation comprises the following steps: and modifying the access token in the request header into the access token of the corresponding platform based on the preset request header mapping relation.
2. The cross-platform data request method of claim 1, wherein the data request information further comprises second data request information for requesting first platform backend data, the method further comprising:
and directly forwarding the second data request information to the first platform backend to request the first platform backend data.
3. The cross-platform data request method of claim 2, the method further comprising:
receiving the first platform backend data returned by the first platform backend and the second platform backend data returned by the second platform backend;
and fusing the first platform back-end data and the second platform back-end data, and returning the fused data to the first platform front end.
4. The cross-platform data request method of claim 1, wherein prior to the obtaining the data request information sent by the first platform front end, the method comprises:
acquiring login request information sent by the front end of the first platform, wherein the login request information comprises account information and password information of a user;
and forwarding the login request information to the first platform and the second platform so as to log in the first platform and the second platform once according to the account information and the password information of the user.
5. The cross-platform data request method of claim 4, wherein the login request information includes a first platform login request information for requesting to login to the first platform and a second platform login request information for requesting to login to the second platform, and the step of forwarding the login request information to the first platform and the second platform so as to perform a login on the first platform and the second platform according to the account information and password information of the user comprises:
forwarding the first platform login request information to the first platform;
receiving a first platform login token returned by the first platform;
and forwarding the second platform login request information to the second platform;
receiving a second platform login token returned by the second platform according to a preset corresponding relation between the first platform login token and the second platform login token;
logging in the first platform and the second platform according to the first platform login token and the second platform login token.
6. An apparatus for cross-platform data request, the apparatus comprising:
the data request information acquisition module is used for acquiring data request information sent by a front end of a first platform, wherein the data request information comprises first data request information used for requesting data of a back end of a second platform, and the back end of the second platform is one or more;
the rewriting module is used for rewriting the first data request information according to a preset request mapping relation between the first platform and the second platform;
a first data request information sending module, configured to send the rewritten first data request information to the second platform backend to request the second platform backend data;
the preset request mapping relation comprises a preset request header mapping relation and a preset request content mapping relation, and the first data request information comprises a request header and request content; the rewrite module includes:
the first rewriting unit is used for rewriting the request head according to the preset request head mapping relation;
the second rewriting unit is used for rewriting the request content according to the preset request content mapping relation;
the third rewriting unit is used for obtaining the rewritten first data request information according to the rewritten request head and the rewritten request content;
the request head comprises an access token, and the first rewriting unit is further configured to modify the access token in the request head into an access token of a corresponding platform based on the preset request head mapping relationship.
7. A cross-platform data request system, comprising: a first platform front end, a first platform back end corresponding to the first platform front end, at least one second platform end, and the cross-platform data request device of claim 6.
8. An electronic device, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the cross-platform data request method according to any one of claims 1 to 5 when executing the computer program.
9. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps in the cross-platform data request method according to any one of claims 1 to 5.
CN201911375877.8A 2019-12-27 2019-12-27 Cross-platform data request method and device and electronic equipment Active CN113055348B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911375877.8A CN113055348B (en) 2019-12-27 2019-12-27 Cross-platform data request method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911375877.8A CN113055348B (en) 2019-12-27 2019-12-27 Cross-platform data request method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113055348A CN113055348A (en) 2021-06-29
CN113055348B true CN113055348B (en) 2022-11-22

Family

ID=76506462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911375877.8A Active CN113055348B (en) 2019-12-27 2019-12-27 Cross-platform data request method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113055348B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114513344B (en) * 2022-01-26 2024-05-24 鼎捷软件股份有限公司 Integration system and method between cloud applications
CN114928637A (en) * 2022-05-20 2022-08-19 南京一盏神灯网络信息科技有限公司 Cross-platform information acquisition method and system for improving user experience and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107566364A (en) * 2017-08-31 2018-01-09 天脉聚源(北京)科技有限公司 A kind of information-pushing method and device
CN108848154A (en) * 2018-06-08 2018-11-20 珠海市微半导体有限公司 A kind of method of mobile terminal Overpassing Platform by Using
US10303527B1 (en) * 2013-07-19 2019-05-28 Open Invention Network Llc Active directory attribute mapping
CN110049012A (en) * 2014-06-23 2019-07-23 华为技术有限公司 A kind of operating method of routing device, routing device and terminal device
CN110399231A (en) * 2019-06-13 2019-11-01 平安科技(深圳)有限公司 Based on cross-platform data processing method, device and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10303527B1 (en) * 2013-07-19 2019-05-28 Open Invention Network Llc Active directory attribute mapping
CN110049012A (en) * 2014-06-23 2019-07-23 华为技术有限公司 A kind of operating method of routing device, routing device and terminal device
CN107566364A (en) * 2017-08-31 2018-01-09 天脉聚源(北京)科技有限公司 A kind of information-pushing method and device
CN108848154A (en) * 2018-06-08 2018-11-20 珠海市微半导体有限公司 A kind of method of mobile terminal Overpassing Platform by Using
CN110399231A (en) * 2019-06-13 2019-11-01 平安科技(深圳)有限公司 Based on cross-platform data processing method, device and computer equipment

Also Published As

Publication number Publication date
CN113055348A (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN105847988B (en) Video sharing method and apparatus
CN109542427B (en) System customization method and device, electronic equipment and storage medium
TWI677225B (en) Instant messaging implementation method and device
CN110806934A (en) RPA technology-based intelligent all-in-one machine development and multi-service rapid processing method
CN104468592B (en) Login method and login system
CN109152094B (en) Wireless network connection method for terminal
US20140136937A1 (en) Providing and procuring worksheet functions through an online marketplace
CN104301443A (en) Method and system for calling end capacity ports on web page
CN110311989A (en) A kind of gray scale dissemination method, device, storage medium, equipment and system
CN113055348B (en) Cross-platform data request method and device and electronic equipment
CN108549586B (en) Information processing method and device
EP4113985A1 (en) Multimedia conference data processing method and apparatus, and electronic device
CN109274705A (en) Service providing method, apparatus and system based on user identity
CN104811485A (en) Resource sharing method
CN107517188A (en) A kind of data processing method and device based on Android system
CN109889468A (en) Transmission method, system, device, equipment and the storage medium of network data
CN108880923A (en) The method and apparatus that policer operation applied to application server is requested
CN112015383A (en) Login method and device
CN106411978A (en) Resource caching method and apparatus
US10530592B2 (en) Method and apparatus for sharing browser contents
CN106817296A (en) The method of testing of information recommendation, device and electronic equipment
CN110673970A (en) Cross-process calling system and method based on web application
CN110866196A (en) Printer network information acquisition method and device and electronic equipment
CN107526827A (en) Method, equipment and computer-readable recording medium for question and answer displaying
CN114417318A (en) Third-party page jumping 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
GR01 Patent grant
GR01 Patent grant