CN111092877B - Data processing method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN111092877B
CN111092877B CN201911275719.5A CN201911275719A CN111092877B CN 111092877 B CN111092877 B CN 111092877B CN 201911275719 A CN201911275719 A CN 201911275719A CN 111092877 B CN111092877 B CN 111092877B
Authority
CN
China
Prior art keywords
data
service
target service
request
template
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
CN201911275719.5A
Other languages
Chinese (zh)
Other versions
CN111092877A (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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201911275719.5A priority Critical patent/CN111092877B/en
Publication of CN111092877A publication Critical patent/CN111092877A/en
Application granted granted Critical
Publication of CN111092877B publication Critical patent/CN111092877B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The data processing method, the data processing device, the electronic equipment and the storage medium provided by the embodiment of the application can receive a data request with a specified format, wherein the data request comprises a plurality of target service parameters; analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter; receiving service data sent by each service interface based on the target service parameters; and summarizing the service data of each service interface according to a preset data template to obtain data to be output. Therefore, the request data corresponding to the plurality of interfaces can be acquired through the single request information, so that the data communication connection is reduced, and the network communication efficiency is improved.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of information technologies, and in particular, to a data processing method and apparatus, an electronic device, and a storage medium.
Background
At present, for applications used by terminal devices such as a mobile phone terminal and a computer terminal, for example, applications of software and web pages of a mobile phone application and a computer, in order to reduce the data volume of the software, it is generally necessary to contact and request data from a backend service interface through the terminal device, and calculate or display the received data.
However, in the development process of the application, the data interfaces of the applications developed by different teams or different periods are different. Therefore, when the terminal device needs to request data of a plurality of different interfaces from the back-end server at the same time, multiple data communication connections and multiple data packet transmissions may be caused, thereby reducing the data communication efficiency of the network and the terminal.
Disclosure of Invention
An object of the embodiments of the present application is to provide a data processing method, an apparatus, an electronic device, and a storage medium, so as to reduce data communication connections and improve network communication efficiency. The specific technical scheme is as follows:
in a first aspect, the present application provides a data processing method, where the data processing method is applied to a server side, and includes:
receiving a data request in a specified format, wherein the data request comprises a plurality of target service parameters;
analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter;
receiving service data sent by each service interface based on the target service parameters;
and summarizing the service data of each service interface according to a preset data template to obtain data to be output.
Optionally, after summarizing the return data of the request corresponding to each interface to obtain the data to be output, the method further includes:
and caching the data to be output and outputting the data to be output.
Optionally, before receiving service data sent by each service interface based on the target service parameter, the method further includes:
judging whether a data template of the data request is the same as a preset data template and a target service parameter corresponding to the data request is the same as a pre-stored target service parameter or not;
receiving service data sent by each service interface based on the target service parameters, wherein the receiving comprises the following steps:
and when the data template of the data request is judged to be the same as the preset data template and the target service parameter corresponding to the data request is judged to be the same as the target service parameter, receiving the service data sent by each service interface based on the target service parameter.
Optionally, the method further includes:
if the data template of the data request is judged to be the same as the preset data template and the target service parameters corresponding to the data request are judged to be the same as the target service parameters, service data corresponding to all the pre-stored target service parameters are obtained from a local cache;
and summarizing the service data corresponding to all the acquired target service parameters according to a preset data template to obtain data to be output.
Optionally, receiving service data sent by each service interface based on the target service parameter includes:
and calling each service interface in the preset task pool, and receiving service data sent by each service interface based on the target service parameters.
Optionally, analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter, including:
analyzing the data request according to a preset data template to obtain a plurality of target service parameters;
and determining a service interface corresponding to each target service parameter according to the preset parameter interface relationship.
In a second aspect, the present application provides a data processing method, where the data processing method is applied to a client, and includes:
acquiring a plurality of target service parameters, wherein the target service parameters correspond to the service interfaces and are used for indicating acquisition of corresponding service data;
processing the target service parameters according to a preset data template to obtain a data request with a specified format;
sending a data request with a specified format to a server so that the server acquires service data corresponding to each target service parameter according to each target service parameter, and summarizing all the service data according to a preset data template to generate data to be output;
and receiving data to be output, which is sent by the server.
In a third aspect, the present application provides a data processing apparatus, applied to a server side, including:
the request receiving module is used for receiving a data request with a specified format, and the data request comprises a plurality of target service parameters;
the request analysis module is used for analyzing the data request through a preset data template so as to determine a service interface corresponding to each target service parameter;
the data acquisition module is used for receiving the service data sent by each service interface based on the target service parameters;
and the data summarizing module is used for summarizing the service data of each service interface according to a preset data template to obtain the data to be output.
Optionally, the apparatus further comprises:
and the data caching module is used for caching the data to be output and outputting the data to be output.
Optionally, the apparatus further comprises:
the same judging module is used for judging whether the data template of the data request is the same as the preset data template and whether the target service parameter corresponding to the data request is the same as the pre-stored target service parameter or not;
a data acquisition module comprising:
and the result output module is used for receiving the service data sent by each service interface based on the target service parameters when the data template of the data request is judged to be the same as the preset data template and the target service parameters corresponding to the data request are judged to be different from the target service parameters.
Optionally, the apparatus further comprises:
the cache acquisition module is used for acquiring service data corresponding to each pre-stored target service parameter from a local cache if the data template of the data request is judged to be the same as the preset data template and the target service parameters corresponding to the data request are judged to be the same as the target service parameters;
and the data summarizing module is used for summarizing the acquired service data corresponding to all the target service parameters according to a preset data template to obtain data to be output.
Optionally, the data obtaining module includes:
and the interface calling submodule is used for calling each service interface in the preset task pool and receiving the service data sent by each service interface based on the target service parameters.
Optionally, the request parsing module includes:
the target service submodule is used for analyzing the data request according to a preset data template to obtain a plurality of target service parameters;
and the interface determining submodule is used for determining a service interface corresponding to each target service parameter according to the preset parameter interface relationship.
In a fourth aspect, the present application provides a data processing apparatus, where the data processing apparatus is applied to a client, and includes:
the parameter acquisition module is used for acquiring a plurality of target service parameters, and the target service parameters correspond to the service interfaces and are used for indicating to acquire corresponding service data;
the request generation module is used for processing the target service parameters according to a preset data template to obtain a data request with a specified format;
the request sending module is used for sending the data request with the specified format to the server so that the server can obtain the service data corresponding to each target service parameter according to each target service parameter and collect all the service data according to a preset data template to generate data to be output;
and the data receiving module is used for receiving the data to be output, which is sent by the server.
According to a fifth aspect of embodiments herein, there is provided an electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the instructions to implement any of the above data processing methods applied to the server side.
According to a sixth aspect of embodiments of the present application, there is provided an electronic apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the instructions to implement any of the above data processing methods applied to the client.
According to a seventh aspect of embodiments of the present application, there is provided a storage medium,
the instructions in the storage medium, when executed by a processor of the electronic device, enable the electronic device to perform any of the above-described data processing methods applied to the server side.
According to an eighth aspect of embodiments of the present application, there is provided a storage medium,
the instructions in the storage medium, when executed by a processor of the electronic device, enable the electronic device to perform any of the above-described data processing methods applied to the client.
The data processing method, the data processing device, the electronic equipment and the storage medium provided by the embodiment of the application can receive a data request with a specified format, wherein the data request comprises a plurality of target service parameters; analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter; receiving service data sent by each service interface based on the target service parameters; and summarizing the service data of each service interface according to a preset data template to obtain data to be output. Therefore, the request data corresponding to the plurality of interfaces can be acquired through the single request information, so that the data communication connection is reduced, and the network communication efficiency is improved. Of course, it is not necessary for any product or method of the present application to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present application 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 application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a data processing method according to an embodiment of the present application.
Fig. 2 is a diagram illustrating an example of a data processing method according to an embodiment of the present application.
Fig. 3 is a flowchart of acquiring pre-stored data according to an embodiment of the present application.
Fig. 4 is a diagram of another example of a data processing method according to an embodiment of the present application.
Fig. 5 is another flowchart of a data processing method according to an embodiment of the present application.
Fig. 6 is a flowchart of a data processing method applied to a client according to an embodiment of the present application.
Fig. 7 is a block diagram of a data processing apparatus according to an embodiment of the present application.
Fig. 8 is a schematic diagram of a data processing apparatus applied to a client according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of another electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
In order to reduce data communication connections and improve network communication efficiency, embodiments of the present application provide a data processing method, an apparatus, an electronic device, and a storage medium, which are described in detail below.
First, terms of art in the embodiments of the present application are explained:
spring Expression: and (3) assigning values to the object for an expression analysis language in a Spring framework and supporting dynamic analysis of the expression during operation.
Fig. 1 is a flowchart of a data processing method according to an embodiment of the present application, and as shown in fig. 1, the data processing method, which is applied to a server side, includes the following steps:
in step S11, a data request in a specified format is received, the data request including a plurality of target business parameters.
The data request may be a data request sent to a backend server by an intelligent terminal such as computer software or mobile phone software (APP) of a mobile phone, and the intelligent terminal may access or obtain corresponding data by the data request. The data request may include data corresponding to a plurality of data interfaces, and the specified format may be any one of pre-specified data formats, which is not limited in this application.
The data processing method of the embodiment of the application is applied to the server side, and therefore can be executed through the server.
In step S12, the data request is parsed by a preset data template to determine the service interface corresponding to each target service parameter.
The data template may be a Spring Expression template. Since the data request may include data corresponding to a plurality of data interfaces, the target service parameters (corresponding to the service interfaces) corresponding to the service interfaces may be obtained by analyzing the data request through the preset template. In some embodiments, this step may be implemented as: and analyzing the data request according to a preset data template to obtain a plurality of target service parameters, and further determining a service interface corresponding to each target service parameter according to a preset parameter interface relationship.
The data request is analyzed through the preset data template to obtain the request corresponding to each interface, and the data request can be analyzed through the preset task pool through the preset data template to determine the service interface corresponding to each target service parameter.
In step S13, the service data sent by each service interface based on the target service parameter is received.
For example, load scheduling may be performed through a preset task pool to call each service interface, and receive service data sent by each service interface based on the target service parameter. The service data sent by each service interface based on the target service parameter is received, and each service interface can be intelligently scheduled through the task pool based on the corresponding request of each interface, so that the service data sent by each service interface based on the target service parameter is obtained.
Fig. 2 is a diagram illustrating an example of a data processing method according to an embodiment of the present application. In fig. 2, after receiving a data request sent by a client through a server, a Spring Expression template of the server is used for parsing, and then a task pool is used to call a service interface corresponding to a target service parameter obtained after parsing, so that each service interface executes a service operation corresponding to the target service parameter.
In step S14, the service data of each service interface is summarized according to a preset data template, so as to obtain data to be output.
The service data corresponding to each service interface is summarized according to a preset data template, the service data can be summarized by using a task pool, and the summarized service data is returned to the client according to a certain specification.
As shown in fig. 2, after the service interface completes the relevant service operation, the corresponding service data is returned. After receiving the service data returned by each service interface, the server may further process the data according to a preset data template (Spring Expression template) to generate data to be output. On one hand, the data to be output includes all the service data corresponding to the target service parameter, and on the other hand, in order for the client to "understand" and accurately utilize the service data, the data to be output must be obtained by processing all the service data through a preset data template.
Therefore, when the client sends a data request to the server, only one parameter which can meet all the required service interfaces needs to be transmitted. The server can analyze the data request through a Spring Expression template to obtain parameters of a corresponding service interface in the data request, and map the parameters after the terminal request is analyzed to an independent task, wherein the task is a service interface required by the client. And the service interface performs service processing after receiving the request data and sends the processed task data to the server. And the server takes all the task data, arranges the task data, and returns the task data to the client. Therefore, the problem of flooding of service interfaces during data request can be avoided, and the network delay is extremely low through unified request.
Optionally, after summarizing the returned data of the respective requests of each interface to obtain the data to be output, the method further includes: and caching the data to be output and outputting the data to be output. In the embodiment of the present application, on one hand, data to be output is sent to the client for service processing feedback, so that the client further utilizes service data, and on the other hand, the data to be output is locally cached for next service processing. Therefore, the embodiment can reduce the communication with the service interface, timely acquire data from the local cache, and improve the response speed to the client request.
Optionally, before step S13 (i.e. before receiving the service data sent by each service interface based on the target service parameter), the method may further include: and judging whether the data template of the data request is the same as the preset data template and whether the target service parameters corresponding to the data request are the same as the pre-stored target service parameters. On this basis, step S13 may be implemented as: and when the data template of the data request is judged to be the same as the preset data template and the target service parameter corresponding to the data request is judged to be the same as the target service parameter, receiving the service data sent by each service interface based on the target service parameter.
In other embodiments, if it is determined that the data template of the data request is the same as the preset data template and the target service parameter corresponding to the data request is the same as the target service parameter, service data corresponding to each pre-stored target service parameter is acquired from a local cache; and summarizing the service data corresponding to all the acquired target service parameters according to a preset data template to obtain data to be output. Based on this embodiment, on the premise that a local cache indexed according to a target service parameter and a data template is added, when a data request of a client is received, it is first determined whether the data template (e.g., Spring Expression template) in the data request is modified, and whether the target service parameter changes (compared with a service parameter pre-stored in the local cache), if none of the target service parameter changes, the service data of the local cache may be queried first, and if there is no target service parameter in the local cache, the data request is then forwarded to a service interface for service processing. Therefore, the embodiment can reduce the communication with the service interface, timely acquire data from the local cache, improve the response speed to the client request, and reduce the load pressure of the service interface because the service interface is called only when no relevant service data exists in the local cache.
Optionally, the receiving service data sent by each service interface based on the target service parameter includes:
and calling each service interface in the preset task pool, and receiving service data sent by each service interface based on the target service parameters. The task pool may be, for example, a load balancer, and may call the service interfaces according to the load conditions of the service interfaces, the matching degree with the target service parameters, and the like, so as to implement service processing corresponding to the target service parameters.
Optionally, analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter, including:
analyzing the data request according to a preset data template to obtain a plurality of target service parameters;
and determining a service interface corresponding to each target service parameter according to the preset parameter interface relationship.
Therefore, the data processing method provided by the embodiment of the application can receive the data request with the specified format, wherein the data request comprises a plurality of target service parameters; analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter; receiving service data sent by each service interface based on the target service parameters; and summarizing the service data of each service interface according to a preset data template to obtain data to be output. Therefore, the request data corresponding to the plurality of interfaces can be acquired through the single request information, so that the data communication connection is reduced, and the network communication efficiency is improved.
As shown in fig. 3, fig. 3 is a flowchart of acquiring pre-stored data according to an embodiment of the present application, where before receiving service data sent by each service interface based on a target service parameter, the data processing method further includes:
in step S31, it is determined whether the data template of the data request is the same as the preset data template, and the target service parameter corresponding to the data request is the same as the pre-stored target service parameter.
The pre-stored target service parameters are service parameters corresponding to the pre-acquired data requests. As shown in fig. 4, fig. 4 is another example of a data processing method according to an embodiment of the present application, and is a diagram for determining whether a data template of a data request is the same as a preset data template and a target service parameter corresponding to the data request is the same as a pre-stored target service parameter, that is, determining that the data template of the current data request is the same as the preset data template and the target service parameter corresponding to the data request is the same as the pre-stored target service parameter.
In step S32, when it is determined that the data template of the data request is the same as the preset data template and the target service parameter corresponding to the data request is different from the target service parameter, service data sent by each service interface based on the target service parameter is received.
When the data template of the data request is judged to be the same as the preset data template and the target service parameter corresponding to the data request is judged to be the same as the target service parameter, namely the data template of the data request is different from the preset data template or the target service parameter corresponding to the data request is different from the target service parameter, performing full update on service data, and acquiring corresponding service data according to the data request again.
In step S33, if it is determined that the data template of the data request is the same as the preset data template and the target service parameter corresponding to the data request is the same as the target service parameter, service data corresponding to each of the pre-stored target service parameters is obtained from the local cache.
The service data corresponding to each pre-stored target service parameter is the service data obtained and stored through the pre-acquired data request. When the data template of the data request is the same as the preset data template and the target service parameter corresponding to the data request is the same as the pre-stored target service parameter, that is, the data request is the same as a certain data request pre-stored in the server, the service data corresponding to each pre-stored target service parameter acquired from the local cache can be output as the service data corresponding to the data request.
If the data template of the data request is judged to be the same as the preset data template and the target service parameters corresponding to the data request are judged to be the same, the service data corresponding to each pre-stored target service parameter is acquired from the local cache, the acquisition times of the service data can be reduced, the acquisition speed of the service data is improved, the delay is reduced, the load is reduced, the service data corresponding to the data request can be returned to the client side more quickly, and the user experience is improved.
In step S34, the service data corresponding to all the obtained target service parameters are summarized according to a preset data template, so as to obtain data to be output.
Therefore, through the data processing method, research personnel can complete the functional development and obtain the service data again only by configuring the data template, thereby meeting new requirements and shortening the development period. As in practical applications, the logic executed for different services may be abstracted into a service engine service (e.g., the service interface), so as to reduce the same code portion and realize logic multiplexing. Then, for different business logic parts, the data template can be dynamically configured in a domain-specific language (dsl) language (for example, dynamic configuration of target business parameters and business interfaces). Therefore, in the face of new requirements, only the data template needs to be configured, and the dsl service logic is configured in the service engine service (for example, the service interface), so that the development of the function can be completed, and the development efficiency is improved.
Fig. 5 is another flowchart of a data processing method according to an embodiment of the present application, and as shown in fig. 5, the data processing method includes the following steps:
in step S11, a data request in a specified format is received, the data request including a plurality of target service parameters.
In step S12, the data request is parsed by a preset data template to determine the service interface corresponding to each target service parameter.
In step S31, it is determined whether the data template of the data request is the same as the preset data template, and the target service parameter corresponding to the data request is the same as the pre-stored target service parameter.
In step S32, when it is determined that the data template of the data request is the same as the preset data template and the target service parameter corresponding to the data request is different from the target service parameter, service data sent by each service interface based on the target service parameter is received.
In step S33, if it is determined that the data template of the data request is the same as the preset data template and the target service parameter corresponding to the data request is the same as the target service parameter, service data corresponding to each of the pre-stored target service parameters is obtained from the local cache.
In step S34, the service data corresponding to all the obtained target service parameters are summarized according to a preset data template, so as to obtain data to be output.
In step S14, the service data of each service interface is summarized according to a preset data template, so as to obtain data to be output.
In step S35, the data to be output is buffered, and the data to be output is output.
Optionally, receiving service data sent by each service interface based on the target service parameter includes: and calling each service interface in the preset task pool, and receiving service data sent by each service interface based on the target service parameters.
Optionally, analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter, including: analyzing the data request according to a preset data template to obtain a plurality of target service parameters; and determining a service interface corresponding to each target service parameter according to the preset parameter interface relationship.
Therefore, by the data processing method provided by the embodiment of the application, if it is judged that the data template of the data request is the same as the preset data template and the target service parameters corresponding to the data request are the same as the target service parameters, the service data corresponding to each pre-stored target service parameter is acquired from the local cache, and the service data corresponding to all the acquired target service parameters are summarized according to the preset data template to obtain the data to be output. Therefore, the request data corresponding to the plurality of interfaces can be acquired through the single request information, the acquisition speed of the service data is improved, the time delay is reduced, the load is reduced, and the user experience is improved.
Fig. 6 is a flowchart of a data processing method applied to a client according to an embodiment of the present application, including:
in step S61, a plurality of target service parameters are obtained, where the target service parameters correspond to the service interfaces and are used to instruct to obtain corresponding service data.
The data processing method applied to the client is applied to the client, so that the data processing method can be executed through the client, and the client can be a smart phone or a computer.
In the embodiment of the present application, when a client initiates a service request, the service request may be embodied in the form of a service parameter, and one service request may include a plurality of service parameters, and a service interface of each service parameter is different from each other. The service parameter may be an effective query parameter of a route corresponding to service data that the client wants to obtain, and the client queries the desired service data correspondingly through the effective query parameter.
In step S62, the target service parameters are processed according to the preset data template to obtain the data request with the specified format.
The specified format may be a data format corresponding to a predetermined preset data template, and in this embodiment, the preset data template may be a certain data template corresponding to a server. For example, after the processing in this step, a general interface design may be performed on the target service parameter, for example, a code (paramMap or Map param) is used to represent the target service parameter, so as to specify a service interface corresponding to the desired service data, and further, a plurality of target service parameters are placed in a Map of a Spring Expression template, for example, 1public Map common (Map param) {2//.. 3return Map; and 4, forming a data request in a specified format by the key (key) of the target service parameter and sending the data request to the server, so that the server determines a reference attribute (value) through the key of the target service parameter to determine a service interface, and then performs corresponding logic processing through the service interface to obtain service data corresponding to the target service parameter.
In step S63, the data request with the specified format is sent to the server, so that the server obtains the service data corresponding to each target service parameter according to each target service parameter, and generates the data to be output according to all the service data summarized according to the preset data template.
The client may send a data request including a plurality of target service parameters to the server by establishing, for example, a Transmission Control Protocol (TCP) communication connection with the server. The data request can be sent only by connecting with one corresponding interface of the server, and connection with a plurality of service interfaces for meeting the requirement of multi-target service parameters in the related technology is avoided, so that the connection efficiency is higher, and the data acquisition efficiency is improved.
On the server side, in some embodiments, the server firstly queries whether the service data corresponding to the target service parameter is stored locally according to each target service parameter, if so, each service data can be directly obtained locally, in other embodiments, the server can analyze the received data request through a preset data template, determine the service interface corresponding to each target service parameter, then distribute the target service parameter to the corresponding service interface based on load balancing scheduling of the task pool, and obtain the service data based on service processing of the service interface. After the server may process all the service data according to a preset data template (for example, a data request generated by the client, refer to the description in step S62), to form data to be output (including service data corresponding to all the target service parameters). It should be noted that, the manner of generating the to-be-output data is the same as the manner of generating the data request, but the key, value, and the like may be different, for example, the key of the data request may be a target service parameter, the value may be a corresponding service interface, and the key of the to-be-output data may be a target service parameter, and the value may be service data corresponding to the target service parameter.
In step S64, the data to be output sent by the server is received.
The client can receive the data to be output through a previously established communication connection such as TCP, and the communication cost is reduced in order to save resources.
It can be seen that, with the data processing method provided in the embodiment of the present application, a data request for instructing to obtain corresponding service data may be sent to a server side, the server obtains service data corresponding to each target service parameter according to each target service parameter, the received data request may be analyzed by a preset data template for the server, the service data corresponding to the data request is determined, and thus, data to be output is generated according to the summary of all the service data according to the preset data template, and the data to be output sent by the server is received by the client. The method and the device achieve the purpose of acquiring the request data corresponding to the plurality of interfaces through single request information, thereby improving the acquisition speed of the service data, reducing the time delay, reducing the load and improving the user experience.
Fig. 7 is a structural diagram of a data processing apparatus according to an embodiment of the present application, as shown in fig. 7, including:
a request receiving module 701, configured to receive a data request in a specified format, where the data request includes multiple target service parameters;
a request analysis module 702, configured to analyze the data request through a preset data template to determine a service interface corresponding to each target service parameter;
a data obtaining module 703, configured to receive service data sent by each service interface based on the target service parameter;
and the data summarizing module 704 is used for summarizing the service data of each service interface according to a preset data template to obtain data to be output.
Optionally, the apparatus further comprises:
and the data caching module is used for caching the data to be output and outputting the data to be output.
Optionally, the apparatus further comprises:
the same judging module is used for judging whether the data template of the data request is the same as the preset data template and the target service parameter corresponding to the data request is the same as the pre-stored target service parameter or not;
the data acquisition module 703 includes:
and the result output module is used for receiving the service data sent by each service interface based on the target service parameters when the data template of the data request is judged to be the same as the preset data template and the target service parameters corresponding to the data request are judged to be the same as the target service parameters.
Optionally, the apparatus further comprises:
the cache obtaining module is used for obtaining pre-stored service data corresponding to each target service parameter from a local cache if the data template of the data request is judged to be the same as the preset data template and the target service parameter corresponding to the data request is judged to be the same as the target service parameter;
and the data summarizing module is used for summarizing the acquired service data corresponding to all the target service parameters according to a preset data template to obtain data to be output.
Optionally, the data obtaining module 703 includes:
and the interface calling submodule is used for calling each service interface in the preset task pool and receiving the service data sent by each service interface based on the target service parameters.
Optionally, the request parsing module 702 includes:
the target service submodule is used for analyzing the data request according to a preset data template to obtain a plurality of target service parameters;
and the interface determining submodule is used for determining a service interface corresponding to each target service parameter according to the preset parameter interface relationship.
Therefore, the data processing device provided by the embodiment of the application can receive a data request with a specified format, wherein the data request comprises a plurality of target service parameters; analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter; receiving service data sent by each service interface based on the target service parameters; and summarizing the service data of each service interface according to a preset data template to obtain data to be output. Therefore, the request data corresponding to the plurality of interfaces can be acquired through the single request information, so that the data communication connection is reduced, and the network communication efficiency is improved.
Fig. 8 is a schematic diagram of a data processing apparatus applied to a client according to an embodiment of the present application, including:
a parameter obtaining module 801, configured to obtain multiple target service parameters, where the target service parameters correspond to service interfaces and are used to instruct to obtain corresponding service data;
a request generating module 802, configured to process multiple target service parameters according to a preset data template to obtain a data request in a specified format;
a request sending module 803, configured to send a data request in a specified format to a server, so that the server obtains service data corresponding to each target service parameter according to each target service parameter, and generates data to be output according to all the service data collected according to a preset data template;
a data receiving module 804, configured to receive data to be output sent by a server
Therefore, the data processing device provided by the embodiment of the application can send the data request with the specified format to the server side and receive the data to be output sent by the server.
An embodiment of the present application further provides an electronic device, including: a processor and a memory;
the memory is used for storing computer programs.
When the processor is used for executing the computer program stored in the memory, the following steps are realized:
receiving a data request in a specified format, wherein the data request comprises a plurality of target service parameters;
analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter;
receiving service data sent by each service interface based on the target service parameters;
and summarizing the service data of each service interface according to a preset data template to obtain data to be output.
Optionally, referring to fig. 9, the electronic device according to the embodiment of the present application further includes a communication interface 902 and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 complete communication with each other through the communication bus 904.
Optionally, when the processor is configured to execute the computer program stored in the memory, any of the data processing methods applied to the server side may be implemented.
Therefore, the electronic equipment provided by the embodiment of the application can receive the data request with the specified format, wherein the data request comprises a plurality of target service parameters; analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter; receiving service data sent by each service interface based on the target service parameters; and summarizing the service data of each service interface according to a preset data template to obtain data to be output. Therefore, the request data corresponding to the plurality of interfaces can be acquired through the single request information, so that the data communication connection is reduced, and the network communication efficiency is improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
An embodiment of the present application further provides another electronic device, including: a processor and a memory;
the memory is used for storing computer programs.
When the processor is used for executing the computer program stored in the memory, the following steps are realized:
acquiring a plurality of target service parameters, wherein the target service parameters correspond to the service interfaces and are used for indicating acquisition of corresponding service data;
processing the plurality of target service parameters according to a preset data template to obtain a data request with a specified format;
sending a data request with a specified format to a server so that the server acquires service data corresponding to each target service parameter according to each target service parameter, and summarizing all the service data according to a preset data template to generate data to be output;
and receiving data to be output, which is sent by the server.
Optionally, referring to fig. 10, the electronic device according to the embodiment of the present application further includes a communication interface 1002 and a communication bus 1004, where the processor 1001, the communication interface 1002, and the memory 1003 complete communication with each other through the communication bus 804.
Optionally, when the processor is configured to execute the computer program stored in the memory, any data processing method applied to the client may be further implemented.
Therefore, the electronic device provided by the embodiment of the application can send the data request with the specified format to the server side and receive the data to be output sent by the server.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the following steps:
receiving a data request with a specified format, wherein the data request comprises a plurality of target service parameters;
analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter;
receiving service data sent by each service interface based on the target service parameters;
and summarizing the service data of each service interface according to a preset data template to obtain data to be output.
Optionally, the computer program can also implement any of the above data processing methods applied to the server side when executed by the processor.
As can be seen, the computer-readable storage medium provided by the embodiments of the present application may receive a data request in a specified format, where the data request includes a plurality of target service parameters; analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter; receiving service data sent by each service interface based on the target service parameters; and summarizing the service data of each service interface according to a preset data template to obtain data to be output. Therefore, the request data corresponding to the plurality of interfaces can be acquired through the single request information, so that the data communication connection is reduced, and the network communication efficiency is improved.
An embodiment of the present application further provides another computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the following steps:
acquiring a plurality of target service parameters, wherein the target service parameters correspond to the service interfaces and are used for indicating to acquire corresponding service data;
processing the target service parameters according to a preset data template to obtain a data request with a specified format;
sending a data request with a specified format to a server so that the server acquires service data corresponding to each target service parameter according to each target service parameter, and summarizing all the service data according to a preset data template to generate data to be output;
and receiving data to be output, which is sent by the server.
Optionally, the computer program can also implement any of the data processing methods applied to the client when being executed by the processor.
Therefore, the computer-readable storage medium provided by the embodiment of the application can send a data request in a specified format to the server side and receive data to be output sent by the server.
It should be noted that, in this document, the technical features in the various alternatives can be combined to form the scheme as long as the technical features are not contradictory, and the scheme is within the scope of the disclosure of the present application. Relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiments of the apparatus, the electronic device and the storage medium, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to the partial description of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (12)

1. A data processing method is applied to a server side, and is characterized by comprising the following steps:
receiving a data request in a specified format, wherein the data request comprises a plurality of target service parameters; the data request is obtained by processing a plurality of service parameters corresponding to a plurality of service interfaces, and the service interfaces of each service parameter are different;
analyzing the data request through a preset data template to determine a service interface corresponding to each target service parameter;
judging whether a data template of the data request is the same as the preset data template and whether a target service parameter corresponding to the data request is the same as a pre-stored target service parameter or not;
when the data template of the data request is judged to be the same as the preset data template and the target service parameter corresponding to the data request is judged to be the same as the target service parameter, receiving service data sent by each service interface based on the target service parameter;
and summarizing the service data of each service interface according to the preset data template to obtain data to be output.
2. The method according to claim 1, wherein after the aggregating the returned data of the requests corresponding to the respective interfaces to obtain the data to be output, the method further comprises:
and caching the data to be output and outputting the data to be output.
3. The method of claim 1, further comprising:
if the data template of the data request is judged to be the same as the preset data template, and the target service parameters corresponding to the data request are judged to be the same as the target service parameters, acquiring pre-stored service data corresponding to each target service parameter from a local cache;
and summarizing the acquired service data corresponding to all the target service parameters according to the preset data template to obtain data to be output.
4. The method of claim 1, wherein the receiving the service data sent by each service interface based on the target service parameter comprises:
and calling each service interface in a preset task pool, and receiving service data sent by each service interface based on the target service parameters.
5. The method of claim 1, wherein the parsing the data request through a preset data template to determine the service interface corresponding to each target service parameter comprises:
analyzing the data request according to a preset data template to obtain a plurality of target service parameters;
and determining a service interface corresponding to each target service parameter according to a preset parameter interface relationship.
6. A data processing apparatus, applied to a server side, comprising:
a request receiving module, configured to receive a data request in a specified format, where the data request includes a plurality of target service parameters; the data request is obtained by processing a plurality of service parameters corresponding to a plurality of service interfaces, and the service interfaces of each service parameter are different;
the request analysis module is used for analyzing the data request through a preset data template so as to determine a service interface corresponding to each target service parameter;
the same judging module is used for judging whether a data template of the data request is the same as the preset data template and whether a target service parameter corresponding to the data request is the same as a pre-stored target service parameter or not;
a data acquisition module comprising:
a result output module, configured to receive, when it is determined that the data template of the data request is the same as the preset data template and the target service parameter corresponding to the data request is the same as the target service parameter, service data sent by each service interface based on the target service parameter;
and the data summarizing module is used for summarizing the service data of each service interface according to the preset data template to obtain data to be output.
7. The apparatus of claim 6, further comprising:
and the data caching module is used for caching the data to be output and outputting the data to be output.
8. The apparatus of claim 6, further comprising:
a cache obtaining module, configured to obtain, from a local cache, pre-stored service data corresponding to each target service parameter if it is determined that the data template of the data request is the same as the preset data template and the target service parameter corresponding to the data request is the same as the target service parameter;
and the data summarizing module is used for summarizing the acquired service data corresponding to all the target service parameters according to the preset data template to obtain data to be output.
9. The apparatus of claim 6, wherein the data acquisition module comprises:
and the interface calling submodule is used for calling each service interface in a preset task pool and receiving service data sent by each service interface based on the target service parameter.
10. The apparatus of claim 6, wherein the request resolution module comprises:
the target service submodule is used for analyzing the data request according to a preset data template to obtain a plurality of target service parameters;
and the interface determining submodule is used for determining a service interface corresponding to each target service parameter according to a preset parameter interface relation.
11. An electronic device comprising a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to implement the data processing method according to any one of claims 1 to 5 when executing the computer program stored in the memory.
12. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the data processing method of any one of claims 1 to 5.
CN201911275719.5A 2019-12-12 2019-12-12 Data processing method and device, electronic equipment and storage medium Active CN111092877B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911275719.5A CN111092877B (en) 2019-12-12 2019-12-12 Data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911275719.5A CN111092877B (en) 2019-12-12 2019-12-12 Data processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111092877A CN111092877A (en) 2020-05-01
CN111092877B true CN111092877B (en) 2022-09-02

Family

ID=70396385

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911275719.5A Active CN111092877B (en) 2019-12-12 2019-12-12 Data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111092877B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114157661B (en) * 2020-09-07 2024-01-16 北京奇艺世纪科技有限公司 Data request method, data processing method, related device, equipment and system
CN112148783A (en) * 2020-09-28 2020-12-29 微医云(杭州)控股有限公司 Data exchange method, device and equipment
CN112286668A (en) * 2020-11-18 2021-01-29 山东高速信息集团有限公司 Method and system for efficiently processing request data
CN112839084B (en) * 2021-01-04 2022-06-07 浙江诺诺网络科技有限公司 Service processing method, device, equipment and computer readable storage medium
CN113034111A (en) * 2021-03-31 2021-06-25 北京金山云网络技术有限公司 Data export and import method and device
CN113489773B (en) * 2021-06-30 2022-11-04 未鲲(上海)科技服务有限公司 Data access method, device, equipment and medium
CN113590699B (en) * 2021-07-14 2023-12-01 车智互联(北京)科技有限公司 Interface request processing method, system and computing device
CN114510501A (en) * 2021-12-28 2022-05-17 奇安信科技集团股份有限公司 Method and device for processing interface data in real time
CN114416241B (en) * 2021-12-30 2023-10-27 北京奇艺世纪科技有限公司 Service identifier display method and device, electronic equipment and storage medium
CN114679735B (en) * 2022-03-29 2023-04-04 中国铁塔股份有限公司 Parameter adjusting method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657193A (en) * 2015-11-02 2017-05-10 腾讯科技(深圳)有限公司 Request processing method, request processing device, terminal device and server
CN110351342A (en) * 2019-06-20 2019-10-18 平安科技(深圳)有限公司 Service order processing method, device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130132372A1 (en) * 2011-11-17 2013-05-23 Benefitfocus.Com Systems and methods for dynamic service integration

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106657193A (en) * 2015-11-02 2017-05-10 腾讯科技(深圳)有限公司 Request processing method, request processing device, terminal device and server
CN110351342A (en) * 2019-06-20 2019-10-18 平安科技(深圳)有限公司 Service order processing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111092877A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
CN111092877B (en) Data processing method and device, electronic equipment and storage medium
US10839038B2 (en) Generating configuration information for obtaining web resources
CN108881396B (en) Network data loading method, device, equipment and computer storage medium
EP3843341B1 (en) Selection, by a network function repository function device, of network function services meeting multiple conditions
CN106649630A (en) Data query method and device
CN107786621B (en) User information management method, access processing method, device and system
CN113032419B (en) Multi-source data aggregation search method, device, equipment and storage medium
US11695623B2 (en) Method and apparatus for binding network card in multi-network card server, and electronic device and storage medium
CN109086158B (en) Abnormal cause analysis method and device and server
CN113206785A (en) Network request method and device, terminal equipment and storage medium
CN114741261A (en) Distributed link tracking method, device, equipment and storage medium
CN111680247B (en) Local calling method, device and equipment of webpage character strings and storage medium
CN105868058A (en) Cross-machine room test method and apparatus
CN113127335B (en) System testing method and device
CN116776030A (en) Gray release method, device, computer equipment and storage medium
CN112491943B (en) Data request method, device, storage medium and electronic equipment
CN111988398A (en) Data acquisition method, API gateway and medium
CN109558579A (en) A kind of report form generation method and device
CN113779122B (en) Method and device for exporting data
CN111400060B (en) Equipment linkage method, device, server and medium
CN110557428B (en) Script interpretation type service agent method and system based on Kubernetes
CN114500484A (en) Page rendering method and device, electronic equipment and readable medium
CN112306797A (en) Embedded point information reporting method and device, storage medium and electronic equipment
CN112131263A (en) Software package obtaining method, system, device, electronic equipment and storage medium
CN113836405B (en) Information query method, device and computer readable storage medium

Legal Events

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