A data export method and apparatus
By configuring authentication identifiers for users and utilizing Redis caching management, the problem of sensitive data leakage in paginated queries is solved, and the security and efficiency of data export are improved. It is suitable for data export devices and electronic devices.
Patent Information
- Application Number
- CN202210553220.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-05-19
AI Technical Summary
When dealing with large volumes of data, data export based on pagination queries poses a security risk of sensitive data leakage, especially when administrator accounts are maliciously stolen. Existing technologies cannot guarantee the security and efficiency of data export.
By configuring authentication identifiers for target users and managing these identifiers using Redis caching, authentication is performed only on the first pagination query, eliminating the need for repeated authentication on subsequent pagination queries. This approach, combined with MyBatis and PageHelper, optimizes the data export process for pagination queries.
While ensuring the security of data export, the efficiency of data export is improved, the frequency of calling the CAPTCHA interface is reduced, and the security and performance of the system are enhanced.
Smart Images

Figure CN115048628B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data export technology, and in particular to a data export method and apparatus. Background Technology
[0002] To facilitate data integration for operators and administrators, many systems have data export functions. These functions greatly facilitate operators and administrators and significantly improve their work efficiency. Currently, when dealing with large amounts of data, paginated queries are generally used to reduce the pressure on backend servers and database queries. However, in some scenarios, the exported data may involve sensitive information such as mobile phone numbers and ID card numbers. If an administrator's account is maliciously stolen, this sensitive data is at risk of being leaked. Therefore, the security issues related to paginated queries have become an urgent technical problem to be solved. Summary of the Invention
[0003] This application provides a data export method and apparatus to improve the security and efficiency of data export when exporting data based on pagination queries.
[0004] Firstly, a data export method is provided, the method comprising:
[0005] Receive a data export request from a target user; wherein the data export request includes the target user's identity information and pagination query parameters;
[0006] Determine whether there exists an authentication identifier corresponding to the target user's identity information; wherein, the authentication identifier is an identifier configured for the target user during the first pagination query to indicate that authentication has been completed;
[0007] If the authentication identifier exists, then query the target data based on the pagination query parameters;
[0008] The target data is exported according to the preset rules.
[0009] Optionally, the method further includes:
[0010] If the authentication identifier does not exist, then authentication information is sent to the target user for authentication.
[0011] If feedback information based on the authentication information is received from the target user within a preset time period, then an authentication identifier is configured for the target user based on the target user's identity information;
[0012] If the feedback information is not received within the preset time period, the data export request of the target user will not be responded to.
[0013] Optionally, the authentication identifier is a remote data service Redis cache, and configuring the authentication identifier for the target user based on the target user's identity information includes:
[0014] Configure a new Redis cache for the target user;
[0015] The new Redis cache key is set based on the target user's identity information, and an expiration time is set for the new Redis cache; wherein, the expiration time is related to the time required for pagination queries, and the new Redis cache is deleted after the expiration time is reached.
[0016] Optionally, the data export request may also include data filtering conditions, and the data query based on the pagination query parameters includes:
[0017] The target data is queried based on the pagination query parameters and data filtering conditions.
[0018] Optionally, before exporting the target data according to preset rules, the method further includes:
[0019] Based on the pagination query parameters, determine whether the current pagination query is the last pagination query;
[0020] If the current pagination query is the last pagination query, then delete the authentication identifier.
[0021] Secondly, a data export device is provided, the device comprising:
[0022] A communication module is used to receive a data export request from a target user; wherein the data export request includes the target user's identity information and pagination query parameters;
[0023] An authentication module is used to determine whether there is an authentication identifier corresponding to the target user's identity information; wherein, the authentication identifier is an identifier configured for the target user during the first pagination query to indicate that authentication has been completed;
[0024] The data query module is used to query target data based on the pagination query parameters when the authentication identifier exists;
[0025] The data export module is used to export the target data according to preset rules.
[0026] Optionally, the authentication module is further configured to:
[0027] If the authentication identifier does not exist, then authentication information is sent to the target user for authentication.
[0028] If feedback information based on the authentication information is received from the target user within a preset time period, then an authentication identifier is configured for the target user based on the target user's identity information;
[0029] If the feedback information is not received within the preset time period, the data export request of the target user will not be responded to.
[0030] Optionally, the authentication identifier is a remote data service Redis cache, and the authentication module is specifically used for:
[0031] Configure a new Redis cache for the target user;
[0032] The new Redis cache key is set based on the target user's identity information, and an expiration time is set for the new Redis cache; wherein, the expiration time is related to the time required for pagination queries, and the new Redis cache is deleted after the expiration time is reached.
[0033] Optionally, the data export request may also include data filtering conditions, and the data query module is specifically used for:
[0034] The target data is queried based on the pagination query parameters and data filtering conditions.
[0035] Optionally, the device further includes a data cleaning module for:
[0036] Based on the pagination query parameters, determine whether the current pagination query is the last pagination query;
[0037] If the current pagination query is the last pagination query, then delete the authentication identifier.
[0038] Thirdly, an electronic device is provided, comprising:
[0039] Memory, used to store program instructions;
[0040] A processor is configured to invoke program instructions stored in the memory and execute the steps included in the method described in the first aspect according to the obtained program instructions.
[0041] Fourthly, a computer-readable storage medium is provided for storing instructions that, when executed, cause the method described in the first aspect to be implemented.
[0042] Fifthly, a computer program product containing instructions is provided, wherein the computer program product stores instructions that, when run on a computer, cause the computer to perform the method described in the first aspect.
[0043] In this embodiment of the application, a data export request from a target user is received. The data export request includes the target user's identity information and pagination query parameters. It is determined whether there is an authentication identifier corresponding to the target user's identity information. The authentication identifier is an identifier configured for the target user during the first pagination query to indicate that authentication has been completed. If the authentication identifier exists, the target data is queried based on the pagination query parameters, and then the target data is exported according to preset rules.
[0044] In other words, this application configures an authentication identifier for the user after successful authentication during the first pagination query. In subsequent pagination queries, if the authentication identifier exists, there is no need to authenticate again, and the data can be queried directly. That is, only one authentication is required in the pagination query, and there is no need to repeatedly call the verification code interface to authenticate the user. This can ensure the security of data export while improving the efficiency of data export. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application.
[0046] Figure 1 A flowchart illustrating a data export method provided in an embodiment of this application;
[0047] Figure 2 A flowchart illustrating another data export method provided in this application embodiment;
[0048] Figure 3 A structural block diagram of a data export device provided in an embodiment of this application;
[0049] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0051] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0052] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0053] Before introducing the embodiments of this application, some technical features of this application will be introduced first to facilitate understanding by those skilled in the art.
[0054] (1) Front-end technology, based on the Vue framework. As a lightweight front-end framework, Vue has many advantages: Vue can be developed in a component-based manner, separating data and structure, reducing the amount of code, thereby improving development efficiency and making it easy to understand; Vue's most prominent advantage is that it performs two-way data binding and uses the Virtual Document Object Model (DOM); compared with traditional pages that use hyperlinks to achieve page navigation, Vue uses route navigation without refreshing the page; Vue is a single-page application, with partial page refresh, and does not need to request data every time it navigates, which speeds up access and improves user experience.
[0055] (2) Backend technology is based on the Spring Cloud framework. Spring Cloud is a microservice governance framework based on Spring Boot, belonging to the Spring family, with rich components and complete functions. Spring Cloud provides very complete support for microservice architecture, such as configuration management, service discovery, circuit breakers, microservice gateways, etc. Spring Cloud allows individual microservices to start up quickly, with finer-grained service decomposition and lower coupling, which is conducive to resource reuse and improves development efficiency; it allows for more precise formulation of service optimization plans, improving system maintainability; it is suitable for the Internet era, with shorter product iteration cycles.
[0056] (3) Remote Dictionary Server (Redis) is an open-source, log-structured, key-value database written in standard ANSI C, licensed under the Berkeley Software Distribution (BSD) license, supporting network access, and capable of both in-memory and persistent storage. It provides application programming interfaces (APIs) for multiple languages. It is often referred to as a data structure server because values can be of various types, including strings, hashes, lists, sets, and sorted sets.
[0057] Redis is a key-value storage repository that stores data in memory, can withstand high-concurrency read and write operations, and supports various features such as transactions, key expiration policies, publish-subscribe, and multiple data types. Redis data resides in memory, similar to a hash map. The advantage of a hash map is that the time complexity for lookups and operations is O(1). Because it operates purely in memory, Redis boasts excellent performance, handling over 100,000 read and write operations per second, making it the fastest known key-value database. Furthermore, the Spring Cloud framework integrates RedisTemplate, providing easy access to Redis services within Spring applications. It highly encapsulates the underlying Redis development packages (Jedis, JRedis, and RJC), offering various Redis operations, exception handling, and serialization, supporting publish-subscribe, and implementing Spring 3.1 Cache.
[0058] The data export method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings. Please refer to... Figure 1 As shown, the flowchart of the data export method provided in this application is described below:
[0059] Step 101: Receive the target user's data export request;
[0060] In this embodiment, the target user's data export request includes the target user's identity information and pagination query parameters. The target user's identity information may include parameters such as the user's mobile phone number and userId. The user's mobile phone number is primarily used for user authentication. For example, when a user initiates a data export request through the front-end, the front-end sends the user's mobile phone number from the data export request to the back-end. After receiving the user's mobile phone number, the back-end calls the relevant interface to authenticate the user and confirm whether the user initiating the data export request is indeed the user. The userId is the user's identity ID, automatically generated when the user registers or logs in for the first time, and can be used to uniquely identify the user.
[0061] Step 102: Determine whether an authentication identifier exists that corresponds to the target user's identity information;
[0062] As described in step 101, a user can be uniquely identified by their userId. In this embodiment, during the first pagination query, the target user is authenticated. Upon successful authentication, an identifier is configured for the target user to indicate that authentication has been completed. This allows subsequent pagination queries to determine whether authentication is required by simply checking if an authentication identifier corresponding to the target user's identity information exists. If an authentication identifier exists for the target user, authentication is not required again, and step 103 is executed directly. If no identifier exists, authentication is required, and step 103 is executed after successful authentication.
[0063] In the specific implementation process, when authenticating a target user, authentication information can be sent based on the mobile phone number carried in the identity information sent by the target user when sending the data export request. If feedback information based on the authentication information is received from the target user within a preset time period, it indicates that the target user has been successfully authenticated. At this time, an authentication identifier can be configured for the target user based on the userId carried in the identity information sent by the target user when sending the data export request. If no feedback information based on the authentication information is received from the target user within a preset time period, it indicates that the target user's account may have been stolen, or that the target user has accidentally triggered the data export request, resulting in authentication failure. In this case, the data export request of the target user can be ignored.
[0064] As one possible implementation, in this embodiment, the authentication identifier is a Redis cache. As mentioned earlier, Redis is a key-value store where data is stored in memory and can withstand high-concurrency read and write operations. Furthermore, in the backend technology used in this application, the Spring Cloud framework integrates RedisTemplate, which provides access to Redis services through simple configuration in Spring applications. It highly encapsulates the underlying Redis development packages (Jedis, JRedis, and RJC). RedisTemplate provides various Redis operations, exception handling, and serialization, and supports publish-subscribe. Therefore, this embodiment can effectively utilize Redis caching by operating RedisTemplate.
[0065] Specifically, when configuring an authentication identifier for a target user, a new Redis cache needs to be configured first. The key in this Redis cache is set based on the target user's identity information, uniquely identifying the target user through this key value. For example, the Redis cache key value can be set to the target user's corresponding userId. Then, the expiration time of this Redis cache is set. The expiration time value is related to the time required for paginated queries (i.e., all data can be queried within the set expiration time), typically set to 30s or 60s. This indicates that the Redis cache exists within this expiration time, and after the expiration time, the Redis cache is terminated. Therefore, to determine whether an authentication identifier corresponding to the target user's identity information exists, it can be determined whether a Redis cache corresponding to the target user exists, with the key value of the target user's userId.
[0066] In the specific implementation process, by configuring an authentication identifier, authentication only needs to be performed once during paginated queries (i.e., authentication only needs to be performed once regardless of how many pages are queried), eliminating the need to call the CAPTCHA interface for authentication every time a page is queried. This can improve the efficiency of paginated queries while ensuring the security of data export.
[0067] Step 103: If an authentication identifier exists, query the target data based on the pagination query parameters;
[0068] In early web project development, adding data to a database required not only a database driver but also various configuration files, such as Java Bean configurations, data source configurations, and mappings between objects and database fields. However, with Spring Cloud, only dependency files are needed; the Spring Cloud framework already provides all the necessary configuration files, saving significant configuration work and improving development efficiency. Furthermore, because the backend technology used in this application integrates MyBatis for database interaction within the Spring Cloud framework, in this embodiment, after verifying the target user's identity, paginated data queries based on pagination parameters can be performed using MyBatis and PageHelper.
[0069] In one possible implementation, this application may also introduce the PageHelper plugin. PageHelper is a free and open-source third-party physical pagination plugin for MyBatis. After PageHelper obtains the pre-compiled Structured Query Language (SQL) statement in the same thread through an interceptor, it packages the SQL statement into a pagination-enabled SQL statement based on pagination parameters and assigns it to the next operation, so that the actually executed SQL statement is a pagination-enabled SQL statement.
[0070] As one possible implementation, considering that although the Redis cache corresponding to the target user has an expiration time, malicious account theft and data re-export may still occur within this time. If the Redis cache is not cleared, the data can still be queried and exported. Therefore, in this embodiment, each pagination query can also determine whether the currently executed pagination query is the last one. If the current pagination query is the last one, it indicates that the data query has ended, and at this time, the authentication identifier of the target user can be deleted; specifically, the Redis cache configured for the target user can be deleted.
[0071] Step 104: Export the target data according to the preset rules.
[0072] In this embodiment, after the backend retrieves the data to be exported (i.e., the target data), it sends the target data to the frontend. The frontend encapsulates and exports the data according to the names of each column and the corresponding field names in the pre-written table header. Specifically, when encapsulating and exporting the data, the frontend can use an ExcelJS plugin to perform the export function. The ExcelJS plugin automatically uses the field names to find data with matching field names in the data sent by the backend and fills it in. If the style of a specific location needs to be modified, the number of rows and columns to be modified are located according to the specific situation, and the corresponding modifications are made. For example, if the first column of the table contains the name and its corresponding field name, the second column contains the ID card number and its corresponding field name, and the third column contains the education level and its corresponding field name, then the frontend queries the data sent by the backend for the field names corresponding to the name, ID card number, and education level, and fills the query results into the corresponding tables.
[0073] In one possible implementation, users sometimes do not want to export the full amount of data, but rather want to export data that meets certain conditions. In this case, users can input data filtering conditions when initiating a data export request, and send the data filtering conditions to the backend along with the data export request. The backend performs pagination queries based on the data filtering conditions and pagination query parameters, which makes the batch data export function more convenient and flexible.
[0074] In practice, querying data on the backend and exporting data on the frontend can balance the pressure on the frontend and backend servers and improve data export efficiency.
[0075] To better understand the technical solution of this application, the predistortion extension model and the method for implementing predistortion provided in this application will be explained and described below with reference to specific embodiments.
[0076] Example
[0077] Please see Figure 2As shown, after user A initiates a data export request, the system checks if a corresponding Redis cache exists based on userIdA in the data export request. The key value of this Redis cache is userIdA. If it exists, the system queries the data based on the pagination parameters. If it does not exist, the system sends a verification code to user A using the mobile phone number included in the data export request to verify user A's identity. If the verification code is not received from user A within a preset time, the data export request is sent as an exception, and the system does not respond to the data export request (i.e., throws an exception). If the verification code is received from user A within the preset time, a new Redis cache is configured for user A, with the key value set to userIdA and the expiration time set to 60 seconds. The system then queries the data based on the pagination parameters. After querying the data, the system checks if the current pagination query is the last pagination query. If it is, the Redis cache corresponding to user A is deleted. If it is not the last pagination query, the aforementioned steps are repeated. After the backend deletes the Redis cache corresponding to user A, it sends the retrieved target data to the frontend, which then encapsulates and exports the data.
[0078] Based on the same inventive concept, embodiments of this application provide a data export device capable of implementing the functions corresponding to the aforementioned data export method. This data export device can be a hardware structure, a software module, or a hardware structure plus a software module. The data export device can be implemented by a chip system, which can consist of chips or include chips and other discrete components. Please refer to... Figure 3 As shown, the data export device includes a communication module 301, an authentication module 302, a data query module 303, a data export module 304, and a data cleaning module 305. Wherein:
[0079] The communication module 301 is used to receive a data export request from a target user; wherein the data export request includes the target user's identity information and pagination query parameters;
[0080] The authentication module 302 is used to determine whether there is an authentication identifier corresponding to the target user's identity identifier information; wherein, the authentication identifier is an identifier configured for the target user during the first pagination query to indicate that authentication has been completed;
[0081] Data query module 303 is used to query target data based on the pagination query parameters when the authentication identifier exists;
[0082] The data export module 304 is used to export the target data according to preset rules.
[0083] Optionally, the authentication module 302 is further configured to:
[0084] If the authentication identifier does not exist, then authentication information is sent to the target user for authentication.
[0085] If feedback information based on the authentication information is received from the target user within a preset time period, then an authentication identifier is configured for the target user based on the target user's identity information;
[0086] If the feedback information is not received within the preset time period, the data export request of the target user will not be responded to.
[0087] Optionally, the authentication identifier is a remote data service Redis cache, and the authentication module 302 is specifically used for:
[0088] Configure a new Redis cache for the target user;
[0089] The new Redis cache key is set based on the target user's identity information, and an expiration time is set for the new Redis cache; wherein, the expiration time is related to the time required for pagination queries, and the new Redis cache is deleted after the expiration time is reached.
[0090] Optionally, the data export request may also include data filtering conditions, and the data query module 303 is specifically used for:
[0091] The target data is queried based on the pagination query parameters and data filtering conditions.
[0092] Optionally, the device further includes a data cleaning module 305, used for:
[0093] Based on the pagination query parameters, determine whether the current pagination query is the last pagination query;
[0094] If the current pagination query is the last pagination query, then delete the authentication identifier.
[0095] All relevant content of each step involved in the aforementioned data export method embodiments can be referenced to the functional description of the corresponding functional module of the data export device in the embodiments of this application, and will not be repeated here.
[0096] The module division in this embodiment is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in each embodiment of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0097] Based on the same inventive concept, embodiments of this application provide an electronic device. Please refer to... Figure 4 As shown, the electronic device includes at least one processor 401 and a memory 402 connected to the at least one processor. In this embodiment, the specific connection medium between the processor 401 and the memory 402 is not limited. Figure 4 Taking the connection between processor 401 and memory 402 via bus 400 as an example, bus 400 in... Figure 4 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. The 400 bus can be divided into address bus, data bus, control bus, etc., for ease of representation. Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0098] In this embodiment of the application, the memory 402 stores instructions that can be executed by at least one processor 401. By executing the instructions stored in the memory 402, at least one processor 401 can perform the steps included in the aforementioned data export method.
[0099] The processor 401 is the control center of the electronic device. It can connect to various parts of the electronic device through various interfaces and lines. By running or executing instructions stored in the memory 402 and calling data stored in the memory 402, it monitors the various functions and data processing of the electronic device as a whole. Optionally, the processor 401 may include one or more processing units. The processor 401 may integrate an application processor and a modem processor. The application processor mainly handles the operating system and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.
[0100] Processor 401 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the data export method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0101] Memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 402 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 402 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 402 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0102] By designing and programming the processor 401, the code corresponding to the data export method described in the foregoing embodiments can be embedded into the chip, so that the chip can execute the steps of the aforementioned data export method when running. How to design and program the processor 401 is a well-known technique to those skilled in the art, and will not be described in detail here.
[0103] Based on the same inventive concept, embodiments of this application also provide a computationally readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the steps of the aforementioned data export method.
[0104] In some possible implementations, various aspects of the data export method provided in this application may also be implemented in the form of a program product, which includes program code that, when the program product is run on an electronic device, causes the detection device to perform the steps in the data export method according to the various exemplary embodiments of this application described above.
[0105] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0106] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0108] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0109] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A data export method, characterized by, The method comprises: receiving a data export request of a target user; wherein the data export request comprises target user identity information and a page query parameter; determining whether there is an identity authentication identifier corresponding to the target user identity information; wherein the identity authentication identifier is an identifier configured for the target user to indicate that the identity authentication has been completed when the first page query is performed, and the identity authentication identifier is a Redis cache of a remote data service, the expiration duration of the Redis cache is related to the duration required for the page query, and the Redis cache is deleted after the expiration duration is reached; if the identity authentication identifier exists, querying target data based on the page query parameter; if the identity authentication identifier does not exist, performing identity authentication on the target user, and after the identity authentication is passed, querying target data based on the page query parameter; exporting the target data according to the name of each column in the pre-written table header and the corresponding field name.
2. The method of claim 1, wherein, The method further comprises: if the identity authentication identifier does not exist, sending identity authentication information to the target user for identity authentication; if the feedback information of the target user based on the identity authentication information is received within a preset duration, configuring an identity authentication identifier for the target user based on the identity information of the target user; if the feedback information is not received within the preset duration, not responding to the data export request of the target user.
3. The method of claim 2, wherein, The method of configuring an identity authentication identifier for the target user based on the identity information of the target user comprises: configuring a new Redis cache for the target user; setting the key in the new Redis cache based on the identity information of the target user, and setting the expiration duration of the new Redis cache.
4. The method of claim 1, wherein, The data export request further comprises a data filtering condition, and the method of querying data based on the page query parameter comprises: querying the target data based on the page query parameter and the data filtering condition.
5. The method of claim 1, wherein, Before the method of exporting the target data according to the name of each column in the pre-written table header and the corresponding field name, the method further comprises: determining whether the current page query is the last page query based on the page query parameter; if the current page query is the last page query, deleting the identity authentication identifier.
6. A data export apparatus characterized by comprising: The apparatus comprises: a communication module configured to receive a data export request of a target user; wherein the data export request comprises target user identity information and a page query parameter; an identity authentication module configured to determine whether there is an identity authentication identifier corresponding to the target user identity information; wherein the identity authentication identifier is an identifier configured for the target user to indicate that the identity authentication has been completed when the first page query is performed, and the identity authentication identifier is a Redis cache of a remote data service, the expiration duration of the Redis cache is related to the duration required for the page query, and the Redis cache is deleted after the expiration duration is reached; The data query module is configured to query target data based on the page query parameter if the identity authentication identifier exists, and to perform identity authentication on the target user and query target data based on the page query parameter after the identity authentication is passed if the identity authentication identifier does not exist. The data export module is configured to export the target data according to the name of each column in the pre-written table header and the corresponding field name.
7. The apparatus of claim 6, wherein, The identity authentication module is further configured to: send identity authentication information to the target user for identity authentication if the identity authentication identifier does not exist; configure an identity authentication identifier for the target user based on the identity information of the target user if the feedback information of the target user based on the identity authentication information is received within a preset time period; not respond to the data export request of the target user if the feedback information is not received within the preset time period.
8. The apparatus of claim 7, wherein, The identity authentication identifier is a remote data service Redis cache, and the identity authentication module is specifically configured to: configure a new Redis cache for the target user; set a key in the new Redis cache based on the identity information of the target user, and set an expiration time for the new Redis cache.
9. The apparatus of claim 6, wherein, The data export request further includes a data filtering condition, and the data query module is specifically configured to: query the target data based on the page query parameter and the data filtering condition.
10. The apparatus of claim 6, wherein, The device further includes a data cleaning module configured to: determine whether the current page query is the last page query based on the page query parameter; and delete the identity authentication identifier if the current page query is the last page query.
11. An electronic device, comprising: The device includes: a memory configured to store program instructions; a processor configured to call the program instructions stored in the memory and perform the steps included in the method according to the obtained program instructions.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store instructions, and when the instructions are executed, the method according to any one of claims 1-5 is implemented.
13. A computer program product comprising instructions, characterized in that, The computer program product stores instructions, and when the instructions are executed on a computer, the computer performs the method according to any one of claims 1-5.
Citation Information
Patent Citations
Data query method and computer readable storage medium
CN112100226A