CN114490752A - Data acquisition method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN114490752A
CN114490752A CN202111671070.6A CN202111671070A CN114490752A CN 114490752 A CN114490752 A CN 114490752A CN 202111671070 A CN202111671070 A CN 202111671070A CN 114490752 A CN114490752 A CN 114490752A
Authority
CN
China
Prior art keywords
request
access
party interface
cache server
accessing
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
CN202111671070.6A
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 SoundAI Technology Co Ltd
Original Assignee
Beijing SoundAI 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 SoundAI Technology Co Ltd filed Critical Beijing SoundAI Technology Co Ltd
Priority to CN202111671070.6A priority Critical patent/CN114490752A/en
Publication of CN114490752A publication Critical patent/CN114490752A/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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure relates to a data acquisition method, apparatus, electronic device and storage medium, comprising: responding to an access request, accessing a cache server, wherein the access request comprises request parameters, and caching historical request data returned based on a third-party interface in historical access requests in the cache server; when the cache server comprises the request data corresponding to the request parameters, the request data are obtained and returned to the terminal equipment, the times of accessing the third-party interface are reduced, the stability of the third-party interface is ensured, and the stability of the service system is further ensured.

Description

Data acquisition method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of data acquisition technologies, and in particular, to a data acquisition method and apparatus, an electronic device, and a storage medium.
Background
With the development of internet technology, more and more functional products need to call a third-party interface to acquire data, that is, data is acquired based on a service provided by the third-party interface.
In the process of acquiring data based on the third-party interface, if the third-party interface is frequently called, the stability of the third-party interface is affected, and further, the stability of a service system is affected due to the fact that calling fails.
In order to ensure the stability of the service system, a data acquisition method is urgently needed.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present disclosure provides a data acquisition method, an apparatus, an electronic device, and a storage medium, which reduce the number of times of accessing a third-party interface and ensure the stability of the third-party interface.
In a first aspect, an embodiment of the present disclosure provides a data acquisition method, including:
responding to an access request, accessing a cache server, wherein the access request comprises request parameters, and caching historical request data returned based on a third-party interface in historical access requests in the cache server;
and when the cache server comprises the request data corresponding to the request parameters, acquiring the request data and returning the request data to the terminal equipment.
Optionally, the access request further includes an access path;
the method further comprises the following steps:
accessing a third-party interface based on the access request when the cache server does not include request data corresponding to the request parameters, wherein the third-party interface corresponds to the access path;
and receiving request data corresponding to the request parameters returned by the third-party interface.
Optionally, the method further includes:
and when request data corresponding to the request parameters returned by the third-party interface is not received, determining a service node according to the relationship between the access times of accessing the third-party interface and the preset access times.
Optionally, the third-party interface includes an interface proxy server and at least two service nodes in communication connection with the interface proxy server;
when the request data corresponding to the request parameters and returned by the third-party interface is not received, determining the service node according to the relationship between the access times of accessing the third-party interface and the preset access times, including:
when the request data corresponding to the request parameters acquired by the third-party interface is not received, acquiring the access times of the access request for accessing the third-party interface;
when the access times are less than or equal to the preset access times, determining that the access request accesses the service node corresponding to the third-party interface for the first time;
and accessing any service node except the service node corresponding to the third-party interface for the first time based on the access request.
Optionally, before accessing the cache server in response to the access request, the method further includes:
and storing the historical request data to the cache server based on the historical request data acquired by the historical access request, wherein the historical request data is stored in the cache server according to a preset storage time length.
Optionally, before accessing the cache server in response to the access request, the method further includes:
and regularly simulating to access the third-party interface to acquire state information of the third-party interface, wherein the state information comprises access duration and access state.
Optionally, the method further includes:
and when the access duration is greater than a preset access duration and/or the access state is an abnormal state, sending the abnormal information of the third-party interface to target terminal equipment.
In a second aspect, an embodiment of the present disclosure provides a data acquisition apparatus, including:
the access module is used for responding to an access request and accessing a cache server, wherein the access request comprises request parameters, and history request data returned based on a third-party interface in history access requests are cached in the cache server;
and the data acquisition module is used for acquiring the cache data and returning the cache data to the terminal equipment when the cache server comprises the request data corresponding to the request parameters.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method as in any one of the first aspects.
In a fourth aspect, the embodiments of the present disclosure provide a computer storage medium on which a computer program is stored, which when executed by a processor, implements the method according to any one of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
in the data acquisition method, the device, the electronic device, and the storage medium provided by the embodiments of the present disclosure, in response to an access request, accessing a cache server, caching historical request data returned based on a third-party interface in the historical access request in the cache server, and when the cache server includes request data corresponding to a request parameter, acquiring the request data and returning the request data to a terminal device, that is, in the data acquisition method provided by the embodiments of the present disclosure, after an access request initiated by the terminal device is acquired, instead of directly accessing a third-party interface, the cache server is accessed first, whether the request data corresponding to the request parameter of the access request is included is searched from the cache server first, and when the cache server includes request data corresponding to the request parameter of the access request, the request data is acquired and the request data is returned to the terminal device, compared with the prior art, the third-party interface is directly accessed after the access request is obtained, the number of times of accessing the third-party interface is reduced, the stability of the third-party interface is ensured, and the stability of a service system is further ensured.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flow chart diagram of a data acquisition method provided in an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart diagram of another data acquisition method provided by the embodiments of the present disclosure;
fig. 3 is a schematic flow chart diagram of another data acquisition method provided by the embodiment of the present disclosure;
fig. 4 is a schematic flow chart diagram of another data acquisition method provided by the embodiment of the present disclosure;
fig. 5 is a schematic flow chart diagram of another data acquisition method provided by the embodiment of the present disclosure;
fig. 6 is a schematic flow chart of another data acquisition apparatus provided in the embodiments of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
When data is acquired based on the third-party interface, if the third-party interface is frequently called, the stability of the third-party interface is influenced, and further the stability of a service system is influenced.
Based on this, the embodiment of the present disclosure provides a data acquisition method, including: responding to an access request, and accessing a cache server, wherein the access request comprises a request parameter; and when the cache server comprises the request data corresponding to the request parameters, acquiring the request data and returning the request data to the terminal equipment. That is, in the data obtaining method provided in this disclosure, after obtaining an access request initiated by a terminal device, instead of directly accessing a third-party interface, a cache server is accessed first, and whether request data corresponding to a request parameter of the access request is included is searched from the cache server first, and when the cache server includes the request data corresponding to the request parameter of the access request, the request data is obtained and the request data is returned to the terminal device.
The data acquisition method provided by the embodiment of the disclosure is executed by the electronic device or a server corresponding to an application program, a webpage, a public number and the like in the electronic device. The electronic device may be a tablet computer, a mobile phone, a wearable device, an in-vehicle device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), a smart television, a smart screen, a high definition television, a 4K television, a smart speaker, a smart projector, and the like, and the specific type of the electronic device is not limited in this disclosure.
The present disclosure does not limit the type of operating system of the electronic device. For example, an Android system, a Linux system, a Windows system, an iOS system, etc.
Based on the foregoing description, the embodiment of the present disclosure will use an electronic device as an example, and details a data acquisition method provided by the present disclosure are set forth in combination with an application scenario.
As shown in fig. 1, the data acquisition method includes:
and S10, responding to the access request, and accessing the cache server.
The access request comprises request parameters, and history request data returned based on the third-party interface in the history access request are cached in the cache server.
The access request includes a request for obtaining certain data, or a request for obtaining a certain state, and the like.
The request parameter is a parameter corresponding to request data acquired by the access request, and the process of acquiring the request data from the cache server is to acquire the request data corresponding to the request parameter from the cache server.
Specifically, the cache server stores the request parameters and the request data corresponding to the request parameters, after receiving the access request, searches whether the cache server includes the request parameters of the access request or not based on the request parameters in the access request, and when the cache server includes the request parameters of the access request, acquires the request data corresponding to the request parameters.
The cache server is a memory server corresponding to the electronic device that initiates the access request, and specifically, when the access request is an application program in the electronic device, the cache server is a memory server corresponding to the application program in the electronic device that initiates the access request.
The cache server stores history request data corresponding to the history request parameters acquired based on the history access request.
And S20, when the cache server comprises the request data corresponding to the request parameters, acquiring the request data and returning the request data to the terminal equipment.
And when the cache server comprises the request parameters of the access request, acquiring the request data corresponding to the request parameters from the cache server.
In the historical access request, the cache server stores the request data acquired in the historical access request, so that after the access request is triggered, the cache server firstly searches whether the cache server stores the request data corresponding to the request parameter of the access request or not, the frequency of accessing the third-party interface is reduced, and the stability of the third-party interface is ensured.
The data obtaining method provided by the embodiment of the disclosure accesses the cache server in response to the access request, and obtains the request data and returns the request data to the terminal device when the cache server includes the request data corresponding to the request parameter, that is, in the data obtaining method provided by the embodiment of the disclosure, after obtaining the access request initiated by the terminal device, the cache server is accessed first, instead of directly accessing the third-party interface, and first, whether the request data corresponding to the request parameter of the access request is included is searched from the cache server, and when the cache server includes the request data corresponding to the request parameter of the access request, the request data is obtained and the request data is returned to the terminal device, compared with the prior art, the third-party interface is accessed directly after obtaining the access request, and the number of times of accessing the third-party interface is reduced in the embodiment of the disclosure, and the stability of the third-party interface is ensured, and further the stability of the service system is ensured.
Fig. 2 is a schematic flow diagram of another data acquisition method provided in the embodiment of the present disclosure, and on the basis of the foregoing embodiment, as shown in fig. 2, after step S10, the embodiment of the present disclosure further includes:
and S30, when the cache server does not include the request data corresponding to the request parameter, accessing the third-party interface based on the access request.
The access request further comprises an access path, and the third-party interface corresponds to the access path.
And when the request data corresponding to the request parameters are not included in the cache server, accessing the third-party interface based on the access path of the access request, wherein the accessed third-party interface is determined based on the access path of the access request.
Specifically, the third-party interface includes a third-party interface a, a third-party interface B and a third-party interface C, the third-party interface a corresponds to the access path a, the third-party interface B corresponds to the access path B, and the third-party interface C corresponds to the access path C, when the access path in the access request is the access path a, the third-party interface a is accessed, when the access path in the access request is the access path B, the third-party interface B is accessed, and when the access path in the access request is the access path C, the third-party interface C is accessed.
And S40, receiving request data corresponding to the request parameters returned by the third-party interface.
And after the third-party interface is accessed based on the access request, the third-party interface returns the request data corresponding to the request parameter of the access request.
Specifically, after the third-party interface receives the access request, request data corresponding to the request parameter of the access request is searched for based on the request parameter in the access request, and the request data corresponding to the request parameter is returned, so that when the cache server does not include the request data corresponding to the request parameter of the access request, the request data corresponding to the request parameter of the access request can be acquired based on the third-party interface.
According to the data acquisition method provided by the embodiment of the disclosure, when the cache server includes the request data corresponding to the request parameter, the third-party interface is accessed based on the access request, and the request data corresponding to the request parameter returned by the third-party interface is received, so that when the cache server does not include the request data corresponding to the request parameter, the request data corresponding to the request parameter is acquired based on the third-party interface, and the accuracy of the acquired request data is ensured.
Fig. 3 is a schematic flowchart of another data obtaining method provided by the embodiment of the present disclosure, and on the basis of the embodiment corresponding to fig. 2, as shown in fig. 3, after step S30, the method further includes:
and S50, when request data corresponding to the request parameters and returned by the third-party interface are not received, determining the service node according to the relationship between the access times of accessing the third-party interface and the preset access times.
The third-party interface comprises an interface proxy server and at least two service nodes in communication connection with the interface proxy server.
Specifically, when request data corresponding to the request parameters and acquired by the third-party interface are not received, acquiring the access times of the access request for accessing the third-party interface;
when the access times are less than or equal to the preset access times, determining that the access request accesses the service node corresponding to the third-party interface for the first time, wherein the preset access times are the times, such as three times, that each access request can access the third-party interface;
and accessing any service node except the service node corresponding to the first access third-party interface based on the access request.
In an implementation manner, the request data corresponding to the request parameter returned by the third-party interface is based on the request data corresponding to the request parameter of the access request issued by the interface proxy server corresponding to the third-party interface, when the third-party interface is an interface in a cluster environment, for example, at least two service nodes are respectively in communication connection with the interface proxy server, when the request data corresponding to the request parameter returned by the third-party interface is not received, first obtaining the access times of the access request for accessing the third-party interface, when the access times of the access request for accessing the third-party interface is less than the preset access times, determining the service node corresponding to the third-party interface for the first access of the access request, and then accessing any one service node except the service node corresponding to the third-party interface for the first access of the access request based on the access request, that is to adopt retry processing logic, the access request firstly accesses the service node corresponding to the third-party interface, and when the request data returned by the service node is not received, any service node except the service node corresponding to the first-time access third-party interface is accessed again, so that the probability of simultaneously requesting the same fault service node is reduced, the error probability of accessing the third-party interface is greatly reduced, and the request data is ensured to be obtained.
In addition, by setting the preset access times, namely setting the times that each access request can access the third-party interface, any service node except the service node corresponding to the first-time access third-party interface is continuously accessed after the service node corresponding to the first-time access third-party interface is mistaken, and further the times of accessing the interface proxy server are excessive, so that the stability of the service system is reduced.
Compared with the prior art, when the request data corresponding to the request parameters returned by the third-party interface is not received, the request data corresponding to the request parameters of the access request is inaccurate in result through simulating the false data return.
In addition, when the request data corresponding to the request parameter acquired by the third-party interface is not received, if the acquired access times for accessing the third-party interface is greater than the preset access times, the simulated false data is returned, and compared with the prior art, when the request data corresponding to the request parameter returned by the third-party interface is not received at one time, the simulated false data is directly returned.
The data processing method provided by the embodiment of the disclosure includes the steps of firstly obtaining the access times of accessing the third-party interface when request data corresponding to request parameters returned by the third-party interface is not received, determining a service node corresponding to the first access of the third-party interface when the access times of accessing the third-party interface is smaller than a preset access time, then accessing any service node except the service node corresponding to the first access of the third-party interface based on the access request, namely adopting retry processing logic, namely accessing the service node corresponding to the third-party interface for the first time, and accessing any service node except the service node corresponding to the first access of the third-party interface again when the request data returned by the service node is not received, so as to reduce the probability of simultaneously requesting to the same faulty service node and greatly reduce the error probability of accessing the third-party interface, and then the requested data is guaranteed to be acquired.
Fig. 4 is a schematic flow chart of another data acquisition method provided by an embodiment of the present disclosure, where on the basis of the foregoing embodiment, as shown in fig. 4, step S10 further includes:
and S01, storing the history request data to the cache server based on the history request data acquired by the history access request.
And the historical request data is stored in the cache server according to the preset storage duration.
In order to reduce the number of times of accessing the third-party interface, according to the data acquisition method provided by the embodiment of the disclosure, in the history access request, if the history request data corresponding to the history request parameter acquired by the history access request is request data with low real-time requirement, in the history access request, after the request data corresponding to the request parameter of the history access request is returned based on the third-party interface, the acquired history request data is stored in the cache server, it is ensured that the cache server is accessed first after the access request is based on the third-party interface, and the number of times of accessing the third-party interface is reduced.
As an implementable manner, in order to ensure the speed of responding to the access request, the history request data obtained by the history access request may be stored according to a preset storage duration, that is, after the preset storage duration is met, the cache server may clear the history request data, and ensure the efficiency of responding to the access request.
Specifically, the historical request data is calculated from the time when the historical request data is stored in the server in the cache duration of the cache server, and the historical request data can be deleted when the cache duration of the historical request data in the cache server meets the preset storage duration.
According to the data acquisition method provided by the embodiment of the disclosure, historical request data are acquired based on a historical access request, the historical request data are stored in the cache server according to a preset storage duration, the cache server is guaranteed to be accessed first after the access request is responded, and the access times of a third-party interface are reduced.
Fig. 5 is a schematic flow chart of another data acquisition method provided in the embodiment of the present disclosure, where on the basis of the foregoing embodiment, as shown in fig. 5, before step S10, the embodiment of the present disclosure further includes:
and S02, regularly simulating to access the third-party interface and acquiring the state information of the third-party interface.
Wherein the state information comprises an access duration and an access state.
In order to ensure that the third-party interface can be normally accessed, the third-party interface is regularly accessed by setting a timing simulation access third-party interface class, so that the phenomenon that the third-party interface is failed to be accessed due to the environmental fault, the upgrading fault and the like of the third-party interface is avoided. And realizing the timed simulated access to the third-party interface based on the timed simulated access to the third-party interface class, and further acquiring the state information of the third-party interface.
As an implementable manner, when the access duration is greater than the preset access duration and/or the access state is an abnormal state, the third-party interface abnormal information is sent to the target terminal device.
When the timing simulation access third party interface class obtains that the access time length is greater than the preset access time length and/or the access state is in an abnormal state, the abnormal information of the third party interface is sent to the target terminal equipment, for example, the abnormal information is sent to the target terminal equipment in the modes of short messages, mails, AI outbound and the like, and then the system principal is informed in time, so that the system principal contacts a third party interface provider for timely troubleshooting and processing problems at the first time, and the stability of a service system is ensured.
It should be noted that the target terminal device may be a terminal device that sends an access request, or may be a terminal device that manages a person in charge corresponding to the third-party interface, which is not specifically limited in the embodiment of the present disclosure.
According to the data processing method provided by the embodiment of the disclosure, the third-party interface is accessed regularly by setting the timing simulation access third-party interface class, so that the phenomenon that the third-party interface is accessed unsuccessfully due to the environmental fault, the upgrading fault and the like of the third-party interface is avoided. The method is characterized in that the third party interface is accessed in a timing simulation mode based on the timing simulation access of the third party interface, state information of the third party interface is further acquired, and abnormal information of the third party interface is sent to the terminal device, so that a system principal is notified in time, the system principal contacts a third party interface provider at the first time to check and process problems in time, and stability of a service system is guaranteed.
Fig. 6 is a schematic structural diagram of a data acquisition apparatus according to an embodiment of the present disclosure, and as shown in fig. 6, the data acquisition apparatus includes:
an access module 510, configured to access a cache server in response to an access request, where the access request includes a request parameter, and history request data returned based on a third-party interface in history access requests is cached in the cache server;
the data obtaining module 520 is configured to, when the cache server includes the request data corresponding to the request parameter, obtain the cache data and return the cache data to the terminal device.
In the data acquisition apparatus provided in the embodiment of the present disclosure, the access module accesses the cache server in response to the access request, and when the cache server includes the request data corresponding to the request parameter, the data acquisition module acquires the request data and returns the request data to the terminal device, that is, in the data acquisition method provided in the embodiment of the present disclosure, after acquiring the access request initiated by the terminal device, instead of directly accessing the third-party interface, the data acquisition module first accesses the cache server, searches whether the request data corresponding to the request parameter of the access request is included in the cache server, and when the cache server includes the request data corresponding to the request parameter of the access request, acquires the request data and returns the request data to the terminal device, compared with the prior art in which the third-party interface is directly accessed after acquiring the access request, the number of times of accessing the third-party interface is reduced in the embodiment of the present disclosure, and the stability of the third-party interface is ensured, and further the stability of the service system is ensured.
Optionally, the method further includes:
the third-party interface access module is used for accessing a third-party interface based on an access request when the cache server does not include request data corresponding to the request parameters, wherein the third-party interface corresponds to the access path;
and the first data acquisition module is used for receiving request data which is returned by the third-party interface and corresponds to the request parameters. Optionally, the method further includes:
and the service node determining module is used for determining the service node according to the relationship between the access times of accessing the third-party interface and the preset access times when the request data corresponding to the request parameters and returned by the third-party interface are not received.
Optionally, the service node determining module includes:
the access frequency acquiring unit is used for acquiring the access frequency of accessing the third-party interface when the request data corresponding to the request parameters acquired by the third-party interface is not received;
the service node determining unit is used for determining a service node corresponding to the first access third-party interface when the access times are less than or equal to the preset access times;
and the access unit is used for accessing any service node except the service node corresponding to the first access third-party interface based on the access request.
Optionally, the method further includes:
the storage module is used for storing the historical request data to the cache server based on the historical request data acquired by the historical access request, wherein the historical request data is stored in the cache server according to a preset storage duration.
Optionally, the method further includes:
and the simulation access module is used for simulating and accessing the third-party interface at regular time and acquiring the state information of the third-party interface, wherein the state information comprises access duration and access state.
Optionally, the method further includes:
and the sending module is used for sending the abnormal information of the third-party interface to the target terminal equipment when the access time length is greater than the preset access time length and/or the access state is in an abnormal state.
The device provided by the embodiment of the invention can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, in the embodiment of the apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure, as shown in fig. 7, the electronic device includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of processors 610 in the computer device may be one or more, and one processor 610 is taken as an example in fig. 7; the processor 610, the memory 620, the input device 630, and the output device 640 in the electronic apparatus may be connected by a bus or other means, and fig. 7 illustrates an example of connection by a bus.
The memory 620 is provided as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the methods in the embodiments of the present invention. The processor 610 executes various functional applications of the computer device and data processing by executing software programs, instructions and modules stored in the memory 620, namely, implements the method provided by the embodiment of the present invention.
The memory 620 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 620 may further include memory located remotely from the processor 610, which may be connected to a computer device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic device, and may include a keyboard, a mouse, and the like. The output device 640 may include a display device such as a display screen.
The disclosed embodiments also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to implement the method provided by the embodiments of the present invention:
responding to an access request, accessing a cache server, wherein the access request comprises request parameters, and caching historical request data returned based on a third-party interface in historical access requests in the cache server;
and when the cache server comprises the request data corresponding to the request parameters, obtaining the cache data and returning the cache data to the terminal equipment.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of data acquisition, comprising:
responding to an access request, accessing a cache server, wherein the access request comprises request parameters, and caching historical request data returned based on a third-party interface in historical access requests in the cache server;
and when the cache server comprises the request data corresponding to the request parameters, acquiring the request data and returning the request data to the terminal equipment.
2. The method of claim 1, wherein the access request further comprises an access path;
the method further comprises the following steps:
accessing a third-party interface based on the access request when the cache server does not include request data corresponding to the request parameters, wherein the third-party interface corresponds to the access path;
and receiving request data corresponding to the request parameters returned by the third-party interface.
3. The method of claim 2, further comprising:
and when request data corresponding to the request parameters returned by the third-party interface is not received, determining a service node according to the relationship between the access times of accessing the third-party interface and the preset access times.
4. The method of claim 3, wherein the third party interface comprises an interface proxy server and at least two service nodes communicatively coupled to the interface proxy server;
when the request data corresponding to the request parameters and returned by the third-party interface is not received, determining the service node according to the relationship between the access times of accessing the third-party interface and the preset access times, including:
when the request data corresponding to the request parameters acquired by the third-party interface is not received, acquiring the access times of the access request for accessing the third-party interface;
when the access times are less than or equal to the preset access times, determining that the access request accesses the service node corresponding to the third-party interface for the first time;
and accessing any service node except the service node corresponding to the third-party interface for the first time based on the access request.
5. The method of claim 1, wherein prior to accessing the cache server in response to the access request, further comprising:
and storing the historical request data to the cache server according to preset storage duration based on the historical request data acquired by the historical access request, wherein the historical request data is stored in the cache server according to the preset storage duration.
6. The method of any of claims 1-5, wherein prior to accessing the cache server in response to the access request, further comprising:
and regularly simulating to access the third-party interface to acquire state information of the third-party interface, wherein the state information comprises access duration and access state.
7. The method of claim 6, further comprising:
and when the access duration is greater than a preset access duration and/or the access state is an abnormal state, sending the abnormal information of the third-party interface to target terminal equipment.
8. A data acquisition apparatus, comprising:
the access module is used for responding to an access request and accessing a cache server, wherein the access request comprises request parameters, and history request data returned based on a third-party interface in history access requests are cached in the cache server;
and the data acquisition module is used for acquiring the cache data and returning the cache data to the terminal equipment when the cache server comprises the request data corresponding to the request parameters.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as recited in any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method of any one of claims 1 to 7.
CN202111671070.6A 2021-12-31 2021-12-31 Data acquisition method and device, electronic equipment and storage medium Pending CN114490752A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111671070.6A CN114490752A (en) 2021-12-31 2021-12-31 Data acquisition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111671070.6A CN114490752A (en) 2021-12-31 2021-12-31 Data acquisition method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114490752A true CN114490752A (en) 2022-05-13

Family

ID=81497118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111671070.6A Pending CN114490752A (en) 2021-12-31 2021-12-31 Data acquisition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114490752A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138587A (en) * 2015-07-31 2015-12-09 小米科技有限责任公司 Data access method, apparatus and system
CN107025234A (en) * 2016-02-01 2017-08-08 中国移动通信集团公司 A kind of information-pushing method and caching server
CN110995811A (en) * 2019-11-25 2020-04-10 北京奇艺世纪科技有限公司 Data updating method and device
CN112000394A (en) * 2020-08-27 2020-11-27 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for accessing an applet
CN112799824A (en) * 2019-10-28 2021-05-14 北京京东尚科信息技术有限公司 Current limiting method, device, equipment and storage medium
CN113765998A (en) * 2021-07-12 2021-12-07 北京沃东天骏信息技术有限公司 Access limiting method and device based on cluster system and server
CN113806651A (en) * 2021-09-18 2021-12-17 深圳市酷开网络科技股份有限公司 Data caching method, device, server and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138587A (en) * 2015-07-31 2015-12-09 小米科技有限责任公司 Data access method, apparatus and system
CN107025234A (en) * 2016-02-01 2017-08-08 中国移动通信集团公司 A kind of information-pushing method and caching server
CN112799824A (en) * 2019-10-28 2021-05-14 北京京东尚科信息技术有限公司 Current limiting method, device, equipment and storage medium
CN110995811A (en) * 2019-11-25 2020-04-10 北京奇艺世纪科技有限公司 Data updating method and device
CN112000394A (en) * 2020-08-27 2020-11-27 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for accessing an applet
CN113765998A (en) * 2021-07-12 2021-12-07 北京沃东天骏信息技术有限公司 Access limiting method and device based on cluster system and server
CN113806651A (en) * 2021-09-18 2021-12-17 深圳市酷开网络科技股份有限公司 Data caching method, device, server and storage medium

Similar Documents

Publication Publication Date Title
CN108427705B (en) Electronic device, distributed system log query method and storage medium
US20180046606A1 (en) Form Checking Method and Apparatus
CN113141405B (en) Service access method, middleware system, electronic device, and storage medium
WO2019076014A1 (en) Webpage generation method and apparatus, terminal device and medium
CN109561167B (en) Domain name resolution method and device
CN114095567B (en) Data access request processing method and device, computer equipment and medium
CN111597002A (en) Page rendering method and device, electronic equipment and storage medium
CN113366815A (en) Network resource request method, device, electronic equipment and storage medium
WO2020088170A1 (en) Domain name system configuration method and related apparatus
CN111355765B (en) Network request processing and sending method and device
CN112437148B (en) Service request processing method and device, service server and system
CN112866062B (en) Distributed pressure test system, method, device, equipment and storage medium
CN117040799A (en) Page interception rule generation and page access control method and device and electronic equipment
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN108390770B (en) Information generation method and device and server
CN114490752A (en) Data acquisition method and device, electronic equipment and storage medium
CN111309693A (en) Data synchronization method, device and system, electronic equipment and storage medium
CN110933070A (en) User identification method, system, equipment and computer readable storage medium
CN114185804A (en) Interface testing method and device and terminal equipment
CN115858668A (en) Distributed transaction processing method, device, electronic device and storage medium
CN114547422A (en) Method and device for preventing repeated clicking of page elements
CN108897875A (en) A kind of market figure update method, device and equipment
CN113590352A (en) Data calling method, device, equipment and readable storage medium
CN111638987A (en) Data processing method and device, electronic equipment and storage medium
CN113110846A (en) Method and device for acquiring environment variable

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