Artificial intelligence-based data acquisition method and device, electronic equipment and medium

By identifying and analyzing data interface types and parameter information, and by making reasonable use of caching strategies, the problems of timeliness and low efficiency of interface data caching were solved, and efficient data acquisition and response speed were improved.

CN114996340BActive Publication Date: 2026-06-16CHINA PING AN PROPERTY INSURANCE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA PING AN PROPERTY INSURANCE CO LTD
Filing Date
2022-06-20
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing technologies do not classify interface data during caching, resulting in uncontrollable caching time, unreliable timeliness, inefficient caching strategies, and low data retrieval efficiency.

Method used

By identifying the data interface type, it is determined whether this is the user's first visit. Based on the interface parameter information, a caching strategy is determined, and the caching strategy is used appropriately to obtain page data. This includes setting a cache timeout threshold and analyzing changes in target parameters to decide whether to use cached data or retrieve it again.

🎯Benefits of technology

It improves the diversity and flexibility of caching strategies, reduces server traffic and peak-hour pressure, enhances response speed and user access experience, and improves data acquisition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996340B_ABST
    Figure CN114996340B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and provides a data acquisition method and device based on artificial intelligence, electronic equipment and a medium, the method comprises the following steps: acquiring a data interface to be accessed; identifying the interface type of the data interface to be accessed; when the interface type of the data interface to be accessed is a cache interface, judging whether the data interface to be accessed is accessed for the first time by a user; when the data interface to be accessed is not accessed for the first time by the user, determining a cache strategy according to parameter information of the data interface to be accessed; and acquiring page data based on the cache strategy. After the cache strategy is determined according to the parameter information of the data interface to be accessed, the cache strategy is reasonably used, the number of flows and server requests is reduced, the pressure of server flows in a peak period is effectively reduced, and the data acquisition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and more specifically to a data acquisition method, apparatus, electronic device, and medium based on artificial intelligence. Background Technology

[0002] In the field of internet development, as application business functions grow, the backend server caches the interface data during the communication process between the mobile client and the backend server.

[0003] However, existing technologies do not categorize interfaces when caching interface data, making it impossible to control the caching time, guarantee the timeliness of the data, or cache data based on interface type. This results in inefficient caching strategies and low data retrieval efficiency. Summary of the Invention

[0004] In view of the above, it is necessary to propose a data acquisition method, device, electronic device and medium based on artificial intelligence, which can improve the efficiency of data acquisition.

[0005] A first aspect of the present invention provides a data acquisition method based on artificial intelligence, the method comprising:

[0006] Parse the received user page access request and obtain the data interface to be accessed;

[0007] Identify the interface type of the data interface to be accessed;

[0008] When the interface type of the data interface to be accessed is a cache interface, determine whether the data interface to be accessed is the first time the user is accessing it;

[0009] When the data interface to be accessed is not the user's first access, a caching strategy is determined based on the parameter information of the data interface to be accessed;

[0010] Page data is obtained based on the caching strategy described above.

[0011] Optionally, the interface type for identifying the data interface to be accessed includes:

[0012] Identify the interface attributes of the data interface to be accessed;

[0013] When the interface attribute of the data interface is a preset first interface attribute, the interface type of the data interface to be accessed is determined to be a cache interface;

[0014] When the interface attribute of the data interface is a preset second interface attribute, the interface type of the data interface to be accessed is determined to be a non-cached interface.

[0015] Optionally, determining the caching strategy based on the parameter information of the data interface to be accessed includes:

[0016] Obtain the current access time and the cache time of the last cached data from the parameter information of the data interface to be accessed;

[0017] Calculate the difference between the current access time and the cache time of the last cached data to obtain the target difference;

[0018] Determine whether the target difference is greater than the cache timeout threshold;

[0019] When the target difference is greater than or equal to the cache timeout threshold, the caching strategy is determined to be to call the data interface to be accessed to re-obtain the page data.

[0020] Optionally, determining whether the target difference is greater than the cache timeout threshold further includes:

[0021] When the target difference is less than the cache timeout threshold, the parameter information of multiple target parameters that the data interface to be accessed depends on is obtained from the parameter information of the data interface to be accessed.

[0022] Analyze the parameter information of each target parameter and obtain the analysis results for the corresponding target parameter;

[0023] When the analysis results of each target parameter meet the conditions for using cached data, the caching strategy is determined to be to use the cached data last cached by the data interface to be accessed;

[0024] When the analysis results of each target parameter do not meet the conditions for using cached data, the caching strategy is determined to be to call the data interface to be accessed to re-obtain the page data.

[0025] Optionally, the step of analyzing the parameter information of each target parameter and obtaining the analysis results of the corresponding target parameter includes:

[0026] Analyze the parameter information of each target parameter to obtain the change information of the corresponding target parameter;

[0027] The change information of each target parameter is determined as the analysis result of each target parameter.

[0028] Optionally, obtaining page data based on the caching strategy includes:

[0029] Identify whether the cache interface to be accessed is a deferred interface;

[0030] When the cache interface to be accessed is a deferred interface, a timer is set to retrieve page data based on the caching strategy within a preset time.

[0031] When the cache interface to be accessed is not a deferred interface, page data is obtained based on the caching strategy.

[0032] Optionally, the method further includes:

[0033] When the data interface to be accessed is being accessed for the first time by the user, the data interface to be accessed is called to retrieve the page data again.

[0034] A second aspect of the present invention provides a data acquisition device based on artificial intelligence, the device comprising:

[0035] The parsing and retrieval module is used to parse the received page access requests from users and retrieve the data interface to be accessed;

[0036] The identification module is used to identify the interface type of the data interface to be accessed;

[0037] The judgment module is used to determine whether the data interface to be accessed is the first time the user is accessing it when the interface type of the data interface to be accessed is a cache interface;

[0038] The determination module is used to determine a caching strategy based on the parameter information of the data interface to be accessed when the data interface to be accessed is not being accessed by the user for the first time.

[0039] The acquisition module is used to acquire page data based on the caching strategy.

[0040] A third aspect of the present invention provides an electronic device comprising a processor and a memory, wherein the processor is configured to implement the artificial intelligence-based data acquisition method by executing a computer program stored in the memory.

[0041] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned artificial intelligence-based data acquisition method.

[0042] In summary, the AI-based data acquisition method, apparatus, electronic device, and medium described in this invention can promote the construction of smart cities and be applied in fields such as smart buildings, smart security, smart communities, smart living, and the Internet of Things. By identifying the interface type of the data interface to be accessed, and since different interface types correspond to different caching strategies, the diversity and flexibility of caching strategies are improved. It is determined whether the data interface to be accessed is the user's first access, and based on the determination result, it is decided whether to trigger caching, thereby improving the utilization rate of cached data. When the data interface to be accessed is not the user's first access, a caching strategy is determined based on the parameter information of the data interface to be accessed, and page data is obtained based on the caching strategy. The reasonable application of the caching strategy reduces traffic and the number of server requests, effectively reducing the server traffic pressure during peak periods, greatly improving response speed and user access experience, and simultaneously improving data acquisition efficiency. Attached Figure Description

[0043] Figure 1 This is a flowchart of the data acquisition method based on artificial intelligence provided in Embodiment 1 of the present invention.

[0044] Figure 2 This is a structural diagram of the data acquisition device based on artificial intelligence provided in Embodiment 2 of the present invention.

[0045] Figure 3 This is a schematic diagram of the structure of the electronic device provided in Embodiment 3 of the present invention. Detailed Implementation

[0046] To better understand the above-mentioned objects, features, and advantages of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0048] Example 1

[0049] Figure 1 This is a flowchart of the data acquisition method based on artificial intelligence provided in Embodiment 1 of the present invention.

[0050] In this embodiment, the artificial intelligence-based data acquisition method can be applied to electronic devices. For electronic devices that need to perform artificial intelligence-based data acquisition, the artificial intelligence-based data acquisition function provided by the method of this invention can be directly integrated into the electronic device, or it can run in the electronic device in the form of a software development kit (SDK).

[0051] The embodiments of this invention can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0052] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, as well as machine learning and deep learning.

[0053] like Figure 1 As shown, the data acquisition method based on artificial intelligence specifically includes the following steps. Depending on different needs, the order of the steps in this flowchart can be changed, and some steps can be omitted.

[0054] S11, parse the received user's page access request and obtain the data interface to be accessed.

[0055] In this embodiment, when a user accesses a page, the client initiates a page access request to the server. Specifically, the client can be a smartphone, iPad, or other existing smart device. The server can be a page access subsystem. During the process of obtaining page data, the client can send a page access request to the page access subsystem. The page access subsystem is used to receive the page access request sent by the client, parse the page access request, and obtain the data interface to be accessed.

[0056] In an optional embodiment, the interface for parsing the received user's page access request and obtaining the data to be accessed includes:

[0057] Parse the page access request message to obtain the message information carried by the message;

[0058] Obtain the interface name of the page to be accessed from the message information;

[0059] The data interface to be accessed is determined based on the interface name of the page to be accessed.

[0060] In this embodiment, there can be multiple page access requests or one page access request. When multiple page access requests are received, each page access request is parsed separately.

[0061] S12, Identify the interface type of the data interface to be accessed.

[0062] In this embodiment, the interface types include cached interfaces and non-cached interfaces.

[0063] In this embodiment, by pre-sorting out the interface types of the pages accessed by users, and since different interface types correspond to different caching strategies, the diversity and flexibility of caching strategies are improved.

[0064] In an optional embodiment, the interface type for identifying the data interface to be accessed includes:

[0065] Identify the interface attributes of the data interface to be accessed;

[0066] When the interface attribute of the data interface is a preset first interface attribute, the interface type of the data interface to be accessed is determined to be a cache interface;

[0067] When the interface attribute of the data interface is a preset second interface attribute, the interface type of the data interface to be accessed is determined to be a non-cached interface.

[0068] In this embodiment, the preset first interface attribute refers to one or a combination of the following: the data interface to be accessed is a core-dependent interface, an interface with complex query calculations, or a non-important interface that can be delayed.

[0069] In this embodiment, the preset second interface attribute refers to the data interface to be accessed being an interface with very high real-time requirements for query status, such as interfaces for interactions performed during query status. This type of interface is a non-cached interface, and no caching is performed on the interface data interaction.

[0070] In other alternative embodiments, the caching interface includes a short-term caching interface and a long-term caching interface, and appropriate cache expiration times are set for different caching interfaces.

[0071] S13, when the interface type of the data interface to be accessed is a cache interface, determine whether the data interface to be accessed is the first time the user is accessing it.

[0072] In this embodiment, when the interface type of the data interface to be accessed is identified as a cache interface, it is determined that the data interface to be accessed can cache data.

[0073] In this embodiment, when a user visits the page for the first time, the first set of data is cached. When the user visits the page for the second time, it is necessary to first determine whether the interface to be accessed is the user's first access. Based on the determination result, it is determined whether to trigger the use of cache, thereby improving the utilization rate of cached data.

[0074] Furthermore, the method also includes:

[0075] When the interface type of the data interface to be accessed is a non-cached interface, the data interface to be accessed is called to obtain page data.

[0076] In this embodiment, when the data interface type is a non-cached interface, it is determined that the data interface to be accessed does not have the function of caching data. Therefore, no data caching is performed, and the data interface to be accessed is directly called to obtain page data, which improves the timeliness of obtaining page data.

[0077] S14, when the data interface to be accessed is not the first time the user accesses it, a caching strategy is determined based on the parameter information of the data interface to be accessed.

[0078] In this embodiment, the caching strategy includes either calling the data interface to be accessed to retrieve page data again or using the cached data from the last cached data of the data interface to be accessed.

[0079] In an optional embodiment, determining the caching strategy based on the parameter information of the data interface to be accessed includes:

[0080] Obtain the current access time and the cache time of the last cached data from the parameter information of the data interface to be accessed;

[0081] Calculate the difference between the current access time and the cache time of the last cached data to obtain the target difference;

[0082] Determine whether the target difference is greater than the cache timeout threshold;

[0083] When the target difference is greater than or equal to the cache timeout threshold, the caching strategy is determined to be to call the data interface to be accessed to re-obtain the page data.

[0084] In this embodiment, different cache timeout thresholds are set for different interfaces. When using the local storage of the page frontend to cache interface data, the cache timeout threshold for the cached data of each interface is marked. For example, for page operation data, the real-time requirement can be set within 10 minutes, and the cache timeout threshold is set to 10 minutes. When it is greater than or equal to 10 minutes, the cache is cleared and the data interface to be accessed is called to retrieve the page data again. For data on gas station lists with discounted prices, the real-time requirement can be set within 3 minutes, and the cache timeout threshold is set to 3 minutes. When it is greater than or equal to 3 minutes, the cache is cleared and the data interface to be accessed is called to retrieve the page data again. By setting different cache timeout thresholds for different interfaces, server traffic during peak hours can be effectively reduced, while ensuring the reasonable and normal display of data.

[0085] Furthermore, determining whether the target difference is greater than the cache timeout threshold also includes:

[0086] When the target difference is less than the cache timeout threshold, the parameter information of multiple target parameters that the data interface to be accessed depends on is obtained from the parameter information of the data interface to be accessed.

[0087] Analyze the parameter information of each target parameter and obtain the analysis results for the corresponding target parameter;

[0088] When the analysis results of each target parameter meet the conditions for using cached data, the caching strategy is determined to be to use the cached data last cached by the data interface to be accessed;

[0089] When the analysis results of each target parameter do not meet the conditions for using cached data, the caching strategy is determined to be to call the data interface to be accessed to re-obtain the page data.

[0090] Furthermore, the analysis of parameter information for each target parameter and the acquisition of analysis results for the corresponding target parameters include:

[0091] Analyze the parameter information of each target parameter to obtain the change information of the corresponding target parameter;

[0092] The change information of each target parameter is determined as the analysis result of each target parameter.

[0093] In this embodiment, if the user accesses a gas station list page, the target parameters may include location parameters, city parameters, coupon parameters, supplier parameters, and fuel type.

[0094] In one optional embodiment, changes in location parameters, city parameters, coupon parameters, supplier parameters, and fuel type parameters determine which gas stations are displayed on the gas station list page accessed by the user.

[0095] For example, regarding the location parameters, the gas station query list is a circle centered on the user's current location, containing information on all gas stations within a 30-kilometer radius. Analysis shows that changes in the location parameters meet the conditions for using cached data, meaning the changes in the location parameters are minor and have little impact on the queried gas station list. Therefore, it is not necessary to call the data interface to be accessed to re-obtain page data. The caching strategy is determined to be to use the cached data from the last cached data from the data interface to be accessed.

[0096] Regarding the city parameter, if the current location city is not the same as the selected query city, the location point of the queried gas station list will be a default location point of the selected query city. Since the city information changes significantly, the caching strategy is to call the data interface to be accessed to re-obtain the page data.

[0097] Regarding the coupon parameters, if a user filters by the gas stations that the coupon can be used at, different coupons correspond to different gas station lists, and the list of gas stations retrieved varies greatly. Therefore, the caching strategy is to call the data interface to be accessed to re-retrieve the page data.

[0098] Regarding the supplier parameters, if a user requests a supplier that is different from the last cached supplier, and the list of gas stations retrieved changes significantly, the caching strategy is determined to be to call the data interface to be accessed to retrieve the page data again.

[0099] For each fuel code, different fuel codes support different lists of gas stations. If the specific fuel code being queried is different from the last cached fuel code, and the list of gas stations retrieved changes significantly, the caching strategy is to call the data interface to be accessed to re-retrieve the page data. If the specific fuel code being queried is the same as the last cached fuel code, and the list of gas stations retrieved does not change significantly, the caching strategy is to use the cached data from the last cached data retrieved by the data interface to be accessed.

[0100] S15, obtain page data based on the caching strategy.

[0101] In this embodiment, the caching interface includes a deferred interface. Specifically, the deferred interface refers to data that can be loaded later after the data display logic, without affecting the main function of the page.

[0102] In an optional embodiment, obtaining page data based on the caching strategy includes:

[0103] Identify whether the cache interface to be accessed is a deferred interface;

[0104] When the cache interface to be accessed is a deferred interface, a timer is set to retrieve page data based on the caching strategy within a preset time.

[0105] When the cache interface to be accessed is not a deferred interface, page data is obtained based on the caching strategy.

[0106] In this embodiment, when the cached interface to be accessed is identified as a deferred interface, a page access request is initiated after a preset time when the page is loaded by setting a timer. For example, the preset time can be 1 second or 2 seconds, which ensures that the bandwidth resources requested in advance for important interfaces, thereby improving the accuracy and efficiency of data acquisition.

[0107] In other optional embodiments, if 10 page access requests are received, the caching strategy corresponding to 4 caching interfaces is to use the cached data last cached by the data interface to be accessed, avoiding the request to the backend service to call the data interface to be accessed to retrieve the page data again. The reasonable use of the caching strategy reduces traffic and the number of server requests by about 40%, effectively reducing the pressure on server traffic during peak hours, greatly improving response speed and user access experience, and improving data acquisition efficiency.

[0108] In this embodiment, by identifying the interface type of the data interface to be accessed, determining the corresponding caching strategy based on the identification and analysis results, and obtaining page data according to the corresponding caching strategy, the efficiency and accuracy of obtaining page data are improved.

[0109] S16, when the data interface to be accessed is the user's first access, the data interface to be accessed is called to retrieve the page data again.

[0110] In this embodiment, when a user visits a page for the first time, the first set of data for that page is cached, so that the cache can be triggered when the same page is visited again, thus improving data retrieval efficiency.

[0111] In summary, the AI-based data acquisition method described in this embodiment identifies the interface type of the data interface to be accessed. Since different interface types correspond to different caching strategies, this improves the diversity and flexibility of caching strategies. It determines whether the data interface to be accessed is the user's first access, and based on the determination result, decides whether to trigger caching, thereby improving the utilization rate of cached data. When the data interface to be accessed is not the user's first access, a caching strategy is determined based on the parameter information of the data interface to be accessed, and page data is acquired based on the caching strategy. The reasonable application of the caching strategy reduces traffic and the number of server requests, effectively reducing server traffic pressure during peak periods, greatly improving response speed and user access experience, and simultaneously improving data acquisition efficiency.

[0112] Example 2

[0113] Figure 2 This is a structural diagram of the data acquisition device based on artificial intelligence provided in Embodiment 2 of the present invention.

[0114] In some embodiments, the AI-based data acquisition device 20 may include multiple functional modules composed of program code segments. The program code of each program segment in the AI-based data acquisition device 20 may be stored in the memory of an electronic device and executed by the at least one processor to perform (see details). Figure 1 (Description) Data acquisition functions based on artificial intelligence.

[0115] In this embodiment, the AI-based data acquisition device 20 can be divided into multiple functional modules according to its functions. These functional modules may include: a parsing and acquisition module 201, an identification module 202, a judgment module 203, a determination module 204, and an acquisition module 205. The module referred to in this invention is a series of computer-readable instruction segments that can be executed by at least one processor and perform a fixed function, stored in memory. In this embodiment, the functions of each module will be detailed in subsequent embodiments.

[0116] The parsing and retrieval module 201 is used to parse the received user's page access request and retrieve the data interface to be accessed.

[0117] In this embodiment, when a user accesses a page, the client initiates a page access request to the server. Specifically, the client can be a smartphone, iPad, or other existing smart device. The server can be a page access subsystem. During the process of obtaining page data, the client can send a page access request to the page access subsystem. The page access subsystem is used to receive the page access request sent by the client, parse the page access request, and obtain the data interface to be accessed.

[0118] In an optional embodiment, the parsing and acquisition module 201 parses the received user's page access request and acquires the data interface to be accessed, including:

[0119] Parse the page access request message to obtain the message information carried by the message;

[0120] Obtain the interface name of the page to be accessed from the message information;

[0121] The data interface to be accessed is determined based on the interface name of the page to be accessed.

[0122] In this embodiment, there can be multiple page access requests or one page access request. When multiple page access requests are received, each page access request is parsed separately.

[0123] The identification module 202 is used to identify the interface type of the data interface to be accessed.

[0124] In this embodiment, the interface types include cached interfaces and non-cached interfaces.

[0125] In this embodiment, by pre-sorting out the interface types of the pages accessed by users, and since different interface types correspond to different caching strategies, the diversity and flexibility of caching strategies are improved.

[0126] In an optional embodiment, the identification module 202 identifies the interface type of the data interface to be accessed, including:

[0127] Identify the interface attributes of the data interface to be accessed;

[0128] When the interface attribute of the data interface is a preset first interface attribute, the interface type of the data interface to be accessed is determined to be a cache interface;

[0129] When the interface attribute of the data interface is a preset second interface attribute, the interface type of the data interface to be accessed is determined to be a non-cached interface.

[0130] In this embodiment, the preset first interface attribute refers to one or a combination of the following: the data interface to be accessed is a core-dependent interface, an interface with complex query calculations, or a non-important interface that can be delayed.

[0131] In this embodiment, the preset second interface attribute refers to the data interface to be accessed being an interface with very high real-time requirements for query status, such as interfaces for interactions performed during query status. This type of interface is a non-cached interface, and no caching is performed on the interface data interaction.

[0132] In other alternative embodiments, the caching interface includes a short-term caching interface and a long-term caching interface, and appropriate cache expiration times are set for different caching interfaces.

[0133] The judgment module 203 is used to determine whether the data interface to be accessed is the first time the user is accessing it when the interface type of the data interface to be accessed is a cache interface.

[0134] In this embodiment, when the interface type of the data interface to be accessed is identified as a cache interface, it is determined that the data interface to be accessed can cache data.

[0135] In this embodiment, when a user visits the page for the first time, the first set of data is cached. When the user visits the page for the second time, it is necessary to first determine whether the interface to be accessed is the user's first access. Based on the determination result, it is determined whether to trigger the use of cache, thereby improving the utilization rate of cached data.

[0136] Furthermore, when the interface type of the data interface to be accessed is a non-cached interface, the data interface to be accessed is called to obtain page data.

[0137] In this embodiment, when the data interface type is a non-cached interface, it is determined that the data interface to be accessed does not have the function of caching data. Therefore, no data caching is performed, and the data interface to be accessed is directly called to obtain page data, which improves the timeliness of obtaining page data.

[0138] The determination module 204 is used to determine a caching strategy based on the parameter information of the data interface to be accessed when the data interface to be accessed is not being accessed by the user for the first time.

[0139] In this embodiment, the caching strategy includes either calling the data interface to be accessed to retrieve page data again or using the cached data from the last cached data of the data interface to be accessed.

[0140] In an optional embodiment, the determining module 204 determines the caching strategy based on the parameter information of the data interface to be accessed, including:

[0141] Obtain the current access time and the cache time of the last cached data from the parameter information of the data interface to be accessed;

[0142] Calculate the difference between the current access time and the cache time of the last cached data to obtain the target difference;

[0143] Determine whether the target difference is greater than the cache timeout threshold;

[0144] When the target difference is greater than or equal to the cache timeout threshold, the caching strategy is determined to be to call the data interface to be accessed to re-obtain the page data.

[0145] In this embodiment, different cache timeout thresholds are set for different interfaces. When using the local storage of the page frontend to cache interface data, the cache timeout threshold for the cached data of each interface is marked. For example, for page operation data, the real-time requirement can be set within 10 minutes, and the cache timeout threshold is set to 10 minutes. When it is greater than or equal to 10 minutes, the cache is cleared and the data interface to be accessed is called to retrieve the page data again. For data on gas station lists with discounted prices, the real-time requirement can be set within 3 minutes, and the cache timeout threshold is set to 3 minutes. When it is greater than or equal to 3 minutes, the cache is cleared and the data interface to be accessed is called to retrieve the page data again. By setting different cache timeout thresholds for different interfaces, server traffic during peak hours can be effectively reduced, while ensuring the reasonable and normal display of data.

[0146] Furthermore, determining whether the target difference is greater than the cache timeout threshold also includes:

[0147] When the target difference is less than the cache timeout threshold, the parameter information of multiple target parameters that the data interface to be accessed depends on is obtained from the parameter information of the data interface to be accessed.

[0148] Analyze the parameter information of each target parameter and obtain the analysis results for the corresponding target parameter;

[0149] When the analysis results of each target parameter meet the conditions for using cached data, the caching strategy is determined to be to use the cached data last cached by the data interface to be accessed;

[0150] When the analysis results of each target parameter do not meet the conditions for using cached data, the caching strategy is determined to be to call the data interface to be accessed to re-obtain the page data.

[0151] Furthermore, the analysis of parameter information for each target parameter and the acquisition of analysis results for the corresponding target parameters include:

[0152] Analyze the parameter information of each target parameter to obtain the change information of the corresponding target parameter;

[0153] The change information of each target parameter is determined as the analysis result of each target parameter.

[0154] In this embodiment, if the user accesses a gas station list page, the target parameters may include location parameters, city parameters, coupon parameters, supplier parameters, and fuel type.

[0155] In one optional embodiment, changes in location parameters, city parameters, coupon parameters, supplier parameters, and fuel type parameters determine which gas stations are displayed on the gas station list page accessed by the user.

[0156] For example, regarding the location parameters, the gas station query list is a circle centered on the user's current location, containing information on all gas stations within a 30-kilometer radius. Analysis shows that changes in the location parameters meet the conditions for using cached data, meaning the changes in the location parameters are minor and have little impact on the queried gas station list. Therefore, it is not necessary to call the data interface to be accessed to re-obtain page data. The caching strategy is determined to be to use the cached data from the last cached data from the data interface to be accessed.

[0157] Regarding the city parameter, if the current location city is not the same as the selected query city, the location point of the queried gas station list will be a default location point of the selected query city. Since the city information changes significantly, the caching strategy is to call the data interface to be accessed to re-obtain the page data.

[0158] Regarding the coupon parameters, if a user filters by the gas stations that the coupon can be used at, different coupons correspond to different gas station lists, and the list of gas stations retrieved varies greatly. Therefore, the caching strategy is to call the data interface to be accessed to re-retrieve the page data.

[0159] Regarding the supplier parameters, if a user requests a supplier that is different from the last cached supplier, and the list of gas stations retrieved changes significantly, the caching strategy is determined to be to call the data interface to be accessed to retrieve the page data again.

[0160] For each fuel code, different fuel codes support different lists of gas stations. If the specific fuel code being queried is different from the last cached fuel code, and the list of gas stations retrieved changes significantly, the caching strategy is to call the data interface to be accessed to re-retrieve the page data. If the specific fuel code being queried is the same as the last cached fuel code, and the list of gas stations retrieved does not change significantly, the caching strategy is to use the cached data from the last cached data retrieved by the data interface to be accessed.

[0161] The acquisition module 205 is used to acquire page data based on the caching strategy.

[0162] In this embodiment, the caching interface includes a deferred interface. Specifically, the deferred interface refers to data that can be loaded later after the data display logic, without affecting the main function of the page.

[0163] In an optional embodiment, the acquisition module 205 acquires page data based on the caching strategy, including:

[0164] Identify whether the cache interface to be accessed is a deferred interface;

[0165] When the cache interface to be accessed is a deferred interface, a timer is set to retrieve page data based on the caching strategy within a preset time.

[0166] When the cache interface to be accessed is not a deferred interface, page data is obtained based on the caching strategy.

[0167] In this embodiment, when the cached interface to be accessed is identified as a deferred interface, a page access request is initiated after a preset time when the page is loaded by setting a timer. For example, the preset time can be 1 second or 2 seconds, which ensures that the bandwidth resources requested in advance for important interfaces, thereby improving the accuracy and efficiency of data acquisition.

[0168] In other optional embodiments, if 10 page access requests are received, the caching strategy corresponding to 4 caching interfaces is to use the cached data last cached by the data interface to be accessed, avoiding the request to the backend service to call the data interface to be accessed to retrieve the page data again. The reasonable use of the caching strategy reduces traffic and the number of server requests by about 40%, effectively reducing the pressure on server traffic during peak hours, greatly improving response speed and user access experience, and improving data acquisition efficiency.

[0169] In this embodiment, by identifying the interface type of the data interface to be accessed, determining the corresponding caching strategy based on the identification and analysis results, and obtaining page data according to the corresponding caching strategy, the efficiency and accuracy of obtaining page data are improved.

[0170] The acquisition module 205 is also used to call the data interface to be accessed to re-acquire page data when the data interface to be accessed is the user's first access.

[0171] In this embodiment, when a user visits a page for the first time, the first set of data for that page is cached, so that the cache can be triggered when the same page is visited again, thus improving data retrieval efficiency.

[0172] In summary, the AI-based data acquisition device described in this embodiment identifies the interface type of the data interface to be accessed. Since different interface types correspond to different caching strategies, this improves the diversity and flexibility of caching strategies. It determines whether the data interface to be accessed is the user's first access, and based on the determination result, decides whether to trigger caching, thereby improving the utilization rate of cached data. When the data interface to be accessed is not the user's first access, it determines the caching strategy based on the parameter information of the data interface to be accessed, and acquires page data based on the caching strategy. The reasonable application of the caching strategy reduces traffic and the number of server requests, effectively reducing server traffic pressure during peak hours, greatly improving response speed and user access experience, and simultaneously improving data acquisition efficiency.

[0173] Example 3

[0174] See Figure 3 The diagram shown is a structural schematic of an electronic device provided in Embodiment 3 of the present invention. In a preferred embodiment of the present invention, the electronic device 3 includes a memory 31, at least one processor 32, at least one communication bus 33, and a transceiver 34.

[0175] Those skilled in the art should understand that Figure 3 The structure of the electronic device shown does not constitute a limitation of the embodiments of the present invention. It can be a bus structure or a star structure. The electronic device 3 may also include more or fewer other hardware or software than shown, or different component arrangements.

[0176] In some embodiments, the electronic device 3 is an electronic device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital processors, and embedded devices. The electronic device 3 may also include client devices, including, but not limited to, any electronic product capable of human-computer interaction with a client via a keyboard, mouse, remote control, touchpad, or voice control device, such as personal computers, tablet computers, smartphones, and digital cameras.

[0177] It should be noted that the electronic device 3 is merely an example. Other existing or future electronic products that are suitable for this invention should also be included within the scope of protection of this invention and are incorporated herein by reference.

[0178] In some embodiments, the memory 31 is used to store program code and various data, such as the AI-based data acquisition device 20 installed in the electronic device 3, and to achieve high-speed and automatic access to programs or data during the operation of the electronic device 3. The memory 31 includes read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0179] In some embodiments, the at least one processor 32 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits packaged with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The at least one processor 32 is the control unit of the electronic device 3, connecting various components of the entire electronic device 3 via various interfaces and lines. It executes programs or modules stored in the memory 31 and calls data stored in the memory 31 to perform various functions and process data of the electronic device 3.

[0180] In some embodiments, the at least one communication bus 33 is configured to enable communication between the memory 31 and the at least one processor 32, etc.

[0181] Although not shown, the electronic device 3 may also include a power supply (such as a battery) to power the various components. Optionally, the power supply may be logically connected to the at least one processor 32 via a power management device, thereby enabling functions such as charging, discharging, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 3 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0182] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0183] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) or processor to execute portions of the methods described in the various embodiments of the present invention.

[0184] In a further embodiment, combined with Figure 2 The at least one processor 32 can execute the operating device of the electronic device 3 and various installed applications (such as the artificial intelligence-based data acquisition device 20), program code, etc., for example, the various modules mentioned above.

[0185] The memory 31 stores program code, and the at least one processor 32 can call the program code stored in the memory 31 to execute related functions. For example, Figure 2 The modules described herein are program codes stored in the memory 31 and executed by the at least one processor 32, thereby realizing the functions of the modules to achieve the purpose of data acquisition based on artificial intelligence.

[0186] For example, the program code can be divided into one or more modules / units, which are stored in the memory 31 and executed by the processor 32 to complete this application. The one or more modules / units can be a series of computer-readable instruction segments capable of performing a specific function, which describe the execution process of the program code in the electronic device 3. For example, the program code can be divided into a parsing and acquisition module 201, an identification module 202, a judgment module 203, a determination module 204, and an acquisition module 205.

[0187] In one embodiment of the present invention, the memory 31 stores a plurality of computer-readable instructions, which are executed by the at least one processor 32 to achieve a data acquisition function based on artificial intelligence.

[0188] Specifically, the specific implementation method of the above instructions by the at least one processor 32 can be referred to Figure 1 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.

[0189] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0190] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0191] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0192] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other elements, and the singular does not exclude the plural. Multiple elements or devices recited in the present invention may also be implemented by a single element or device in software or hardware. The terms "first," "second," etc., are used to denote names and do not indicate any particular order.

[0193] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A data acquisition method based on artificial intelligence, characterized in that, The method includes: Parse the received user page access request and obtain the data interface to be accessed; Identify the interface type of the data interface to be accessed; When the interface type of the data interface to be accessed is a cache interface, determine whether the data interface to be accessed is the first time the user is accessing it; When the data interface to be accessed is not the user's first access, a caching strategy is determined based on the parameter information of the data interface to be accessed, including: obtaining the current access time and the cache time of the last cached data from the parameter information of the data interface to be accessed; calculating the difference between the current access time and the cache time of the last cached data to obtain a target difference; determining whether the target difference is greater than a cache timeout threshold; when the target difference is greater than or equal to the cache timeout threshold, determining the caching strategy to clear the cache and call the data interface to be accessed to re-obtain page data; the step of determining whether the target difference is greater than the cache timeout threshold... It also includes: when the target difference is less than the cache timeout threshold, obtaining parameter information of multiple target parameters that the data interface to be accessed depends on from the parameter information of the data interface to be accessed; analyzing the parameter information of each target parameter to obtain the change information of the corresponding target parameter; determining the change information of each target parameter as the analysis result of each target parameter; when the analysis result of each target parameter meets the conditions for using cached data, determining the caching strategy to use the cached data last cached by the data interface to be accessed; when the analysis result of each target parameter does not meet the conditions for using cached data, determining the caching strategy to call the data interface to be accessed to re-obtain page data; Page data is obtained based on the caching strategy described above.

2. The data acquisition method based on artificial intelligence as described in claim 1, characterized in that, The interface types for identifying the data interface to be accessed include: Identify the interface attributes of the data interface to be accessed; When the interface attribute of the data interface is a preset first interface attribute, the interface type of the data interface to be accessed is determined to be a cache interface; When the interface attribute of the data interface is a preset second interface attribute, the interface type of the data interface to be accessed is determined to be a non-cached interface.

3. The data acquisition method based on artificial intelligence as described in claim 1, characterized in that, The process of obtaining page data based on the caching strategy includes: Identify whether the cache interface to be accessed is a deferred interface; When the cache interface to be accessed is a deferred interface, a timer is set to retrieve page data based on the caching strategy within a preset time. When the cache interface to be accessed is not a deferred interface, page data is obtained based on the caching strategy.

4. The data acquisition method based on artificial intelligence as described in any one of claims 1 to 3, characterized in that, The method further includes: When the data interface to be accessed is being accessed for the first time by the user, the data interface to be accessed is called to retrieve the page data again.

5. A data acquisition device based on artificial intelligence, characterized in that, The apparatus includes a module for implementing the method as described in any one of claims 1 to 4, the apparatus comprising: The parsing and retrieval module is used to parse the received page access requests from users and retrieve the data interface to be accessed; The identification module is used to identify the interface type of the data interface to be accessed; The judgment module is used to determine whether the data interface to be accessed is the first time the user is accessing it when the interface type of the data interface to be accessed is a cache interface; The determination module is used to determine a caching strategy based on the parameter information of the data interface to be accessed when the data interface to be accessed is not being accessed by the user for the first time. The acquisition module is used to acquire page data based on the caching strategy.

6. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the artificial intelligence-based data acquisition method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the artificial intelligence-based data acquisition method as described in any one of claims 1 to 4.