CN111984720A - Data acquisition method and device, electronic equipment and interface adaptation device - Google Patents

Data acquisition method and device, electronic equipment and interface adaptation device Download PDF

Info

Publication number
CN111984720A
CN111984720A CN202010956209.0A CN202010956209A CN111984720A CN 111984720 A CN111984720 A CN 111984720A CN 202010956209 A CN202010956209 A CN 202010956209A CN 111984720 A CN111984720 A CN 111984720A
Authority
CN
China
Prior art keywords
data
request
module
response
data request
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
CN202010956209.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.)
Get Tianjin Culture Communication Co ltd
Original Assignee
Get Tianjin Culture Communication 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 Get Tianjin Culture Communication Co ltd filed Critical Get Tianjin Culture Communication Co ltd
Priority to CN202010956209.0A priority Critical patent/CN111984720A/en
Publication of CN111984720A publication Critical patent/CN111984720A/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 present application relates to the field of computer technologies, and in particular, to a data acquisition method and apparatus, an electronic device, and an interface adaptation apparatus. The method comprises the following steps: receiving a first data request of a data requester; determining a second data request based on the first data request, and sending the second data request to a data provider so that the data provider determines response data according to the second data request; receiving response data fed back by the data provider; determining a data conversion rule according to the first data request, and converting the response data into target data according to the data conversion rule; and sending the target data to the data requester. The scheme can improve the interaction efficiency between services, save research and development resources and improve maintainability.

Description

Data acquisition method and device, electronic equipment and interface adaptation device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data acquisition method and apparatus, an electronic device, and an interface adaptation apparatus.
Background
Micro-services were originally proposed by Martin Fowler and James Lewis in 2014, the micro-service architecture style is a way to develop a single application using a set of small services, each service runs in its own process and communicates using a lightweight mechanism, usually HTTP API, these services are built based on business capabilities and can be deployed independently through an automated deployment mechanism, these services are implemented using different programming languages and different data storage technologies, and keep a minimum of centralized management.
In the background of the prior art, a large number of micro services are subjected to interface interaction, the data model requirements needed by the micro services are often inconsistent, and a large number of interface adaptation works are needed. This part of the work is often manually implemented, which consumes a lot of resources, and the subsequent change brings maintenance difficulty.
In view of this, the present application is specifically made.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide a data acquisition method, an apparatus, an electronic device, and an interface adaptation apparatus, so as to improve interaction efficiency between services, save research and development resources, and improve maintainability.
The embodiment of the specification adopts the following technical scheme:
an embodiment of the present specification provides a data acquisition method, including:
receiving a first data request of a data requester;
determining a second data request based on the first data request, and sending the second data request to a data provider so that the data provider determines response data according to the second data request;
receiving response data fed back by the data provider;
determining a data conversion rule according to the first data request, and converting the response data into target data according to the data conversion rule;
and sending the target data to the data requester.
An embodiment of the present specification further provides a data acquisition method, including:
receiving a first data request of a data requester;
determining a second data request based on the first data request, and sending the second data request to a data provider so that the data provider determines response data according to the second data request;
receiving response data fed back by the data provider;
judging whether the response data is the target data of the first data request;
if not, determining a data conversion rule according to the first data request, and converting the response data into target data according to the data conversion rule;
and sending the target data to the data requester.
An embodiment of the present specification further provides a data acquisition apparatus, including:
a first receiving unit, configured to receive a first data request of a data requester;
a first sending unit configured to determine a second data request based on the first data request, and send the second data request to a data provider, so that the data provider determines response data according to the second data request;
a second receiving unit, configured to receive response data fed back by the data provider;
the conversion unit is used for determining a data conversion rule according to the first data request and converting the response data into target data according to the data conversion rule;
a second sending unit, configured to send the target data to the data requestor.
An embodiment of the present specification further provides a data acquisition apparatus, including:
the first receiving module is used for receiving a first data request of a data requester;
a first sending module, configured to determine a second data request based on the first data request, and send the second data request to a data provider, so that the data provider determines response data according to the second data request;
the second receiving module is used for receiving response data fed back by the data provider;
the judging module is used for judging whether the response data is the target data of the first data request;
a conversion module, configured to determine a data conversion rule according to the first data request if the response data is not target data of the first data request, where the conversion module is configured to convert the response data into the target data according to the data conversion rule;
a second sending module, configured to send the target data to the data requestor.
The present specification further provides an interface adaptation apparatus based on dynamic rules, including: the interface dynamic adaptation component is configured with a preset rule between the request module and the response module;
the interface dynamic adaptation component is used for receiving a first data request sent by a request module, determining a second data request based on the first data request, and sending the second data request to a data provider so as to enable the response module to determine response data according to the second data request;
the interface dynamic adaptation component is further configured to receive response data fed back by the response module, and:
determining a preset rule between the request module and the response module according to the first data request, determining a data conversion rule according to the preset rule, and converting the response data into target data according to the data conversion rule;
the interface dynamic adaptation component is further configured to send the target data to the request module.
The present description also provides an electronic device comprising: at least one processor and a memory, the memory storing a program and configured to execute the above-described dynamic rule based interface adaptation method by the at least one processor.
The present description also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the dynamic rule-based interface adaptation method described above.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects: according to the scheme of the specification, response data of the data provider is modified according to the data conversion rule determined by the first data request, so that the data requester obtains required target data. Therefore, the efficiency of mutual communication and interaction between the service layer and the data requester and the data provider can be effectively improved. Effectively saves research and development resources, automatically expands the support for the newly added service, and improves the stability and maintainability of the software system. In addition, by adopting the scheme of the specification, the reverse adaptation of the interface interaction between the data requester and the data provider can be realized, and the implementation of the dependence inversion idea in the field of software engineering can be well supported without additional development work.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the specification, and for those skilled in the art, other drawings can be obtained according to the drawings without inventive exercise:
fig. 1 is a main flowchart of a data acquisition method provided in an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a data acquisition apparatus according to a first embodiment of the present disclosure;
fig. 3 is a main flowchart of a data acquisition method provided in the second embodiment of the present specification;
fig. 4 is a schematic structural diagram of a data acquisition apparatus provided in the second embodiment of this specification;
fig. 5 is a block diagram of a structure of an interface adaptation apparatus based on dynamic rules provided in an embodiment of the present specification.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, 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, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
As mentioned in the background, a large number of microservices interact with each other via an interface, often requiring inconsistent data models. For convenience of understanding, the present specification takes the example of interface interaction between micro services, and briefly describes the basic principle of the method, which is as follows:
referring to fig. 1, fig. 1 is a main flowchart of a data acquisition method according to an embodiment of the present disclosure. The method comprises the following steps:
s110: a first data request of a data requestor is received.
As an example, the execution subject of this step may be a pre-configured rule module (hereinafter referred to as an adaptation module), and the data requester takes micro service a as an example. That is, the microservice a sends a first data request, and the adaptation module receives the first data request sent by the microservice a.
S120: and determining a second data request based on the first data request, and sending the second data request to a data provider so that the data provider determines response data according to the second data request.
As an example, the data provider in this step takes microservice B as an example. The adaptation module may determine the type of data requested by the microservice B from the first data request and then determine the second data request from the data type. For example, the adaptation module determines that the data type required by the microservice B is time according to the first data request, and the generated second data request is the data type requested from the microservice B. In this way, the microservice B determines the type of data requested as time from the second data request and then determines the response data as time from the data type.
Optionally, the adaptation module may also directly forward the first data request to the microservice B, so that the microservice B determines the response data according to the first data request. Alternatively, the adaptation module may determine the data requester according to the first data request, and then determine the second data request according to the data required by the data requester. The specification does not limit the specific manner in which the second data request is determined from the first data request.
S130: and receiving response data fed back by the data provider.
In this step, the data provider sends the response data to the adaptation module.
S140: and determining a data conversion rule according to the first data request, and converting the response data into target data according to the data conversion rule.
In this step, a rule pre-configured between the data requester and the data provider of the first data request may be determined according to the first data request. For example, an association between a data model required by the data requestor and a data model provided by a data provider may be established. As an example, for any micro service that needs to interact, some interaction rules between these micro services are established in advance, for example, for micro service a and micro service B, interaction rules between micro service a and micro service B are established, and then the established rules are stored in the adaptation module. In this way, after the adaptation module determines the rule pre-configured between the microservice a and the microservice B, the data conversion rule applicable to the microservice a and the microservice B can be determined, and the response data is converted into the target data according to the data conversion rule.
Wherein the response data is a data model provided by the data provider based on the second data request; the target data is a data model required by the data requester. For example, if the original data provided by the microservice B is a timestamp and the time format required by the request data sent by the microservice a is year/month/day, at this time, the adaptation module modifies the data responded by the microservice B according to the determined data conversion rule between the microservice a and the microservice B to obtain the target data with the time format of year/month/day.
S150: and sending the target data to the data requester.
As an example, in this step, the adaptation module sends the obtained mesh data in time format of year/month/day to microservice a.
In the above steps S110-S150, as another example, the original data model provided by the micro service B may also be of another type, for example, the original data model may be attribute information of a person, including name, gender, native place, ethnicity, age, and the like, and the type of data required by the micro service a is the gender and age of the person, and after the first data request sent by the micro service a is received by the adaptation module, the second data request is determined based on the first data request and sent to the data providing method, and response data fed back by the data provider, that is, all attribute information of the person, is obtained. The further adaptation module modifies the response data fed back by the micro service B according to the determined data conversion rule between the micro service A and the micro service B to obtain target data of which the data type only comprises the gender and the age of a certain person, and then sends the target data to the micro service A. In this embodiment, the data provider may be a micro service module or other application program, which is not limited in this specification.
For the data acquisition method provided by the specification, in one scenario, there may be a plurality of data requesters, and when different data requesters request data from data providers, the data types and data formats required by the different data requesters are different, and the data formats provided by the data providers are usually fixed. Further, the data requester in the present specification may also serve as a data provider, and the data provider may also serve as a data requester. For example, both a data requester and a data provider in this specification may be microservices, and different microservices may interact with each other, and at this time, an adaptation module may be configured for each microservice, and when data is acquired, the configured adaptation module is used to execute the above method.
In addition, in the above example, the microservice a is equivalent to a high-level module, the microservice B is equivalent to a low-level module, and the response data of the microservice B is modified to adapt to the microservice a, so that the inverse adaptation of a microservice interface can be realized, no additional interface development work is required, and the implementation of the inverse idea depending on the software engineering field can be well supported.
Based on the same idea, this specification also provides a data acquisition device. Referring to fig. 2, fig. 2 is a schematic structural diagram of a data acquisition apparatus according to a first embodiment of the present disclosure. As shown in fig. 2, the apparatus includes:
a first receiving unit 201, wherein the first receiving unit 201 is used for receiving a first data request of a data requester;
a first sending unit 202, where the first sending unit 202 is configured to determine a second data request based on the first data request, and send the second data request to a data provider, so that the data provider determines response data according to the second data request;
a second receiving unit 203, wherein the second receiving unit 203 is configured to receive response data fed back by the data provider;
a conversion unit 204, wherein the conversion unit 204 is configured to determine a data conversion rule according to the first data request, and convert the response data into target data according to the data conversion rule;
a second sending unit 205, where the second sending unit 205 is configured to send the target data to the data requester.
For the specific implementation of the device, reference is made to the above description of the method, which is not repeated here.
The present specification also provides a data acquisition method of another embodiment. Referring to fig. 3, fig. 3 is a main flowchart of a data acquisition method provided in the second embodiment of this specification. The method of the second embodiment comprises the following steps:
s310: receiving a first data request of a data requester;
s320: determining a second data request based on the first data request, and sending the second data request to a data provider so that the data provider determines response data according to the second data request;
s330: receiving response data fed back by the data provider;
s340: judging whether the response data is the target data of the first data request;
s350: if not, determining a data conversion rule according to the first data request, and converting the response data into target data according to the data conversion rule;
s360: and sending the target data to the data requester.
Compared with the first embodiment, the second embodiment determines whether the response data is the target data of the first data request, and then determines whether to modify the response data according to the determination result, and if the determination result is consistent, that is, if the data model required by the data requester is the same as the data model of the response data, the response data does not need to be modified. And modifying the response data according to the determined conversion rule under the condition that the judgment results are inconsistent. In contrast, in the application scenario of the first embodiment, when the data requester requests data from the data provider, it is already determined that the data model provided by the data requester is inconsistent with the data model required by the data requester, and at this time, it is not necessary to perform judgment, but the response data of the data provider is directly modified according to the determined conversion rule. For the detailed description of the other steps in example two, see above, and are not repeated herein.
Based on the same idea as in the second embodiment, the present specification further provides a data acquisition device. Referring to fig. 4, fig. 4 is a schematic structural diagram of a data acquisition apparatus according to a second embodiment of the present specification. As shown in fig. 4, the apparatus includes:
a first receiving module 401, where the first receiving module 401 is configured to receive a first data request of a data requester;
a first sending module 402, wherein the first sending module 402 is configured to determine a second data request based on the first data request, and send the second data request to a data provider, so that the data provider determines response data according to the second data request;
a second receiving module 403, where the second receiving module 403 is configured to receive response data fed back by the data provider;
a determining module 404, where the determining module 404 is configured to determine whether the response data is target data of the first data request;
a conversion module 405, configured to determine a data conversion rule according to the first data request if the response data is not target data of the first data request, where the conversion module is configured to convert the response data into the target data according to the data conversion rule;
a second sending module 406, where the second sending module 406 is configured to send the target data to the data requester.
For the specific implementation of the device, reference is made to the above description of the method, which is not repeated here.
In a more specific implementation manner, referring to fig. 5, fig. 5 is a block diagram of a structure of an interface adaptation apparatus based on dynamic rules according to an embodiment of the present disclosure. As shown in fig. 5, the apparatus includes:
an interface dynamic adaptation component 501, where the interface dynamic adaptation component 501 is configured with a preset rule between a request module and a response module. By way of example, the interface dynamic adaptation component 501 can be configured for a responding module and contain pre-established rule information between different requesting modules and the responding module.
The interface dynamic adaptation component 501 is configured to receive a first data request sent by a request module, determine a second data request based on the first data request, and send the second data request to a data provider, so that the response module determines response data according to the second data request.
Taking FIG. 5 as an example, two request modules are shown in FIG. 5: microservice a and microservice C; a response module: and B, micro service. Wherein, the micro service B is configured with a corresponding preset rule. The micro service a and the micro service C respectively request data from the micro service C, the interface dynamic adaptation component 501 respectively receives first data requests sent by the micro service a and the micro service C, then determines a second data request for the micro service a based on the first data request of the micro service a, and determines a second data request for the micro service C based on the first data request of the micro service C, and further sends the second data request to the micro service B, and the micro service B respectively determines response data for the micro service a and the micro service B according to the second data request.
The interface dynamic adaptation component 501 is further configured to receive response data fed back by the response module, and: determining a preset rule between the request module and the response module according to the first data request, determining a data conversion rule according to the preset rule, and converting the response data into target data according to the data conversion rule. Specifically, the interface dynamic adaptation component 501 determines a data conversion rule for the microservice a according to a preset rule between the microservice a and the microservice B, and then modifies response data for the microservice a according to the conversion rule to obtain a data format required by the microservice a; similarly, the interface dynamic adaptation component 501 determines a data conversion rule for the microservice C according to a preset rule between the microservice C and the microservice B, and then modifies the response data for the microservice C according to the conversion rule to obtain a data format required by the microservice C.
The interface dynamic adaptation component 501 is further configured to send the target data to the requesting module. That is, the interface dynamic adaptation component 501 sends the modified target data for the microservice a to the microservice a, and sends the modified target data for the microservice C to the microservice C.
Further, the apparatus further includes a configuration module 502, where the configuration module 502 is configured to configure a preset rule for the interface dynamic adaptation component 501. Optionally, the apparatus further includes a configuration interface 503, where the configuration interface 503 is configured to input a preset rule to the configuration module 502, so that the configuration module 502 configures the preset rule to the interface dynamic adaptation component 501. The user can input corresponding rules to the configuration module 502 through the configuration interface 503, and can configure the corresponding rules to the interface dynamic adaptation component 501.
In the above device, each microservice provides a large number of external interfaces, and there are cases where the data model required between different microservices is inconsistent, for example, microservice a requests data of microservice B, and the data format required by microservice a is year/month/day, and the data format provided by microservice B is timestamp. Therefore, when the micro-service is developed, an interface dynamic adaptation component is configured for each micro-service, and the interface dynamic adaptation component is configured with corresponding rules in advance. For the current micro service, when other application programs or micro services request the current micro service data, the interface dynamic adaptation component modifies the data model provided by the current micro service according to the data model required by other application programs or micro services and a preset rule, so that the data model output by the current micro service conforms to the data model requested by other application programs or micro services. Therefore, efficient and effective adaptation can be realized, the stability of the core service is ensured, and the service efficiency is greatly improved.
As described above, in the method and apparatus provided in this specification, the inverse adaptation may be performed on the interface between the microservices, and the implementation of the inverse concept dependent on the software engineering field may be well supported without additional development work. The efficiency of mutual communication and interaction between the service level and the micro-service can be effectively improved. Effectively saves research and development resources, automatically expands the support for the newly added service, and improves the stability and maintainability of the software system.
Based on the same idea, this specification also provides an electronic device, including: at least one processor and a memory, the memory storing a program and configured to execute the data acquisition method of the first and second embodiments by the at least one processor.
Based on the same idea, the present specification further provides a computer-readable storage medium, where computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the data acquisition method of the first embodiment and the data acquisition method of the second embodiment are implemented.
While certain embodiments of the present disclosure have been described above, other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily have to be in the particular order shown or in sequential order to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device, and non-volatile computer-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some portions of the description of the method embodiments.
The apparatus, the device, the nonvolatile computer readable storage medium, and the method provided in the embodiments of the present specification correspond to each other, and therefore, the apparatus, the device, and the nonvolatile computer storage medium also have similar advantageous technical effects to the corresponding method.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description 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 so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. 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.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). 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 disk storage or other magnetic storage devices, or any other non-transmission medium which 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 like elements in a process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is 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 (14)

1. A method for data acquisition, the method comprising:
receiving a first data request of a data requester;
determining a second data request based on the first data request, and sending the second data request to a data provider so that the data provider determines response data according to the second data request;
receiving response data fed back by the data provider;
determining a data conversion rule according to the first data request, and converting the response data into target data according to the data conversion rule;
and sending the target data to the data requester.
2. The method according to claim 1, wherein determining a second data request based on the first data request specifically comprises:
determining the type of data requested by the data requester according to the first data request;
and determining the second data request according to the data type.
3. The method according to claim 2, wherein the data provider determines response data according to the second data request, specifically comprising:
and the data provider determines the requested data type according to the second data request and determines the response data according to the data type.
4. The method according to claim 3, wherein determining a data transformation rule according to the first data request specifically comprises:
and determining a rule pre-configured between a data requester of the first data request and the data provider according to the first data request, and determining the data conversion rule according to the pre-configured rule.
5. The method of any of claims 1 to 4, wherein the data requestor is a microservice module; and/or
The data provider is a micro service module.
6. A method for data acquisition, the method comprising:
receiving a first data request of a data requester;
determining a second data request based on the first data request, and sending the second data request to a data provider so that the data provider determines response data according to the second data request;
receiving response data fed back by the data provider;
judging whether the response data is the target data of the first data request;
if not, determining a data conversion rule according to the first data request, and converting the response data into target data according to the data conversion rule;
and sending the target data to the data requester.
7. A data acquisition apparatus, characterized in that the apparatus comprises:
a first receiving unit, configured to receive a first data request of a data requester;
a first sending unit configured to determine a second data request based on the first data request, and send the second data request to a data provider, so that the data provider determines response data according to the second data request;
a second receiving unit, configured to receive response data fed back by the data provider;
the conversion unit is used for determining a data conversion rule according to the first data request and converting the response data into target data according to the data conversion rule;
a second sending unit, configured to send the target data to the data requestor.
8. A data acquisition apparatus, characterized in that the apparatus comprises:
the first receiving module is used for receiving a first data request of a data requester;
a first sending module, configured to determine a second data request based on the first data request, and send the second data request to a data provider, so that the data provider determines response data according to the second data request;
the second receiving module is used for receiving response data fed back by the data provider;
the judging module is used for judging whether the response data is the target data of the first data request;
a conversion module, configured to determine a data conversion rule according to the first data request if the response data is not target data of the first data request, where the conversion module is configured to convert the response data into the target data according to the data conversion rule;
a second sending module, configured to send the target data to the data requestor.
9. An interface adaptation apparatus based on dynamic rules, the apparatus comprising: the interface dynamic adaptation component is configured with a preset rule between the request module and the response module;
the interface dynamic adaptation component is used for receiving a first data request sent by a request module, determining a second data request based on the first data request, and sending the second data request to a data provider so as to enable the response module to determine response data according to the second data request;
the interface dynamic adaptation component is further configured to receive response data fed back by the response module, and:
determining a preset rule between the request module and the response module according to the first data request, determining a data conversion rule according to the preset rule, and converting the response data into target data according to the data conversion rule;
the interface dynamic adaptation component is further configured to send the target data to the request module.
10. The apparatus of claim 9, further comprising:
and the configuration module is used for configuring a preset rule for the interface dynamic adaptation component.
11. The apparatus of claim 10, further comprising:
and the configuration interface is used for inputting preset rules to the configuration module so that the configuration module configures the preset rules to the interface dynamic adaptation component.
12. The apparatus of any one of claims 9 to 11, wherein the response module is a micro-service module; and/or
The request module is a micro-service module.
13. An electronic device, comprising: at least one processor and a memory, the memory storing a program and configured to perform the data acquisition method of any one of claims 1 to 5, 6 by the at least one processor.
14. A computer-readable storage medium storing computer-executable instructions which, when executed by a processor, implement the data acquisition method of any one of claims 1 to 5, 6.
CN202010956209.0A 2020-09-11 2020-09-11 Data acquisition method and device, electronic equipment and interface adaptation device Pending CN111984720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010956209.0A CN111984720A (en) 2020-09-11 2020-09-11 Data acquisition method and device, electronic equipment and interface adaptation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010956209.0A CN111984720A (en) 2020-09-11 2020-09-11 Data acquisition method and device, electronic equipment and interface adaptation device

Publications (1)

Publication Number Publication Date
CN111984720A true CN111984720A (en) 2020-11-24

Family

ID=73449345

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010956209.0A Pending CN111984720A (en) 2020-09-11 2020-09-11 Data acquisition method and device, electronic equipment and interface adaptation device

Country Status (1)

Country Link
CN (1) CN111984720A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095479A (en) * 2011-11-04 2013-05-08 华为技术有限公司 Method and device of business configuration
CN109214196A (en) * 2018-08-13 2019-01-15 阿里巴巴集团控股有限公司 A kind of data interactive method, device and equipment
CN110557284A (en) * 2019-08-30 2019-12-10 贝壳技术有限公司 data aggregation method and device based on client gateway
CN111638972A (en) * 2020-05-07 2020-09-08 北京仁科互动网络技术有限公司 Request response method, system, equipment and storage medium based on micro-service

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095479A (en) * 2011-11-04 2013-05-08 华为技术有限公司 Method and device of business configuration
CN109214196A (en) * 2018-08-13 2019-01-15 阿里巴巴集团控股有限公司 A kind of data interactive method, device and equipment
CN110557284A (en) * 2019-08-30 2019-12-10 贝壳技术有限公司 data aggregation method and device based on client gateway
CN111638972A (en) * 2020-05-07 2020-09-08 北京仁科互动网络技术有限公司 Request response method, system, equipment and storage medium based on micro-service

Similar Documents

Publication Publication Date Title
CN107450981B (en) Block chain consensus method and equipment
CN107450979B (en) Block chain consensus method and device
CN108958796B (en) Service request processing method and device and service request processing system
CN107577694B (en) Data processing method and device based on block chain
CN108628688B (en) Message processing method, device and equipment
CN108845876B (en) Service distribution method and device
CN107786630B (en) Web application package processing method, device and equipment
CN116126365B (en) Model deployment method, system, storage medium and electronic equipment
CN109725989B (en) Task execution method and device
CN107578338B (en) Service publishing method, device and equipment
CN110032409B (en) Client screen adapting method and device and electronic equipment
CN112597013A (en) Online development and debugging method and device
CN111767499A (en) Page configuration method and device
CN113536174A (en) Interface loading method, device and equipment
CN107391529B (en) Method and device for realizing Object Relation Mapping (ORM)
CN112181378B (en) Method and device for realizing business process
CN110022351B (en) Service request processing method and device
CN108769152B (en) Service refresh policy registration method, service refresh request method, device and equipment
CN111459573A (en) Method and device for starting intelligent contract execution environment
CN111984720A (en) Data acquisition method and device, electronic equipment and interface adaptation device
US11176161B2 (en) Data processing method, apparatus, and device
CN111158940B (en) Method and device for docking and dynamically loading different devices in field of Internet of things
CN114625410A (en) Request message processing method, device and equipment
CN112596780A (en) Service execution method and device
CN111796864A (en) Data verification method and device

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