Data acquisition method and device, equipment and storage medium
By cacheing target data in the data cache and obtaining the required data directly from the cache to meet different business needs, the problem of repeated calculations in traditional data acquisition is solved, saving computing resources and network bandwidth.
Patent Information
- Application Number
- CN202311757543.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-06-20
AI Technical Summary
In traditional browsers, there is a problem of repeated calculations during data collection, resulting in waste of terminal computing resources and network transmission resources.
By cached target data in the data cache, when a data acquisition instruction is received, the required data is directly obtained from the data cache to avoid repeated collection.
It realizes that when different services require the same data, they only need to collect it once and store it in the cache to meet multiple service needs, avoid repeated data calculations, and save computing resources and network bandwidth.
Smart Images

Figure CN120179937A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more particularly, to a data acquisition method, apparatus, device, and storage medium. Background Art
[0002] In traditional browsers, client technology is usually used to complete data acquisition. When facing data acquisition services, if there are multiple service interfaces, the client technology usually performs information calculation once on the terminal and then returns. In this process, each time data is acquired, the data needs to be calculated once, and the same information will be calculated multiple times, which not only wastes the terminal computing resources but also wastes the network transmission resources. Summary of the Invention
[0003] Embodiments of this application provide a data acquisition method, apparatus, device, and storage medium, aiming to solve the problem of repeated calculation in the data acquisition process.
[0004] Other features and advantages of this application will become apparent through the following detailed description, or be learned in part through the practice of this application.
[0005] According to one aspect of the embodiments of this application, a data acquisition method is provided. The data acquisition method includes: receiving a data acquisition instruction, where the data acquisition instruction includes at least one target data; obtaining the target data from a data cache; and sending the obtained target data to a service interface.
[0006] In some embodiments of this application, the step of obtaining the target data from the data cache specifically includes: determining whether each target data is in the data cache; if the target data is not in the data cache, acquiring the target data and saving it to the data cache; and obtaining the target data from the data cache.
[0007] In some embodiments of this application, after determining whether each target data is in the data cache, the data acquisition method further includes: if the target data is in the data cache, directly obtaining the target data from the data cache according to the data acquisition requirement.
[0008] In some embodiments of this application, the data acquisition instruction further includes an acquisition strategy and a service type. The step of acquiring the target data and saving it to the data cache specifically includes: performing data acquisition according to the acquisition strategy and the service type; and saving the acquired target data to the data cache.
[0009] In some embodiments of the present application, performing data collection according to the collection strategy and the service type specifically includes: determining a corresponding collection method according to the collection strategy and the service type; and using the corresponding collection method to perform data collection.
[0010] In some embodiments of the present application, determining a corresponding collection method according to the collection strategy and the service type specifically includes: if the service type is the first type, determining the corresponding collection method as immediate collection and reporting; if the service type is the second type, determining the corresponding collection method as periodic collection and reporting.
[0011] In some embodiments of the present application, after sending the obtained target data to the service interface, the data collection method further includes: clearing the data cache whenever a predetermined condition is reached.
[0012] According to one aspect of the embodiments of the present application, a data collection device is provided. The data collection device includes: an instruction receiving module, configured to receive a data collection instruction, where the data collection instruction includes at least one target data; a data obtaining module, configured to obtain target data from a data cache; and a data sending module, configured to send the obtained target data to a service interface.
[0013] In some embodiments of the present application, the data obtaining module specifically includes: a data query sub-module, configured to determine whether each target data is in the data cache; a data collection sub-module, configured to collect the target data and save it to the data cache if the target data is not in the data cache; and a data obtaining sub-module, configured to obtain the target data from the data cache.
[0014] In some embodiments of the present application, the data obtaining module further includes: a direct obtaining sub-module, configured to directly obtain target data from the data cache according to the data collection requirement if the target data is in the data cache.
[0015] In some embodiments of the present application, the data collection sub-module specifically includes: a data collection unit, configured to perform data collection according to the collection strategy and the service type; and a data cache unit, configured to save the collected target data to the data cache.
[0016] In some embodiments of the present application, the data collection unit specifically includes: a collection method determining sub-unit, configured to determine a corresponding collection method according to the collection strategy and the service type; and a target data collection sub-unit, configured to perform data collection using the corresponding collection method.
[0017] In some embodiments of the present application, the acquisition method determination subunit is specifically configured to perform: if the service type is the first type, determine the corresponding acquisition method as immediate acquisition and reporting; if the service type is the second type, determine the corresponding acquisition method as periodic acquisition and reporting.
[0018] In some embodiments of the present application, the data acquisition device further includes: a cache cleaning module, configured to clean the data cache whenever a predetermined condition is reached.
[0019] According to one aspect of the embodiments of the present application, there is provided a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the data acquisition method as described in the above embodiments.
[0020] According to one aspect of the embodiments of the present application, there is provided an electronic device, including: one or more processors; a storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, cause the one or more processors to implement the data acquisition method as described in the above embodiments.
[0021] In the technical solutions provided in some embodiments of the present application, by caching target data in a data cache, when a data acquisition instruction is received and data acquisition is required, directly obtain it from the data cache. Then, when different services require the same data, only need to acquire the data once and put it into the cache to meet the needs of different services for the same data, avoiding the situation where the same data is calculated and acquired multiple times, and saving the computing resources and network bandwidth of the terminal.
[0022] It should be understood that the above general description and subsequent detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts. In the drawings:
[0024] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied is shown.
[0025] Figure 2 A flowchart of a data acquisition method provided by an embodiment of the present application is shown.
[0026] Figure 3 Shown according toFigure 2 A specific implementation flowchart of step S200 in the data acquisition method shown in the corresponding embodiment.
[0027] Figure 4 Shows according to Figure 3 Another specific implementation flowchart of step S220 in the data acquisition method shown in the corresponding embodiment.
[0028] Figure 5 Shows according to Figure 2 A specific implementation flowchart of the management platform shown in the corresponding embodiment.
[0029] Figure 6 Shows according to Figure 5 A specific implementation flowchart of the data acquisition extension shown in the corresponding embodiment.
[0030] Figure 7 Shows a schematic structural diagram of a data acquisition device provided in an embodiment of the present application.
[0031] Figure 8 Shows a schematic structural diagram of an electronic device provided in an embodiment of the present application. Detailed implementation manners
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art.
[0033] In addition, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be used. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the present application.
[0034] The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0035] The flowcharts shown in the accompanying drawings are merely illustrative and not necessarily include all content and operations / steps, nor are they necessarily executed in the described order. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined. Therefore, the actual execution order may change according to the actual situation.
[0036] Figure 1 The schematic diagram shows an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied.
[0037] As Figure 1 shown, the system architecture may include terminal devices (such as Figure 1 one or more of the smart phone 101, tablet computer 102, and portable computer 103 shown in
[0038] It should be understood that Figure 1 the number of terminal devices, networks, and servers in
[0039] is merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. For example, the server 105 can be a server cluster composed of multiple servers, etc.
[0040] It should be noted that the data collection method provided by the embodiment of the present application is generally executed by the server 105. Correspondingly, the data collection device is generally set in the server 105. However, in other embodiments of the present application, the terminal device can also have a similar function to the server, so as to execute the data collection solution provided by the embodiment of the present application.
[0041] The implementation details of the technical solution of the embodiment of the present application are elaborated in detail below:
[0042] Figure 2 The flowchart shows a data collection method according to an embodiment of the present application. The data collection method can be executed by a server, and the server can be Figure 1 the server shown in
[0043] Refer to Figure 2 as shown, the data acquisition method at least includes:
[0044] Step S100, receive a data acquisition instruction, where the data acquisition instruction includes at least one target data.
[0045] Step S200, obtain the target data from the data cache.
[0046] Step S300, send the obtained target data to the service interface.
[0047] In an embodiment of the present application, after the browser is started, when a service is generated, the management platform determines to load the data acquisition extension according to the policy and sends a data acquisition instruction. After receiving the data acquisition instruction, the data acquisition extension obtains the target data from the data cache according to the data acquisition instruction and sends it to the corresponding service interfaces for each service interface to use. By caching the target data in the data cache, when a data acquisition instruction is received and data acquisition is required, it is directly obtained from the data cache. Then, when different services need the same data, only one data collection is needed and put into the cache to meet the needs of different services for the same data, avoiding the situation where the same data is calculated and collected multiple times, saving the computing resources and network bandwidth of the terminal.
[0048] In step S100, the data acquisition instruction corresponding to one service includes at least one target data, and the target data is the data that the extension program needs to collect, used to determine the data acquisition scope of the extension program. In addition to the target data, the data acquisition instruction may also include configuration requirements such as the acquisition method and acquisition channel to more accurately control the data acquisition, provide different processing processes for different services, save computing resources and network resources, and improve the efficiency of data acquisition.
[0049] In step S200, by caching the target data in the data cache, when a data acquisition instruction is received and data acquisition is required, it is directly obtained from the data cache. Then, when different services need the same data, only one data collection is needed and put into the cache to meet the needs of different services for the same data, avoiding the situation where the same data is calculated and collected multiple times, saving the computing resources and network bandwidth of the terminal.
[0050] Specifically, in some embodiments, the specific implementation manner of step S200 can refer to Figure 3 . Figure 3 is according to Figure 2 the detailed description of step S200 in the data acquisition method shown in the corresponding embodiment. In the data acquisition method, step S200 may include the following steps:
[0051] Step S210: Determine whether each target data is in the data cache.
[0052] Step S220: If the target data is not in the data cache, collect the target data and save it to the data cache.
[0053] Step S230: Retrieve the target data from the data cache.
[0054] In an embodiment of the present application, when retrieving target data from the data cache, specifically, first determine whether the target data has been cached in the data cache. If the target data is not cached in the data cache, it is necessary to collect the target data, cache the collected target data in the data cache, and then retrieve the corresponding target data from the data cache.
[0055] In some other embodiments, the above step S200 further includes:
[0056] Step S240: If the target data is in the data cache, directly retrieve the target data from the data cache according to the data collection requirement.
[0057] In this embodiment, if the target data has been cached in the data cache, there is no need to collect the data again, and the corresponding target data can be directly retrieved from the data cache.
[0058] It should be noted that for multiple concurrent services, if they all require the same target data, due to the existence of the data cache, the collection of the target data only needs to be performed once, and then each concurrent service retrieves the corresponding target data from the data cache. That is, in the whole process, only collecting the data once and putting it into the cache can meet the needs of different services for the same data, avoiding the situation where the same data is calculated and collected multiple times, and saving the computing resources and network bandwidth of the terminal.
[0059] In step S210, first search for the corresponding target data in the cache. If the corresponding target data can be found, execute step S240. If the corresponding target data is not found, execute steps S220 and S230.
[0060] In step S220, for the target data that is not in the data cache, data collection is required. After collecting the target data, it needs to be cached in the data cache first, and then the corresponding target data is sent from the data cache to the service that needs it.
[0061] Specifically, in some embodiments, the specific implementation manner of step S220 can refer to Figure 4 . Figure 4 It is based on Figure 3Details of step S220 in the data collection method shown in the corresponding embodiment. In the data collection method, the data collection instruction further includes a collection strategy and a service type, and step S220 may include the following steps:
[0062] Step S221, perform data collection according to the collection strategy and the service type.
[0063] Step S222, save the collected target data to the data cache.
[0064] In the embodiments of the present application, first determine various configuration requirements for collection according to the collection strategy and the service type, and then perform collection according to the configuration requirements. For the collected target data, it needs to be cached in the data cache, and then the corresponding target data is sent from the data cache to the required service. To ensure that if there is a need in subsequent services, it can be directly obtained from the data cache. At the same time, caching it in the data cache first and then sending the corresponding target data from the data cache to the required service can also save threads and reduce the complexity of task processing.
[0065] In step S221, when performing data collection, it is necessary to determine various configuration requirements for each service type during collection according to the collection strategy, and then adopt an appropriate collection method to collect data.
[0066] Specifically, in some embodiments, the specific implementation manner of step S221 can refer to the following embodiments. This embodiment is based on Figure 4 Details of step S221 in the data collection method shown in the corresponding embodiment. In the data collection method, step S221 may include the following steps:
[0067] Determine the corresponding collection method according to the collection strategy and the service type.
[0068] Use the corresponding collection method to perform data collection.
[0069] In the embodiments of the present application, when performing data collection, it is necessary to determine various configuration requirements for each service type during collection according to the collection strategy, and then adopt an appropriate collection method to collect data. The requirements for collection include the scope of collection, the channels of collection, and the frequency of collection, etc.
[0070] For example, in one embodiment, the collection frequencies corresponding to different task types are different. If the service type is the first type, then determine the corresponding collection method as immediate collection and reporting; if the service type is the second type, then determine the corresponding collection method as periodic collection and reporting.
[0071] For the second type of service, it can report once every predetermined time, or it can report once every time a predetermined amount of data is collected.
[0072] Among them, the predetermined time can be 1 second, 2 seconds, 3 seconds, 5 seconds, etc., and this application does not limit it here. The predetermined amount can be a predetermined number, such as 10, 15, 50, 100, etc., and this application does not limit it here; the predetermined amount can also be a predetermined size, such as 13 KB, 21 KB, 1 MB, 8 MB, etc., and this application does not limit it here; the predetermined amount can also be the number of data packets, such as 25 data packets, 100 data packets, 200 data packets, etc., and this application does not limit it here.
[0073] It should be noted here that for the target data using the immediate reporting method, the target data is only collected once and stored in the data cache. After the target data has been stored in the data cache, as long as it is a service that obtains data through the immediate reporting method, the target data stored in the data cache is directly sent to the service.
[0074] For the target data collected and reported periodically, before collection, if the data has been stored in the data cache, it is first directly retrieved from the data cache and sent to the service for use, and then the target data is collected. Whenever the collected data reaches a predetermined condition (predetermined time or predetermined amount), the data cache is updated, and the currently collected target data is used to replace the corresponding existing target data in the data cache. The replacement method can be to directly overwrite it to save cache resources, or the original existing target data can be moved to other places for storage so that some services that need to use historical data can call it at any time.
[0075] In addition to the collection frequency, the collection method also depends on the collection channel. For different types of tasks, the target data can be collected through different collection channels, such as through web scraping, API calls, database queries, file reading, sensor data collection, log file analysis, user input or interaction, third-party data source integration, etc.
[0076] Among them, web scraping, that is, by making HTTP requests and parsing HTML pages, extracting the required data from web pages. Libraries or frameworks such as BeautifulSoup, Scrapy, etc. can be used to achieve web scraping. API calls, that is, many web services and applications provide API interfaces, and data can be obtained by sending HTTP requests. It is necessary to use the API key or token for authentication and interact with data according to the requirements of the API documentation. Database queries, that is, by connecting to a database server and executing query statements to obtain data. SQL language or the API of a specific database can be used to interact with the database. File reading, that is, reading data from local or remote files. The FileAPI of JavaScript can be used to read files uploaded by users, or the file reading function on the server side can be used to obtain data. Sensor data collection, that is, using sensors in mobile devices or Internet of Things devices to collect various types of data, such as location information, acceleration, temperature, etc. Log file analysis, that is, extracting the required data by analyzing server log files or application log files. Data processing tools or programming languages can be used to parse and analyze log files. User input or interaction, that is, collecting data through the input or interaction behavior of users in the browser. For example, listening to form submissions, click events, or scroll events, etc., to obtain the data input by users or the behavior data of users. Third-party data source integration, that is, obtaining data from its data source by integrating with third-party data providers. This may involve docking with external APIs, data subscriptions, or data purchases, etc.
[0077] It should be noted that there can be multiple collection channels corresponding to one business type, and different business types may also use the same collection channel to collect target data.
[0078] In step S230, obtaining the collected target data from the data cache can improve efficiency and reduce resource consumption. At the same time, by using the data in the cache, we can provide personalized target data according to the user's preferences and historical behaviors, thereby improving user satisfaction and engagement.
[0079] In the above embodiment, by using the data that already exists in the cache, we can avoid repeated data acquisition and processing steps, thereby improving the overall processing speed and the response ability of the system. Avoiding repeated data acquisition and processing can also reduce the demand for network bandwidth and computing resources, thereby saving resources and reducing costs.
[0080] At the same time, for applications that require real-time or fast response, obtaining target data from the cache can greatly reduce the waiting time and provide a better user experience.
[0081] In step S300, the obtained target data is sent to the service interface for business use. Due to the existence of data caching, the data formats obtained by each service interface are unified, saving data bandwidth. At the same time, the business logic is clearer, and it also solves the problem in the prior art that due to different service interfaces, there are likely to be deviations in parameter agreements and specifications. After the data is transmitted to the server, the server needs to perform additional data verification, data format normalization, data cleaning, and other operations.
[0082] In some embodiments, for the target data in the data cache, it is necessary to perform a cleanup every certain condition to ensure that the data sent to the business has higher timeliness, thereby ensuring the accuracy and reliability of business processing results, and also saving cache resources.
[0083] In some embodiments, the data cache can be cleared every once in a while, or it can be cleared every time it reaches a certain capacity.
[0084] Specifically, clearing every time it reaches a certain capacity can be clearing every time it reaches a predetermined percentage of the data cache capacity. For example, clearing every time it reaches 80% of the data cache capacity; clearing every time it reaches a certain capacity can also be clearing every time the cached target data reaches a predetermined data volume. For example, clearing every time the cached target data reaches 89MB, or clearing every time the cached target data reaches 190 pieces.
[0085] In the embodiments of the present application, when clearing the data cache, it can be cleared according to the type, and only the target data of a fixed type is cleared. For example, only the target data reported in real-time is cleared.
[0086] It should be noted that in some embodiments, after the extension program is closed, the data cache will also be completely cleared; or after the browser or client is closed, the data cache will be completely cleared.
[0087] In other embodiments, after the extension program is closed, or after the browser or client is closed, all the data in the data cache will be migrated to local storage for some services that need to use historical data to call at any time.
[0088] In some embodiments, please refer to Figure 5 In this embodiment, after the browser is started, it will decide whether to load the data collection extension according to the management platform configuration policy. If it decides to load the data collection extension, it will load the data collection extension, collect data information, and perform periodic reporting or real-time reporting according to business requirements.
[0089] The above embodiments do not rely on client technology and have universality. As long as the browser meets the extension standard, the extension can be used to complete the data collection function.
[0090] Specifically, please continue to refer to Figure 6 , Figure 5 The data collection extension in [reference] includes a front end, a middle end, and a back end. After loading the data collection extension, the running steps of the data collection extension specifically include: The management platform wakes up the back end and sends a running policy to the back end. The corresponding process of the back end starts, receives the running policy of the data collection extension, and wakes up the middle-end process. The middle-end process starts accordingly, creates a collection task, and publishes all the collection information that can be provided to the service for the service to subscribe to. The front-end process starts as needed (i.e., starts when target data needs to be collected), executes specific collection tasks, and returns information to the middle end. The back-end process receives the collection requirements from specific services and subscribes to the collected information; the middle end sends the content from the cached data to the back-end process according to the subscription content. After the back-end process obtains the specific collection information, it returns it to the service.
[0091] The following introduces the device embodiments of the present application, which can be used to execute the data collection method in the above embodiments of the present application. For the details not disclosed in the device embodiments of the present application, please refer to the embodiments of the above data collection method of the present application.
[0092] Figure 7 The block diagram of a data collection device according to an embodiment of the present application is shown.
[0093] Referring to Figure 7 As shown, a data collection device 700 according to an embodiment of the present application includes: an instruction receiving module 710, a data obtaining module 720, and a data sending module 730.
[0094] Among them, the instruction receiving module 710 is used to receive a data collection instruction, and the data collection instruction includes at least one target data; the data obtaining module 720 is used to obtain the target data from the data cache; the data sending module 730 is used to send the obtained target data to the service interface.
[0095] In some embodiments of the present application, the data obtaining module specifically includes: a data query sub-module, which is used to determine whether each target data is in the data cache; a data collection sub-module, which is used to collect the target data and save it to the data cache if the target data is not in the data cache; a data obtaining sub-module, which is used to obtain the target data from the data cache.
[0096] In some embodiments of the present application, the data acquisition module further includes: a direct acquisition sub-module, configured to directly obtain target data from the data cache according to the data acquisition requirements if the target data is in the data cache.
[0097] In some embodiments of the present application, the data collection sub-module specifically includes: a data collection unit, configured to perform data collection according to the collection strategy and the service type; and a data cache unit, configured to save the collected target data to the data cache.
[0098] In some embodiments of the present application, the data collection unit specifically includes: a collection method determination sub-unit, configured to determine a corresponding collection method according to the collection strategy and the service type; and a target data collection sub-unit, configured to perform data collection using the corresponding collection method.
[0099] In some embodiments of the present application, the collection method determination sub-unit is specifically configured to execute: if the service type is the first type, determine the corresponding collection method as immediate collection and reporting; if the service type is the second type, determine the corresponding collection method as periodic collection and reporting.
[0100] In some embodiments of the present application, the data collection device further includes: a cache cleaning module, configured to clean the data cache whenever a predetermined condition is reached.
[0101] In an embodiment of the present application, after the browser is started, when a service is generated, the management platform determines to load a data collection extension according to the policy and sends a data collection instruction. After receiving the data collection instruction, the data collection extension obtains target data from the data cache according to the data collection instruction and sends it to the corresponding business interfaces for each business interface to use. By caching the target data in the data cache, when a data collection instruction is received and data collection is required, it is directly obtained from the data cache. Then, when different services need the same data, only one data collection is required and the data is put into the cache, which can meet the needs of different services for the same data, avoiding the situation where the same data is calculated and collected multiple times, and saving the computing resources and network bandwidth of the terminal.
[0102] Figure 8 The structure diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application is shown.
[0103] It should be noted that Figure 8 The computer system of the electronic device shown is only an example and should not bring any limitation to the functions and usage scopes of the embodiments of the present application.
[0104] Such as Figure 8As shown, the computer system includes a Central Processing Unit (CPU) 1801, which can perform various appropriate actions and processes according to the program stored in the Read-Only Memory (ROM) 1802 or the program loaded from the storage section 1808 into the Random Access Memory (RAM) 1803, such as executing the method described in the above embodiments. In the RAM 1803, various programs and data required for system operation are also stored. The CPU 1801, ROM 1802, and RAM 1803 are connected to each other via a bus 1804. An Input / Output (I / O) interface 1805 is also connected to the bus 1804.
[0105] The following components are connected to the I / O interface 1805: an input section 1806 including a keyboard, a mouse, etc.; an output section 1807 including, for example, a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage section 1808 including a hard disk, etc.; and a communication section 1809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1809 performs communication processing via a network such as the Internet. A drive 1810 is also connected to the I / O interface 1805 as needed. A removable medium 1811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1810 as needed so that the computer program read from it can be installed into the storage section 1808 as needed.
[0106] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication section 1809, and / or installed from the removable medium 1811. When the computer program is executed by the Central Processing Unit (CPU) 1801, various functions defined in the system of the present application are executed.
[0107] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable computer program is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The computer program contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0108] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0109] The units involved in the embodiments described in this application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not, in some cases, constitute a limitation on the unit itself.
[0110] As another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiments.
[0111] It should be noted that although several modules or units of a device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0112] From the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented in software, or in a manner of software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (such as a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of this application.
[0113] After considering the specification and practicing the embodiments disclosed herein, those skilled in the art will readily conceive of other embodiments of this application. This application is intended to cover any variations, uses, or adaptations of this application, which follow the general principles of this application and include known common knowledge or conventional technical means in the technical field not disclosed in this application.
[0114] It should be understood that this application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is only limited by the appended claims.
Claims
1. A data acquisition method, characterized in that, The data acquisition method includes: Receiving a data acquisition instruction, where the data acquisition instruction includes at least one target data; Obtaining the target data from the data cache; Sending the obtained target data to the service interface.
2. The data acquisition method according to claim 1, characterized in that, The obtaining the target data from the data cache specifically includes: Determining whether each target data is in the data cache; If the target data is not in the data cache, acquiring the target data and saving it to the data cache; Obtaining the target data from the data cache.
3. The data acquisition method according to claim 2, characterized in that, After determining whether each target data is in the data cache, the data acquisition method further includes: If the target data is in the data cache, directly obtaining the target data from the data cache according to the data acquisition requirement.
4. The data acquisition method according to claim 2, characterized in that, The data acquisition instruction further includes an acquisition strategy and a service type. The acquiring the target data and saving it to the data cache specifically includes: Performing data acquisition according to the acquisition strategy and the service type; Saving the acquired target data to the data cache.
5. The data acquisition method according to claim 4, characterized in that, The performing data acquisition according to the acquisition strategy and the service type specifically includes: Determining a corresponding acquisition method according to the acquisition strategy and the service type; Using the corresponding acquisition method to perform data acquisition.
6. The data acquisition method according to claim 5, characterized in that, The determining a corresponding acquisition method according to the acquisition strategy and the service type specifically includes: If the service type is the first type, determining the corresponding acquisition method as immediate acquisition and reporting; If the service type is the second type, determining the corresponding acquisition method as periodic acquisition and reporting.
7. The data acquisition method according to claim 1, characterized in that, After sending the obtained target data to the service interface, the data acquisition method further includes: Cleaning the data cache whenever a predetermined condition is reached.
8. A data acquisition device, characterized in that, The data acquisition device includes: An instruction receiving module, configured to receive a data acquisition instruction, where the data acquisition instruction includes at least one target data; A data obtaining module, configured to obtain the target data from the data cache; A data sending module, configured to send the obtained target data to the service interface.
9. A computer-readable medium, on which a computer program is stored, characterized in that, The computer program, when executed by a processor, implements the data acquisition method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, Includes: One or more processors; A storage device, configured to store one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the data acquisition method according to any one of claims 1 to 7.