CN114237590A - Data request method, device, medium and electronic equipment - Google Patents

Data request method, device, medium and electronic equipment Download PDF

Info

Publication number
CN114237590A
CN114237590A CN202111563634.4A CN202111563634A CN114237590A CN 114237590 A CN114237590 A CN 114237590A CN 202111563634 A CN202111563634 A CN 202111563634A CN 114237590 A CN114237590 A CN 114237590A
Authority
CN
China
Prior art keywords
data
request
target address
analyzed
return
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111563634.4A
Other languages
Chinese (zh)
Inventor
吴永固
董力刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Securities Co Ltd
Original Assignee
Ping An Securities 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 Ping An Securities Co Ltd filed Critical Ping An Securities Co Ltd
Priority to CN202111563634.4A priority Critical patent/CN114237590A/en
Publication of CN114237590A publication Critical patent/CN114237590A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms

Landscapes

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

Abstract

The application belongs to the technical field of computers, and particularly relates to a data request method, a data request device, a computer readable medium and electronic equipment. The method comprises the following steps: establishing a communication channel with a FLUTER end, and acquiring data to be analyzed for requesting service, which is sent by the FLUTER end, through the communication channel; analyzing the data to be analyzed to obtain a target address and one or more content data; according to the request packaging format mapped by the content data, packaging the content data to obtain request data; sending the request data to the target address, and acquiring return data returned by the target address; and returning the return data to the flute terminal. The application can realize the request encapsulation of the implementation end and the sharing multiplexing between the request data receiving and sending functional module and the Flutter end, and avoids repeated realization of components and the same function at multiple sides, thereby improving the operation efficiency of the system.

Description

Data request method, device, medium and electronic equipment
Technical Field
The present application belongs to the field of computer technologies, and in particular, to a data request method, a data request apparatus, a computer-readable medium, and an electronic device.
Background
With the development of mobile internet technology and the popularization of intelligent mobile terminals, the importance of mobile internet in life is more and more obvious, and the development of Application programs (APP for short) of mobile terminals is more and more important. At present, most of APPs adopt a hybrid development mode, and the hybrid development mode is a development mode for making up for deficiencies, and relates to a cross-platform technical scheme for APP development. At the present stage, the evolution of the cross-platform technology is more than that of hundreds of families, the development of the cross-platform technology is greatly promoted by the aid of the schemes such as WebAPP, hybrid App, Cordova, Ionic and fact Native, and the development convenience of the APP is improved.
However, for an application developed in the hybrid development mode, the problem of low system operation efficiency and the like is caused by the duplication and incompatibility of the resource library in the hybrid development mode.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present application and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
The present application aims to provide a data request method, a data request device, a computer readable medium and an electronic device, which at least to some extent overcome the technical problem of how to improve the running efficiency of applications in the related art.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a data request method, including:
establishing a communication channel with a FLUTER end, and acquiring data to be analyzed for requesting service, which is sent by the FLUTER end, through the communication channel;
analyzing the data to be analyzed to obtain a target address and one or more content data;
according to the request packaging format mapped by the content data, packaging the content data to obtain request data;
sending the request data to the target address, and acquiring return data returned by the target address;
and returning the return data to the flute terminal.
According to an aspect of an embodiment of the present application, there is provided a data request apparatus including:
the data analysis device comprises a to-be-analyzed data acquisition module, a data analysis module and a data analysis module, wherein the to-be-analyzed data acquisition module is configured to establish a communication channel with the FLUTER terminal and acquire to-be-analyzed data of the FLUTER terminal through the communication channel;
the data analysis module is configured to analyze the data to be analyzed to obtain a target address and one or more content data;
the data packaging module is configured to package the content data according to the request packaging format mapped by the content data to obtain request data;
the data sending module is configured to send the request data to the target address and obtain return data returned by the target address;
and the data return module is configured to return the return data to the flute terminal.
In some embodiments of the present application, based on the above technical solutions, the to-be-analyzed data obtaining module includes:
a registration information obtaining unit, configured to obtain registration information of the flute terminal, where the registration information includes a communication address, a communication port, and a message format;
and the communication channel establishing unit is configured to establish one or more communication channels with the FLutter end according to the registration information.
In some embodiments of the present application, based on the above technical solutions, the to-be-analyzed data obtaining module includes:
and the communication channel monitoring unit is configured to monitor the communication channel and acquire the data to be analyzed, which is sent by the flute terminal, through the communication channel.
In some embodiments of the present application, based on the above technical solutions, the data encapsulation module includes:
a request encapsulation format obtaining unit, configured to query a preset database according to the data type of the content data to obtain a request encapsulation format mapped by the data type, where the preset database includes a mapping relationship between the data type and the request encapsulation format;
and the request data acquisition unit is configured to package the content data according to the request package format to obtain the request data.
In some embodiments of the present application, based on the above technical solutions, the data returning module includes:
and the return data caching unit is configured to cache the return data if the number of times of the combination of the request data and the target address appearing in the history data is greater than a preset number of times.
In some embodiments of the present application, based on the above technical solutions, the data sending module includes:
and the return data reading unit is configured to read the locally cached return data corresponding to the combination of the request data and the target address if the number of times of the combination of the request data and the target address appearing in the history data is greater than the preset number of times.
In some embodiments of the present application, based on the above technical solutions, the data parsing module includes:
when the data to be analyzed cannot be analyzed to obtain the target address or the content data, returning a first error prompt to the flute end, wherein the first error prompt is used for prompting that the data to be analyzed fails to be analyzed;
in some embodiments of the present application, based on the above technical solutions, the data encapsulation module includes:
and when the content data does not have the corresponding mapped request packaging format, returning a second error prompt to the flute end, wherein the second error prompt is used for prompting that the data to be analyzed does not have the corresponding request packaging format.
In some embodiments of the present application, based on the above technical solutions, the data sending module includes:
and the no-response prompting unit is configured to return a third error prompt to the flute terminal when the target address has no response after the request data is sent to the target address, wherein the third error prompt is used for prompting that the target address has no response.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: a processor; and a memory for storing executable instructions for the processor; wherein the processor is configured to perform the data request method as in the above technical solution via executing the executable instructions.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data request method in the technical scheme.
In the technical scheme provided by the embodiment of the application, a communication channel with a FLUTER end is established, and data to be analyzed for requesting service, which is sent by the FLUTER end, is acquired through the communication channel; analyzing the data to be analyzed to obtain a target address and one or more content data; according to the request packaging format mapped by the content data, packaging the content data to obtain request data; sending the request data to a target address, and acquiring return data returned by the target address; and returning the return data to the FLutter end. Therefore, the request encapsulation of the implementation end and the sharing multiplexing between the request data transceiving functional module and the flute end can be realized, the repeated realization of components and the same function at multiple sides is avoided, the problems of the repetition and the incompatibility of a resource library in a hybrid development mode are solved, and the operating efficiency of a system can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 schematically illustrates a system architecture diagram of a data request method according to some embodiments of the present application.
FIG. 2 schematically illustrates a flow chart of steps of a data request method of some embodiments of the present application.
Fig. 3 is a flowchart schematically illustrating steps of establishing a communication channel with the router end in an embodiment of the present application.
Fig. 4 schematically shows an interaction flow diagram of the Flutter end and the middlebox according to an embodiment of the present application.
Fig. 5 schematically shows a flowchart of a step of performing a packaging process on content data according to a request packaging format mapped by the content data to obtain request data in an embodiment of the present application.
Fig. 6 schematically shows a block diagram of a data request apparatus according to an embodiment of the present application.
Fig. 7 schematically shows a structural schematic diagram of an electronic device provided in an embodiment of the present application.
Fig. 8 schematically shows a composition diagram of a program product provided by an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 schematically illustrates a system architecture diagram of a data request method according to some embodiments of the present application. As shown in fig. 1, the system architecture includes a personal computer 110, a server 120 and a database 130, and the personal computer 110 and the server 120 and the database 130 are connected via communication links, which can be used to send or receive data. The first component on the personal computer 110 or on the server 120 may be an implementation terminal in this embodiment, and the personal computer further includes a Flutter terminal. When a data request method provided by the present disclosure is applied to the system architecture shown in fig. 1, one procedure may be as follows: firstly, a first component establishes a communication channel with a FLUTER terminal, and acquires data to be analyzed sent by the FLUTER terminal through the communication channel; then, the first component analyzes the data to be analyzed to obtain a target address and one or more content data; next, the first component packages the content data according to the request package format mapped by the content data to obtain request data; then, the first component sends the request data to the target address and obtains return data returned by the target address; and finally, the first component returns the return data to the FLutter end.
The flute end is an application end developed under the mobile application development framework flute launched and sourced by Google. FLutter has advantages such as high performance, cross-platform, hot heavy load as emerging mobile development frame. But also have some disadvantages, such as: if the FLutter application terminal and the Native application terminal are developed and used in a mixed manner, the resource service and the matching function service are repeated. The Native application end is based on a local operating system of the smart phone, such as iOS, Android and WP, and uses Native programs to write and run application programs.
The data request method based on the embodiment of the application can realize request encapsulation of the implementation end and sharing multiplexing between the request data transceiving functional module and the Flutter end, can avoid repeated realization of components and the same function at multiple sides, solves the problems of repetition and incompatibility of a resource library in a hybrid development mode, and can improve the operation efficiency of a system.
In one embodiment, the first component may be a central station, a transceiver module, a transceiver service unit, or the like. The method is performed by taking a middle stage as an example in the embodiments of the specification.
It is worth mentioning that fig. 1 is only one embodiment of the present disclosure. Although the implementation terminal in this embodiment is the first component located on the personal computer 110 or located on the server 120, in other embodiments, the implementation terminal may be various terminals or devices as previously described. The present disclosure is not intended to be limited thereby, nor should the scope of the present disclosure be limited thereby.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
The data request method provided by the present application is described in detail below with reference to specific embodiments.
FIG. 2 schematically illustrates a flow chart of steps of a data request method of some embodiments of the present application. The execution main body of the data request method may be a terminal device, a server, or the like, and the application is not limited to this. As shown in fig. 2, the data requesting method may mainly include the following steps S210 to S250.
S210, establishing a communication channel with the FLUTER end, and acquiring data to be analyzed for requesting service, which is sent by the FLUTER end, through the communication channel.
The data to be parsed may be used to request services. Specifically, the request service may include requesting data, requesting a method call, requesting authorization, and the like, which is not limited in this application.
In particular, one or more channels may be established with the FLutter end. For example, one or more of a method call transport channel (MethodChannel) for passing method calls, a data stream transport channel (EventChannel) for communicating data streams (event streams), and a basic information transport channel (BasicMessageChannel) for transporting strings and semi-structured information may be established with the FLutter side.
In a specific embodiment, two channels, namely a MethodChannel and an EventChannel, can be established at the FLutter end to realize the basic communication between the FLutter and the middlebox. After the channel is built, the Flutter and the middle station can realize two-way communication.
In a specific embodiment, the middle platform can be a middle platform built based on an Android/IOS framework, it can be understood that services supported by an Android/IOS end are more mature and stronger, and a Flutter end can share data services of the Android/IOS middle platform in the application, so that the data processing function of the Flutter is greatly improved.
In a specific embodiment, the middle platform can be a middle platform built based on a Native architecture.
On the basis of the above embodiments, in some embodiments, the obtaining, through the communication channel, the data to be parsed, sent by the router end for requesting the service in step S210, may further include the following steps:
monitoring a communication channel, and acquiring data to be analyzed sent by the flute end through the communication channel.
Therefore, the middle station can acquire the data to be analyzed sent by the FLUTTER end in real time through the communication channel, and real-time data exchange between the middle station and the FLUTTER end is achieved.
Fig. 3 is a flowchart schematically illustrating steps of establishing a communication channel with the router end in an embodiment of the present application. As shown in fig. 3, on the basis of the above embodiment, the establishing of the communication channel with the router end in step S210 may further include the following steps S310 to S320.
S310, acquiring registration information of the FLUtter end, wherein the registration information comprises a communication address, a communication port and a message format;
and S320, establishing one or more communication channels with the FLUTER terminal according to the registration information.
Therefore, the registration information of the FLUTTER end is obtained, and one or more communication channels with the FLUTTER end are established according to the registration information, so that the two-way communication basis of the middle station and the FLUTTER end can be established.
Specifically, a first list of all data to be parsed, which needs to be supported by the application running of the FLutter end, may be registered in the middle station according to the registration information, and the first list may be mapped to a second list of a request encapsulation format local to the middle station, so as to complete the registration of the FLutter end in the middle station. .
In some embodiments, if the data to be parsed is a method call, the request encapsulation format local to the middle station is a locally executable method call format. And if the data to be analyzed is a data request, the local request packaging format of the middle station is a local executable data request format. And if the data to be analyzed is the data to be packaged, the local request packaging format of the middle station is the corresponding packaging format.
S220, analyzing the data to be analyzed to obtain a target address and one or more content data.
In some embodiments, on the basis of the above embodiments, the parsing the data to be parsed in step S220 to obtain the target address and one or more content data may further include the following steps:
when the data to be analyzed cannot be analyzed to obtain the target address or the content data, returning a first error prompt to the flute end, wherein the first error prompt is used for prompting that the data to be analyzed fails to be analyzed;
fig. 4 schematically shows an interaction flow diagram of the Flutter end and the middlebox according to an embodiment of the present application. As shown in fig. 4, after initializing the Flutter end, one or more communication channels with the Flutter end may be established according to the registration information, and then the middle station monitors the channel information and acquires the data to be analyzed sent by the Flutter end to respond to the data to be analyzed sent by the Flutter end. And when the middle station service does not respond, sending an error prompt to the Flutter end, and continuously monitoring channel information. Specifically, the error prompt may include a first error prompt, a second error prompt, or a third error prompt, which respectively correspond to different situations in which the middlebox service does not respond.
When the system is in normal operation, the middlebox can respond to the data to be analyzed sent by the Flutter terminal, and specifically, the response of the middlebox service can include a basic encapsulation service and a customized encapsulation service. In the basic packaging service, the request packaging format mapped according to the content data is a fixed type request packaging format. In the customized packaging service, the request packaging format mapped according to the content data is a request packaging format of a custom type. Therefore, the requirement of diversified data requests of the Flutter end can be met.
Therefore, the Android/IOS middle platform can provide basic data request service for the application of the Flutter end, and the Flutter application can quickly realize the data request function without a data request module. Therefore, the Android/IOS data request module is shared, repeated assembly and repeated realization of the same function on multiple sides are avoided, and the system operation efficiency can be improved. Moreover, the conflict caused by the fact that the same service library component of the FLUTTER end and the middle station is repeated can be avoided, and therefore the influence on the stability of the system can be avoided.
In one embodiment, when network data, database data, cache data and the like are required for realizing a Flutter service function, the middle station customizing service can integrate the data into service data and return the service data to the Flutter application at one time, so that the information interaction speed between the Flutter end and the middle station is higher, the application interface refreshing effect is better, and the user experience of the application can be improved.
And S230, according to the request packaging format mapped by the content data, packaging the content data to obtain the request data.
In some embodiments, on the basis of the above embodiments, the encapsulating the content data according to the request encapsulation format mapped by the content data in step S230 to obtain the request data may further include the following steps:
and when the content data does not have the corresponding mapped request packaging format, returning a second error prompt to the flute end, wherein the second error prompt is used for prompting that the data to be analyzed does not have the corresponding request packaging format.
Therefore, the data to be analyzed sent by the FLUTTER end can be timely prompted to have no corresponding request packaging format when the data to be analyzed is wrong, the response of the middle platform fails, and the responsiveness to the FLUTTER end can be improved.
Fig. 5 schematically shows a flowchart of a step of performing a packaging process on content data according to a request packaging format mapped by the content data to obtain request data in an embodiment of the present application. As shown in fig. 5, based on the above embodiment, the step S230 of encapsulating the content data according to the request encapsulation format mapped by the content data to obtain the request data may further include the following steps S510 to S520.
S510, inquiring a preset database according to the data type of the content data to obtain a request packaging format mapped by the data type, wherein the preset database comprises a mapping relation between the data type and the request packaging format;
s520, packaging the content data according to the request packaging format to obtain the request data.
Therefore, sharing multiplexing between the request encapsulation function module of the implementation end and the Flutter end can be achieved, repeated assembly and repeated realization of the same function on multiple sides are avoided, and accordingly system operation efficiency can be improved.
S240, the request data is sent to the target address, and the return data returned by the target address is obtained.
As shown in fig. 4, after the content data is encapsulated by the middle station and the request data is obtained, the request data is sent to the destination address to obtain the return data returned by the destination address.
In some embodiments, on the basis of the above embodiments, the sending the request data to the target address and acquiring the return data returned by the target address in step S240 may further include the following steps:
after the request data is sent to the target address, when the target address does not respond, a third error prompt is returned to the FLutter end, and the third error prompt is used for prompting that the target address does not respond.
Therefore, when the target address is not responded, the situation that the target address of the FLUTTER end is not responded can be prompted in time, the responsiveness of the FLUTTER end can be improved, and the subsequent coping operation can be conveniently made according to the third error prompt of the FLUTTER end.
And S250, returning the return data to the FLUTER terminal.
Referring to fig. 4, the middle station returns the return data returned by the target address to the router.
In some embodiments, on the basis of the above embodiments, the returning the return data to the FLutter end in step S250 includes:
and if the times of the combination of the request data and the target address appearing in the historical data are more than the preset times, caching the returned data.
Therefore, the returned data of the group of the requested data and the target address with the historical data occurrence times larger than the preset times can be cached, so that the middle station can call the cached data to realize quick data return when the same request data of the same target address is requested by the subsequent FLUtter end for multiple times.
In some embodiments, returning the return data to the FLutter end in step S250 may include:
the return data is cached, and the historical return data with the storage time exceeding the first time limit is cleaned.
Therefore, returned data with relatively short time can be cached, so that the middle station can call the cached data to realize quick data return when the subsequent FLUtter terminal requests the same request data of the same target address for multiple times.
In some embodiments, on the basis of the above embodiments, the sending the request data to the target address and acquiring the return data returned by the target address in step S240 may further include the following steps:
and if the times of the combination of the request data and the target address appearing in the historical data are more than the preset times, reading the returned data which is locally cached and corresponds to the combination of the request data and the target address.
Therefore, when the number of times of the combination of the request data and the target address appearing in the historical data is larger than the preset number of times, the return data corresponding to the combination of the request data and the target address in the local cache is read, and when the FLutter terminal requests the same request data of the same target address for multiple times, the middle station can realize quick return of the data through early-stage cache.
In a specific embodiment, if the number of times of occurrence of the history data in the combination of the request data and the target address within the preset time range is greater than the preset number of times, the return data corresponding to the combination of the request data and the target address in the local cache may be read. Specifically, the preset time range may be 30s, 1 minute, 10 minutes, 20 minutes, or the like.
It can be understood that the number of times of occurrence of the combination of the request data and the target address in the history data within the preset time range is greater than the preset number of times, which indicates that the data requested by the FLutter end has been requested for multiple times within the preset time range, and at this time, the return data corresponding to the combination of the request data and the target address in the local cache is read, so that the data can be quickly returned through the early-stage cache.
It can be understood that, in the related art, repetition and incompatibility of resource libraries in the hybrid development mode may cause problems of component repetition, repeated implementation of the same function on multiple sides, and the like, and repeated implementation of the same function on multiple sides makes functional services of applications redundant or conflict, thereby bringing problems of low operating efficiency of the system and low application development efficiency.
In summary, based on the data request method of the embodiment of the present application, request encapsulation at the implementation end and sharing multiplexing between the request data transceiving function module and the Flutter end can be achieved, repeated assembly and repeated implementation of the same function at multiple sides can be avoided, system function modules can be simplified, the problem that a resource library under a hybrid development mode is repeated and cannot be compatible is solved, and therefore system operation efficiency and application development efficiency can be improved.
It should be noted that although the various steps of the methods in this application are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the shown steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
According to a third aspect of the present disclosure, embodiments of the apparatus of the present application are introduced below, which may be used to perform the data request method in the above-described embodiments of the present application. Fig. 6 schematically shows a block diagram of a data request apparatus according to an embodiment of the present application. As shown in fig. 6, the data request apparatus 600 includes:
the data to be analyzed acquisition module 610 is configured to establish a communication channel with the FLutter end, and acquire data to be analyzed of the FLutter end through the communication channel;
a data parsing module 620 configured to parse data to be parsed to obtain a target address and one or more content data;
a data encapsulation module 630, configured to encapsulate the content data according to the request encapsulation format mapped by the content data, so as to obtain the request data;
the data sending module 640 is configured to send the request data to the target address and obtain return data returned by the target address;
and the data returning module 650 is configured to return the returned data to the FLutter side.
In some embodiments of the present application, based on the above embodiments, the to-be-analyzed data obtaining module includes:
the registration information acquisition unit is configured to acquire registration information of the FLUTER terminal, wherein the registration information comprises a communication address, a communication port and a message format;
and the communication channel establishing unit is configured to establish one or more communication channels with the FLutter end according to the registration information.
In some embodiments of the present application, based on the above embodiments, the to-be-analyzed data obtaining module includes:
and the communication channel monitoring unit is configured to monitor the communication channel and acquire the data to be analyzed, which is sent by the FLutter end and used for requesting the service, through the communication channel.
In some embodiments of the present application, based on the above embodiments, the data encapsulation module includes:
the request packaging format acquiring unit is configured to query a preset database according to the data type of the content data to obtain a request packaging format mapped by the data type, wherein the preset database comprises a mapping relation between the data type and the request packaging format;
and the request data acquisition unit is configured to package the content data according to the request package format to obtain the request data.
In some embodiments of the present application, based on the above embodiments, the data return module includes:
and the return data caching unit is configured to cache the return data if the number of times of the combination of the request data and the target address appearing in the historical data is greater than a preset number of times.
In some embodiments of the present application, based on the above embodiments, the data sending module includes:
and the return data reading unit is configured to read the locally cached return data corresponding to the combination of the request data and the target address if the number of times of the combination of the request data and the target address appearing in the history data is greater than a preset number of times.
In some embodiments of the present application, based on the above embodiments, the data parsing module includes:
when the data to be analyzed cannot be analyzed to obtain the target address or the content data, returning a first error prompt to the flute end, wherein the first error prompt is used for prompting that the data to be analyzed fails to be analyzed;
in some embodiments of the present application, based on the above embodiments, the data encapsulation module includes:
and when the content data does not have the corresponding mapped request packaging format, returning a second error prompt to the flute end, wherein the second error prompt is used for prompting that the data to be analyzed does not have the corresponding request packaging format.
In some embodiments of the present application, based on the above embodiments, the data sending module includes:
and the non-response prompting unit is configured to return a third error prompt to the FLutter end when the target address has no response after the request data is sent to the target address, wherein the third error prompt is used for prompting the target address to have no response.
The specific details of the data request device provided in each embodiment of the present application have been described in detail in the corresponding method embodiment, and are not described herein again.
According to a third aspect of the present disclosure, there is also provided an electronic device capable of implementing the above method.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
The electronic device may include a processor and a memory. The memory is used for storing executable instructions of the processor. The processor is configured to perform the data request method as in the above solution via executing the executable instructions.
An electronic device 700 according to this embodiment of the invention is described below with reference to fig. 7. Fig. 7 schematically shows a structural schematic diagram of an electronic device provided in an embodiment of the present application. The electronic device 700 shown in fig. 7 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, electronic device 700 is embodied in the form of a general purpose computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one memory unit 720, and a bus 730 that couples various system components including the memory unit 720 and the processing unit 710.
Wherein the storage unit stores program code that can be executed by the processing unit 710 such that the processing unit 710 performs the steps according to various exemplary embodiments of the present invention described in the section "example methods" above in this specification.
The storage unit 720 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)721 and/or a cache memory unit 722, and may further include a read only memory unit (ROM) 723.
The memory unit 720 may also include programs/utilities 724 having a set (at least one) of program modules 725, such program modules 725 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 730 may be any representation of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 700, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 700 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 750, such as with display unit 740. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 760. As shown, the network adapter 760 communicates with the other modules of the electronic device 700 via the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
According to a fourth aspect of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-mentioned method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
The computer program product or computer program comprises computer instructions, which are stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data request method in the technical scheme.
Fig. 8 schematically shows a composition diagram of a program product provided by an embodiment of the present application. Referring to fig. 8, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method of data request, the method comprising:
establishing a communication channel with a FLUTER end, and acquiring data to be analyzed for requesting service, which is sent by the FLUTER end, through the communication channel;
analyzing the data to be analyzed to obtain a target address and one or more content data;
according to the request packaging format mapped by the content data, packaging the content data to obtain request data;
sending the request data to the target address, and acquiring return data returned by the target address;
and returning the return data to the flute terminal.
2. The data request method of claim 1, wherein the establishing a communication channel with the flute end comprises:
acquiring registration information of the flute end, wherein the registration information comprises a communication address, a communication port and a message format;
and establishing one or more communication channels with the flute end according to the registration information.
3. The data request method according to claim 1, wherein the obtaining of the data to be parsed, which is sent by the FLutter side and used for requesting a service, through the communication channel comprises:
and monitoring the communication channel, and acquiring the data to be analyzed sent by the flute end through the communication channel.
4. The data request method according to claim 1, wherein the encapsulating the content data according to the request encapsulation format mapped by the content data to obtain the request data comprises:
inquiring a preset database according to the data type of the content data to obtain a request packaging format mapped by the data type, wherein the preset database comprises a mapping relation between the data type and the request packaging format;
and packaging the content data according to the request packaging format to obtain the request data.
5. The data request method according to claim 1, wherein the returning the return data to the flute terminal comprises:
if the times of the combination of the request data and the target address appearing in the historical data are larger than the preset times, caching the return data;
the sending the request data to the target address and acquiring the return data returned by the target address includes:
and if the times of the combination of the request data and the target address appearing in the historical data are larger than the preset times, reading the locally cached return data corresponding to the combination of the request data and the target address.
6. The data request method according to claim 1, wherein the parsing the data to be parsed to obtain a target address and one or more content data includes:
when the data to be analyzed cannot be analyzed to obtain the target address or the content data, returning a first error prompt to the flute end, wherein the first error prompt is used for prompting that the data to be analyzed fails to be analyzed;
the encapsulating the content data according to the request encapsulation format mapped by the content data to obtain the request data includes:
and when the content data does not have the corresponding mapped request packaging format, returning a second error prompt to the flute end, wherein the second error prompt is used for prompting that the data to be analyzed does not have the corresponding request packaging format.
7. The data request method according to claim 1, wherein the sending the request data to the target address and obtaining the return data returned by the target address comprises:
after the request data is sent to the target address, when the target address does not respond, returning a third error prompt to the flute end, wherein the third error prompt is used for prompting that the target address does not respond.
8. A data request apparatus, comprising:
the data analysis device comprises a to-be-analyzed data acquisition module, a data analysis module and a data analysis module, wherein the to-be-analyzed data acquisition module is configured to establish a communication channel with the FLUTER terminal and acquire to-be-analyzed data of the FLUTER terminal through the communication channel;
the data analysis module is configured to analyze the data to be analyzed to obtain a target address and one or more content data;
the data packaging module is configured to package the content data according to the request packaging format mapped by the content data to obtain request data;
the data sending module is configured to send the request data to the target address and obtain return data returned by the target address;
and the data return module is configured to return the return data to the flute terminal.
9. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the data request method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data request method of any one of claims 1 to 7 via execution of the executable instructions.
CN202111563634.4A 2021-12-20 2021-12-20 Data request method, device, medium and electronic equipment Pending CN114237590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111563634.4A CN114237590A (en) 2021-12-20 2021-12-20 Data request method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111563634.4A CN114237590A (en) 2021-12-20 2021-12-20 Data request method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114237590A true CN114237590A (en) 2022-03-25

Family

ID=80759570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111563634.4A Pending CN114237590A (en) 2021-12-20 2021-12-20 Data request method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114237590A (en)

Similar Documents

Publication Publication Date Title
CN112087454B (en) Communication method, device, equipment and storage medium of Internet of things gateway equipment
CN111818136B (en) Data processing method, device, electronic equipment and computer readable medium
CN110457143B (en) Micro-service calling method and device
CN109714332B (en) Protocol conversion method and device based on Thrift and syntax tree analysis
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN104298591A (en) WebApp remote debugging method and system
CN102214099B (en) Automatic run-time environment (RTE) code generating method for automobile system architecture (AUTOSAR)
CN112783748B (en) Program debugging method, device, equipment and computer readable storage medium
US20230086783A1 (en) Gateway configuration language for use in api environments
CN112511591A (en) Method, device, equipment and medium for realizing hospital interface data interaction
CN112395098B (en) Application program interface calling method and device, storage medium and electronic equipment
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN114064091A (en) OTA (over the air) upgrade control method and device, electronic equipment and automatic driving vehicle
CN112152879A (en) Network quality determination method and device, electronic equipment and readable storage medium
CN114237590A (en) Data request method, device, medium and electronic equipment
CN112099957B (en) Resource allocation method, system, device and electronic equipment
US11797277B2 (en) Neural network model conversion method server, and storage medium
CN110548285B (en) Game communication control method and device, medium and electronic equipment
CN114595080A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN113992641A (en) Data processing method, device, equipment and storage medium
CN114615521B (en) Video processing method and device, computer readable storage medium and electronic equipment
CN112688863B (en) Gateway data processing method and device and electronic equipment
CN113542412B (en) Data transmission method, device, electronic equipment and storage medium
CN112311833B (en) Data updating method and device
CN112769975B (en) Data integration method and device, server and storage medium

Legal Events

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