CN112559605A - 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
CN112559605A
CN112559605A CN201910913214.0A CN201910913214A CN112559605A CN 112559605 A CN112559605 A CN 112559605A CN 201910913214 A CN201910913214 A CN 201910913214A CN 112559605 A CN112559605 A CN 112559605A
Authority
CN
China
Prior art keywords
data
conversion
data structure
client
target
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
CN201910913214.0A
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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201910913214.0A priority Critical patent/CN112559605A/en
Publication of CN112559605A publication Critical patent/CN112559605A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database

Abstract

The invention discloses a data processing method and device, electronic equipment and a storage medium. Wherein, the method comprises the following steps: acquiring query data returned by a server and a target function set corresponding to a client, wherein the query data corresponds to a query request sent by the client, and the target function set comprises at least one conversion function; converting the data structure of the query data by using a conversion function contained in the target function set to obtain target data, wherein the data structure of the query data is the same as that of the server side, and the data structure of the target data is the same as that of the client side; and sending the target data to the client. The invention solves the technical problems that the client and the server need to customize data structures and the dependency between the server interface and the client component is high in the related technology.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the field of internet, in particular to a data processing method and device, electronic equipment and a storage medium.
Background
The current mode of using the client and the server for the connection is as follows: the client and the server predefine interface data structures, then the back end (namely the server) provides data according to the data structures, and the front end (namely the client) renders the data after processing according to the data structures.
By adopting the scheme, the client and the server need to agree on a fixed data structure, but the server provides data service for a plurality of clients, and once the same interface serves a new client, the server needs to match the new client data structure and reformulate a new interface. The problem of not being available with previously developed components is also faced when client components are adapted to different interfaces.
Aiming at the problems that a client and a server need to customize a data structure and the dependency of a server interface and a client component is high in the related technology, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides a data processing method and device, electronic equipment and a storage medium, which are used for at least solving the technical problems that a client and a server need to customize a data structure and the dependency of a server interface and a client component is high in the related technology.
According to an aspect of an embodiment of the present invention, there is provided a data processing method including: acquiring query data returned by a server and a target function set corresponding to a client, wherein the query data corresponds to a query request sent by the client, and the target function set comprises at least one conversion function; converting the data structure of the query data by using a conversion function contained in the target function set to obtain target data, wherein the data structure of the query data is the same as that of the server side, and the data structure of the target data is the same as that of the client side; and sending the target data to the client.
Further, before obtaining the target function set corresponding to the client, the method further includes: acquiring a first data structure of a server and a second data structure of a client; acquiring a target function set for converting a first data structure into a second data structure; and establishing a mapping relation between the client and the target function set.
Further, obtaining a set of objective functions for converting the first data structure into the second data structure comprises: acquiring a conversion path set from a conversion function library by using a graph path algorithm, wherein the conversion path set comprises at least one conversion path, and each conversion path comprises a conversion function used for converting a first data structure into a second data structure; obtaining a shortest path in the conversion path set to obtain a target conversion path; and acquiring a conversion function contained in the target conversion path to obtain a target function set.
Further, each conversion path includes a number of conversion functions less than a preset number.
Further, the method further comprises: in the case that the set of conversion paths cannot be obtained from the conversion function library, obtaining a new conversion function, wherein the new conversion function is used for converting the first data structure into the second data structure; the new conversion function is stored to the conversion function library.
Further, the obtaining the first data structure of the server and the second data structure of the client includes: acquiring a first address of an input server and a second address of a client; a first data structure is retrieved based on the first address and a second data structure is retrieved based on the second address.
Further, the query request carries identification information, wherein obtaining a conversion function corresponding to the client includes: acquiring a conversion function list corresponding to the identification information; based on the list of conversion functions, the conversion functions are retrieved from the conversion database.
Further, under the condition that the target function set includes a plurality of conversion functions, converting the data structure of the query data by using the conversion functions included in the target function set, and obtaining the target data includes: and sequentially converting the data structure of the query data by using a plurality of conversion functions to obtain target data.
According to another aspect of the embodiments of the present invention, there is also provided a data processing apparatus, including: the system comprises an acquisition module, a conversion module and a conversion module, wherein the acquisition module is used for acquiring query data returned by a server and a target function set corresponding to a client, the query data corresponds to a query request sent by the client, and the target function set comprises at least one conversion function; the conversion module is used for converting the data structure of the query data by using the conversion function contained in the target function set to obtain target data, wherein the data structure of the query data is the same as that of the server side, and the data structure of the target data is the same as that of the client side; and the sending module is used for sending the target data to the client.
Further, the above apparatus further comprises: the first acquisition module is used for acquiring a first data structure of the server and a second data structure of the client; the second acquisition module is used for acquiring a target function set used for converting the first data structure into a second data structure; and the establishing module is used for establishing the mapping relation between the client and the target function set.
Further, the second obtaining module includes: the conversion method comprises a first obtaining unit, a second obtaining unit and a third obtaining unit, wherein the first obtaining unit is used for obtaining a conversion path set from a conversion function library by using a graph path algorithm, the conversion path set comprises at least one conversion path, and each conversion path comprises a conversion function used for converting a first data structure into a second data structure; the second acquisition unit is used for acquiring the shortest path in the conversion path set to obtain a target conversion path; and the third acquisition unit is used for acquiring the conversion function contained in the target conversion path to obtain a target function set.
Further, each conversion path includes a number of conversion functions less than a preset number.
Further, the above apparatus further comprises: a third obtaining module, configured to obtain a new conversion function when the set of conversion paths cannot be obtained from the conversion function library, where the new conversion function is used to convert the first data structure into a second data structure; and the storage module is used for storing the new conversion function to the conversion function library.
Further, the first obtaining module comprises: a fourth obtaining unit, configured to obtain an input first address of the server and a second address of the client; and a fifth obtaining unit configured to obtain the first data structure based on the first address and obtain the second data structure based on the second address.
Further, the query request carries identification information, wherein the obtaining module includes: a sixth obtaining unit, configured to obtain a conversion function list corresponding to the identification information; a seventh obtaining unit, configured to obtain the conversion function from the conversion database based on the conversion function list.
Further, under the condition that the target function set comprises a plurality of conversion functions, the conversion module is further configured to convert the data structure of the query data in sequence by using the plurality of conversion functions to obtain the target data.
According to another aspect of the embodiments of the present invention, there is also provided a data processing system, including: the client is used for sending a query request; the server is used for sending query data corresponding to the query request; the data adapter is connected between the client and the server and used for acquiring a target function set corresponding to the client, converting a data structure of query data by using a conversion function contained in the target function set to obtain target data and sending the target data to the client, wherein the target function set comprises at least one conversion function, the data structure of the query data is the same as that of the server, and the data structure of the target data is the same as that of the client.
Further, the data adapter is also used for acquiring a first data structure of the server and a second data structure of the client; acquiring a target function set for converting a first data structure into a second data structure; and establishing a mapping relation between the client and the target function set.
The data adapter is further used for acquiring a conversion path set from the conversion function library by using a graph path algorithm, wherein the conversion path set comprises at least one conversion path, and each conversion path comprises a conversion function used for converting the first data structure into the second data structure; obtaining a shortest path in the conversion path set to obtain a target conversion path; and acquiring a conversion function contained in the target conversion path to obtain a target function set.
Further, the data adapter is further configured to, in a case that the set of conversion paths cannot be obtained from the conversion function library, obtain a new conversion function, where the new conversion function is used to convert the first data structure into the second data structure; the new conversion function is stored to the conversion function library.
Further, the data adapter is also used for acquiring a first address of the input server and a second address of the client; a first data structure is retrieved based on the first address and a second data structure is retrieved based on the second address.
Further, the query request carries identification information, wherein the data adapter is further configured to obtain a conversion function list corresponding to the identification information; based on the list of conversion functions, the conversion functions are retrieved from the conversion database.
Further, the data adapter is further configured to, when the target function set includes a plurality of conversion functions, sequentially convert the data structure of the query data by using the plurality of conversion functions to obtain the target data.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including at least one processor, and at least one memory and a bus connected to the processor; the processor and the memory complete mutual communication through a bus; the processor is used for calling the program instructions in the memory so as to execute the data processing method.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the data processing method described above.
In the embodiment of the invention, when the client initiates the query work, the data adapter can acquire the query data returned by the server, convert the data structure of the query data by using the conversion function contained in the acquired target function set, and return the converted target data to the client to complete the whole query process. Because the data structure of the query data is the same as that of the server, and the data structure of the target data is the same as that of the client, the client and the server can automatically adapt to data format conversion without establishing a butt joint data structure, so that the technical effects that the server interface is independent of the client component and adapts to different service scenes to a greater extent are achieved, and the technical problems that the client and the server need to customize the data structures and the dependency of the server interface and the client component is high in the related technology are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a method of data processing according to an embodiment of the invention;
FIG. 2 is a flow diagram of another data processing method according to an embodiment of the invention;
FIG. 3 is a flow diagram of an alternative data processing method according to an embodiment of the invention;
FIG. 4 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another data processing apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a data processing system according to an embodiment of the present invention; and
fig. 7 is a schematic diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided a data processing method, it should be noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a flow chart of a data processing method according to an embodiment of the present invention, as shown in fig. 1, the method including the steps of:
step S102, acquiring query data returned by a server and a target function set corresponding to a client, wherein the query data corresponds to a query request sent by the client, and the target function set comprises at least one conversion function;
and step S104, converting the data structure of the query data by using the conversion function contained in the target function set to obtain target data, wherein the data structure of the query data is the same as that of the server side, and the data structure of the target data is the same as that of the client side.
Step S106, sending the target data to the client;
in this embodiment, the client and the server may be connected by a data adapter, the server returns query data to the data adapter according to its own data structure, and the data adapter performs format conversion, where the converted data format is the same as the data structure defined by the client, so that the client renders data according to its own data structure.
It should be noted that, a transfer function can only convert one data structure into another data structure, and when two data structures can be converted by a transfer function, the set of objective functions only includes the transfer function; when two data structures cannot be converted by one conversion function, the set of objective functions may contain a plurality of conversion functions.
By the embodiment of the invention, when the client initiates the query work, the data adapter can acquire the query data returned by the server, convert the data structure of the query data by using the conversion function contained in the acquired target function set, return the converted target data to the client and complete the whole query process. Because the data structure of the query data is the same as that of the server, and the data structure of the target data is the same as that of the client, the client and the server can automatically adapt to data format conversion without establishing a butt joint data structure, so that the technical effects that the server interface is independent of the client component and adapts to different service scenes to a greater extent are achieved, and the technical problems that the client and the server need to customize the data structures and the dependency of the server interface and the client component is high in the related technology are solved.
Optionally, in the above embodiment of the present invention, as shown in fig. 2, before the obtaining of the target function set corresponding to the client, the method further includes:
step S202, a first data structure of a server and a second data structure of a client are obtained;
step S204, acquiring a target function set for converting the first data structure into a second data structure;
step S206, establishing a mapping relation between the client and the target function set.
In this embodiment, in order to ensure that the data adapter can convert the data structure of the query data, the data adapter first reads the data structure T1 output by the server, reads the data structure T2 required by the client, and finds the set of conversion functions from T1 to T2 to obtain the target function set L. Since the service of the server often serves a plurality of clients, each client may establish a mapping relationship with the found L for storage.
Optionally, in the foregoing embodiment of the present invention, acquiring the set of objective functions for converting the first data structure into the second data structure includes: acquiring a conversion path set from a conversion function library by using a graph path algorithm, wherein the conversion path set comprises at least one conversion path, and each conversion path comprises a conversion function used for converting a first data structure into a second data structure; obtaining a shortest path in the conversion path set to obtain a target conversion path; and acquiring a conversion function contained in the target conversion path to obtain a target function set.
Optionally, each conversion path includes a number of conversion functions less than a preset number.
It should be noted that, the more steps the conversion path goes through from T1 to T2, the lower the performance of the data adapter, and in order to avoid performance degradation, the steps each conversion path in the conversion path set goes through need to be defined. Further, the conversion path undergoes one step each time, i.e. data format conversion is implemented, i.e. the steps undergone by the conversion path correspond to the number of conversion functions, and therefore, the steps undergone by the conversion path can be defined by defining the number of conversion functions. The predetermined number may be determined by performance factors of the data adapter, and may be denoted by N.
In this embodiment, a specific implementation manner of the graph path algorithm is as follows: the above set of conversion paths can be obtained by constructing a directed graph with each conversion function as a node, and further finding a conversion function with a step less than N from the data structure T1 to the data structure T2 from the directed graph by a path algorithm.
Optionally, in the above embodiment of the present invention, the method further includes: in the case that the set of conversion paths cannot be obtained from the conversion function library, obtaining a new conversion function, wherein the new conversion function is used for converting the first data structure into the second data structure; the new conversion function is stored to the conversion function library.
It should be noted that, because there are many data structure types, the conversion function library cannot cover all the data structure types, and the conversion function from T1 to T2 may not be obtained by the graph path algorithm. In addition, since the steps undergone by each conversion path in the conversion path set are limited, a conversion path having less than N steps from T1 to T2 may not be obtained by the graph path algorithm.
In the above case, in order to realize the data format conversion, a conversion function from T1 to T2 may be created and stored in the conversion function library to facilitate the subsequent data format conversion.
Optionally, in the foregoing embodiment of the present invention, acquiring the first data structure of the server and the second data structure of the client includes: acquiring a first address of an input server and a second address of a client; a first data structure is retrieved based on the first address and a second data structure is retrieved based on the second address.
In this embodiment, the client component address and the server interface address may be input into the data adapter to establish adaptation, so that the data structure T1 output by the server and the data structure T2 required by the client component may be read according to the two addresses.
Optionally, in the foregoing embodiment of the present invention, the query request carries identification information, where acquiring a transfer function corresponding to the client includes: acquiring a conversion function list corresponding to the identification information; based on the list of conversion functions, the conversion functions are retrieved from the conversion database.
It should be noted that, in order to conveniently and quickly obtain a conversion function that can meet the data format conversion requirement between the server and the client, a unique ID may be generated for each conversion function set, and a mapping relationship between the unique ID and the conversion function set is established for storage. The ID is added to the client component, which will be carried by the client when initiating the query.
Optionally, in the foregoing embodiment of the present invention, when the target function set includes a plurality of conversion functions, converting the data structure of the query data by using the conversion functions included in the target function set, and obtaining the target data includes: and sequentially converting the data structure of the query data by using a plurality of conversion functions to obtain target data.
In this embodiment, when the target function set includes more than one conversion function, the conversion functions in the target function set may be arranged according to a conversion sequence, and further, the query data may sequentially undergo the conversion functions in the target function set to perform data format conversion, so as to obtain final target data.
A preferred embodiment of the present invention is described in detail below with reference to fig. 3, and as shown in fig. 3, the method comprises the steps of:
step S31, fill the server address and the client component address in the data adapter.
In step S32, the data adapter reads the data structure T1 returned by the server interface and the data structure T2 of the client component.
In step S33, the data adapter searches the function library for a transition function from T1 to T2.
Alternatively, if the conversion function can be found, the process proceeds to step S36; if the conversion function cannot be found, the flow proceeds to step S34.
In step S34, the data adapter uses the graph path algorithm to find a path with steps less than N from T1 to T2.
Alternatively, if the path can be found, the process proceeds to step S36; if the path cannot be found, the flow proceeds to step S35.
In step S35, a new conversion function is created and added to the function library of the data adapter.
Alternatively, after the above steps are completed, the process returns to step S31.
In step S36, an ID is generated and stored with the list of conversion functions to be undergone from T1 to T2 mapped to the ID.
Step S37, the ID is written into the client component.
Step S38, when the client interacts with the server, the client carries ID to initiate inquiry.
Step S39, after the data adapter receives the server interface data, it searches the corresponding conversion function list according to the ID.
Step S310, the data adapter makes the data of the server interface go through each conversion function in turn, and returns the converted data to the client.
Through the steps, the client and the server automatically adapt to data conversion under the condition that a data structure for butt joint is not required to be formulated through the data adapter, so that the server interface and the client component are independent, and different service scenes are adapted to a greater degree.
According to an embodiment of the present invention, there is provided a data processing apparatus. Fig. 4 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention, as shown in fig. 4, the apparatus including: an acquisition module 42, a conversion module 44, and a transmission module 46.
The obtaining module 42 is configured to obtain query data returned by the server and a target function set corresponding to the client, where the query data corresponds to a query request sent by the client, and the target function set includes at least one conversion function; the conversion module 44 is configured to convert a data structure of the query data by using a conversion function included in the target function set to obtain target data, where the data structure of the query data is the same as the data structure of the server and the data structure of the target data is the same as the data structure of the client; the sending module 46 is used for sending the target data to the client.
By the embodiment of the invention, when the client initiates the query work, the data adapter can acquire the query data returned by the server through the acquisition module, convert the data structure of the query data by using the conversion function contained in the acquired target function set through the conversion module, and return the converted target data to the client through the sending module, thereby completing the whole query process. Because the data structure of the query data is the same as that of the server, and the data structure of the target data is the same as that of the client, the client and the server can automatically adapt to data format conversion without establishing a butt joint data structure, so that the technical effects that the server interface is independent of the client component and adapts to different service scenes to a greater extent are achieved, and the technical problems that the client and the server need to customize the data structures and the dependency of the server interface and the client component is high in the related technology are solved.
Optionally, in the above embodiment of the present invention, as shown in fig. 5, the apparatus further includes: a first acquisition module 52, a second acquisition module 54, and a setup module 56.
The first obtaining module 52 is configured to obtain a first data structure of the server and a second data structure of the client; the second obtaining module 54 is configured to obtain a set of objective functions for converting the first data structure into the second data structure; the establishing module 56 is used for establishing a mapping relationship between the client and the objective function set.
Optionally, in the foregoing embodiment of the present invention, the second obtaining module includes: the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit.
The first obtaining unit is used for obtaining a conversion path set from a conversion function library by using a graph path algorithm, wherein the conversion path set comprises at least one conversion path, and a conversion function contained in each conversion path is used for converting a first data structure into a second data structure; the second obtaining unit is used for obtaining the shortest path in the conversion path set to obtain a target conversion path; the third obtaining unit is used for obtaining the conversion function contained in the target conversion path to obtain a target function set.
Optionally, each conversion path includes a number of conversion functions less than a preset number.
Optionally, in the above embodiment of the present invention, the apparatus further includes: the device comprises a third acquisition module and a storage module.
The third obtaining module is configured to obtain a new conversion function when the set of conversion paths cannot be obtained from the conversion function library, where the new conversion function is used to convert the first data structure into the second data structure; the storage module is used for storing the new conversion function to the conversion function library.
Optionally, in the foregoing embodiment of the present invention, the first obtaining module includes: a fourth acquisition unit and a fifth acquisition unit.
The fourth acquiring unit is used for acquiring a first address of the input server and a second address of the client; the fifth obtaining unit is configured to obtain the first data structure based on the first address and obtain the second data structure based on the second address.
Optionally, in the foregoing embodiment of the present invention, the query request carries identification information, where the obtaining module includes: a sixth acquisition unit and a seventh acquisition unit.
The sixth obtaining unit is configured to obtain a conversion function list corresponding to the identification information; the seventh obtaining unit is configured to obtain the conversion function from the conversion database based on the conversion function list.
Optionally, in the foregoing embodiment of the present invention, when the target function set includes a plurality of conversion functions, the conversion module is further configured to sequentially convert the data structure of the query data by using the plurality of conversion functions to obtain the target data.
The data processing device comprises a processor and a memory, wherein the acquisition module, the conversion module, the sending module, the first acquisition module, the second acquisition module, the establishing module, the third acquisition module, the storage module and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the data structure of data transmitted between the client and the server is converted by adjusting the kernel parameters.
According to an embodiment of the present invention, a data processing system is provided. FIG. 6 is a schematic diagram of a data processing system according to an embodiment of the present invention, as shown in FIG. 6, including: client 10, server 20, and data adapter 30.
The client 10 is configured to send a query request; the server 20 is configured to send query data corresponding to the query request; the data adapter 30 is connected between the client and the server, and is configured to obtain a target function set corresponding to the client, convert a data structure of query data by using a conversion function included in the target function set to obtain target data, and send the target data to the client, where the target function set includes at least one conversion function, the data structure of the query data is the same as the data structure of the server, and the data structure of the target data is the same as the data structure of the client.
By the embodiment of the invention, when the client initiates the query work, the data adapter can acquire the query data returned by the server, convert the data structure of the query data by using the conversion function contained in the acquired target function set, return the converted target data to the client and complete the whole query process. Because the data structure of the query data is the same as that of the server, and the data structure of the target data is the same as that of the client, the client and the server can automatically adapt to data format conversion without establishing a butt joint data structure, so that the technical effects that the server interface is independent of the client component and adapts to different service scenes to a greater extent are achieved, and the technical problems that the client and the server need to customize the data structures and the dependency of the server interface and the client component is high in the related technology are solved.
Optionally, in the foregoing embodiment of the present invention, the data adapter is further configured to obtain a first data structure of the server and a second data structure of the client; acquiring a target function set for converting a first data structure into a second data structure; and establishing a mapping relation between the client and the target function set.
Optionally, in the foregoing embodiment of the present invention, the data adapter is further configured to obtain a conversion path set from the conversion function library by using a graph-path algorithm, where the conversion path set includes at least one conversion path, and a conversion function included in each conversion path is used to convert the first data structure into the second data structure; obtaining a shortest path in the conversion path set to obtain a target conversion path; and acquiring a conversion function contained in the target conversion path to obtain a target function set.
Optionally, each conversion path includes a number of conversion functions less than a preset number.
Optionally, in the foregoing embodiment of the present invention, the data adapter is further configured to, in a case that the set of conversion paths cannot be obtained from the conversion function library, obtain a new conversion function, where the new conversion function is used to convert the first data structure into the second data structure; the new conversion function is stored to the conversion function library.
Optionally, in the foregoing embodiment of the present invention, the data adapter is further configured to obtain an input first address of the server and an input second address of the client; a first data structure is retrieved based on the first address and a second data structure is retrieved based on the second address.
Optionally, in the embodiment of the present invention, the query request carries identification information, and the data adapter is further configured to obtain a conversion function list corresponding to the identification information; based on the list of conversion functions, the conversion functions are retrieved from the conversion database.
Optionally, in the foregoing embodiment of the present invention, the data adapter is further configured to, when the target function set includes a plurality of conversion functions, sequentially convert the data structure of the query data by using the plurality of conversion functions to obtain the target data.
An embodiment of the present invention provides a storage medium on which a program is stored, the program implementing the data processing method when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the data processing method is executed when the program runs.
An embodiment of the present invention provides an electronic device, as shown in fig. 7, the device 70 includes at least one processor 701, at least one memory 702 connected to the processor, and a bus 703; the processor and the memory complete mutual communication through a bus; the processor is used for calling the program instructions in the memory so as to execute the data processing method. The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
acquiring query data returned by a server and a target function set corresponding to a client, wherein the query data corresponds to a query request sent by the client, and the target function set comprises at least one conversion function; converting the data structure of the query data by using a conversion function contained in the target function set to obtain target data, wherein the data structure of the query data is the same as that of the server side, and the data structure of the target data is the same as that of the client side; and sending the target data to the client.
Before acquiring a target function set corresponding to a client, acquiring a first data structure of a server and a second data structure of the client; acquiring a target function set for converting a first data structure into a second data structure; and establishing a mapping relation between the client and the target function set.
Acquiring a conversion path set from a conversion function library by using a graph path algorithm, wherein the conversion path set comprises at least one conversion path, and each conversion path comprises a conversion function used for converting a first data structure into a second data structure; obtaining a shortest path in the conversion path set to obtain a target conversion path; and acquiring a conversion function contained in the target conversion path to obtain a target function set.
In the case that the set of conversion paths cannot be obtained from the conversion function library, obtaining a new conversion function, wherein the new conversion function is used for converting the first data structure into the second data structure; the new conversion function is stored to the conversion function library.
Acquiring a first address of an input server and a second address of a client; a first data structure is retrieved based on the first address and a second data structure is retrieved based on the second address.
The query request carries identification information, wherein a conversion function list corresponding to the identification information is obtained; based on the list of conversion functions, the conversion functions are retrieved from the conversion database.
And under the condition that the target function set comprises a plurality of conversion functions, sequentially converting the data structure of the query data by using the plurality of conversion functions to obtain target data.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A data processing method, comprising:
acquiring query data returned by a server and a target function set corresponding to a client, wherein the query data corresponds to a query request sent by the client, and the target function set comprises at least one conversion function;
converting the data structure of the query data by using a conversion function contained in the target function set to obtain target data, wherein the data structure of the query data is the same as that of the server, and the data structure of the target data is the same as that of the client;
and sending the target data to the client.
2. The method according to claim 1, wherein before obtaining the set of objective functions corresponding to the client, the method further comprises:
acquiring a first data structure of the server and a second data structure of the client;
obtaining the set of objective functions for converting the first data structure into the second data structure;
and establishing a mapping relation between the client and the target function set.
3. The method of claim 2, wherein obtaining the set of objective functions for converting the first data structure to the second data structure comprises:
acquiring a conversion path set from a conversion function library by using a graph path algorithm, wherein the conversion path set comprises at least one conversion path, each conversion path comprises a conversion function used for converting the first data structure into the second data structure, and the number of the conversion functions in each conversion path is less than a preset number;
obtaining the shortest path in the conversion path set to obtain a target conversion path;
and acquiring a conversion function contained in the target conversion path to obtain the target function set.
4. The method of claim 3, further comprising:
in the case that the set of conversion paths cannot be obtained from the conversion function library, obtaining a new conversion function, wherein the new conversion function is used for converting the first data structure into the second data structure;
storing the new conversion function to the conversion function library.
5. The method of claim 2, wherein obtaining the first data structure of the server and the second data structure of the client comprises:
acquiring an input first address of the server and an input second address of the client;
the first data structure is retrieved based on the first address and the second data structure is retrieved based on the second address.
6. The method according to claim 1, wherein the query request carries identification information, and wherein obtaining the transfer function corresponding to the client comprises:
acquiring a conversion function list corresponding to the identification information;
and acquiring the conversion function from a conversion database based on the conversion function list.
7. The method of claim 1, wherein, when the objective function set includes a plurality of conversion functions, converting the data structure of the query data using the conversion functions included in the objective function set to obtain the objective data comprises:
and sequentially converting the data structure of the query data by using the plurality of conversion functions to obtain the target data.
8. A data processing apparatus, comprising:
the system comprises an acquisition module, a conversion module and a processing module, wherein the acquisition module is used for acquiring query data returned by a server and a target function set corresponding to a client, the query data corresponds to a query request sent by the client, and the target function set comprises at least one conversion function;
a conversion module, configured to convert a data structure of the query data by using a conversion function included in the target function set to obtain target data, where the data structure of the query data is the same as the data structure of the server and the data structure of the target data is the same as the data structure of the client;
and the sending module is used for sending the target data to the client.
9. An electronic device, characterized in that the device comprises at least one processor, and at least one memory, a bus connected to the processor; the processor and the memory complete mutual communication through the bus; the processor is configured to invoke program instructions in the memory to perform the data processing method of any of claims 1-7.
10. A storage medium on which a computer program is stored, which program, when being executed by a processor, carries out the data processing method of any one of claims 1 to 7.
CN201910913214.0A 2019-09-25 2019-09-25 Data processing method and device, electronic equipment and storage medium Pending CN112559605A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910913214.0A CN112559605A (en) 2019-09-25 2019-09-25 Data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910913214.0A CN112559605A (en) 2019-09-25 2019-09-25 Data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112559605A true CN112559605A (en) 2021-03-26

Family

ID=75029432

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910913214.0A Pending CN112559605A (en) 2019-09-25 2019-09-25 Data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112559605A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001075844A (en) * 1999-08-31 2001-03-23 Nec Corp Data conversion device and its recording medium
US20080208830A1 (en) * 2007-02-27 2008-08-28 Ql2 Software, Inc. Automated transformation of structured and unstructured content
US7565519B1 (en) * 2006-03-23 2009-07-21 Netapp, Inc. System and method for automatically upgrading/reverting configurations across a plurality of product release lines
CN102262560A (en) * 2010-05-27 2011-11-30 阿里巴巴集团控股有限公司 Calling method, device and system for remote service
CN103793384A (en) * 2012-10-26 2014-05-14 上海宝信软件股份有限公司 Commonly used client-side and server-side data binding method
CN105872083A (en) * 2016-05-19 2016-08-17 湖州微未信息科技有限公司 Method and system supporting server access by different types of clients as well as server
CN108664546A (en) * 2018-03-26 2018-10-16 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Xml data structure conversion method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001075844A (en) * 1999-08-31 2001-03-23 Nec Corp Data conversion device and its recording medium
US7565519B1 (en) * 2006-03-23 2009-07-21 Netapp, Inc. System and method for automatically upgrading/reverting configurations across a plurality of product release lines
US20080208830A1 (en) * 2007-02-27 2008-08-28 Ql2 Software, Inc. Automated transformation of structured and unstructured content
CN102262560A (en) * 2010-05-27 2011-11-30 阿里巴巴集团控股有限公司 Calling method, device and system for remote service
CN103793384A (en) * 2012-10-26 2014-05-14 上海宝信软件股份有限公司 Commonly used client-side and server-side data binding method
CN105872083A (en) * 2016-05-19 2016-08-17 湖州微未信息科技有限公司 Method and system supporting server access by different types of clients as well as server
CN108664546A (en) * 2018-03-26 2018-10-16 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Xml data structure conversion method and device

Similar Documents

Publication Publication Date Title
CN109088764A (en) Access request processing method and relevant device
CN103747112A (en) CDN back-to-source method, first server and system thereof
CN104243627A (en) Domain name resolution method, device and system
CN107566477B (en) Method and device for acquiring files in distributed file system cluster
CN107135242B (en) Mongodb cluster access method, device and system
CN110413845B (en) Resource storage method and device based on Internet of things operating system
CN111786984B (en) Pod communication connection method and device, electronic equipment and storage medium
US20160191652A1 (en) Data storage method and apparatus
US20170214734A1 (en) Methods and apparatuses for information transmission
CN104767839A (en) IP positioning method and device
WO2016044176A1 (en) Data processing method and apparatus in service-oriented architecture system, and the service-oriented architecture system
CN105141653A (en) Method, equipment and system for data interaction of service platform
CN111222592B (en) Method and device for acquiring two-dimensional code of equipment
CN114218165A (en) File downloading method and device, computer equipment and medium
CN108124021B (en) Method, device and system for obtaining Internet Protocol (IP) address and accessing website
CN115277816B (en) Service adaptation method, device, system and computer readable medium
CN114640657A (en) Multi-registration center fusion method and device
CN110958278B (en) API gateway-based data processing method and system and API gateway
CN112307058A (en) Short link processing method and device, storage medium and computer equipment
CN104092751A (en) Service access method and device
CN112559605A (en) Data processing method and device, electronic equipment and storage medium
CN108647139B (en) System test method, device, storage medium and electronic device
CN106899652B (en) Method and device for pushing service processing result
CN115021831A (en) Weak network testing method, device, system, equipment and storage medium
CN114143332A (en) Content delivery network CDN-based processing method, electronic device and 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