A user authentication method and system based on Excel application
By obtaining Token files or ApiKey for user authentication of Excel applications, the problem of confusing user authentication management in Excel applications is solved, unified authentication management and efficient user authentication process are realized, and user experience and server security are improved.
Patent Information
- Application Number
- CN202111353040.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-11-16
AI Technical Summary
In existing Excel applications, user authentication management is relatively chaotic, it is difficult to adapt to the authentication needs of different users, and there is a risk of illegal access to the server.
Obtain authentication information by obtaining Token files or ApiKey, perform user authentication processing based on authentication information, and update local token files to manage the authentication process uniformly to adapt to the authentication needs of different users.
It realizes unified authentication management of Excel tools, simplifies the authentication process, avoids illegal access, improves authentication efficiency and user experience, and reduces the burden on the server.
Smart Images

Figure CN114048445B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Excel applications, and in particular relates to a user authentication method and system based on Excel applications. Background Art
[0002] Typically, Excel applications are widely used for office work, and these tools are highly distributed. Excel applications require numerous calls to corresponding cloud microservices, which require authentication before invocation. Distributed microservice calls require authentication and valid credentials to access the server, ensuring server security. However, current user authentication management is complex and difficult to adapt to the authentication needs of diverse users. Summary of the Invention
[0003] In view of this, an embodiment of the present invention provides a user authentication method and system based on Excel application, which is used to solve the problem that the existing authentication management is relatively chaotic and difficult to adapt to the needs of different users.
[0004] In a first aspect of an embodiment of the present invention, a user authentication method based on an Excel application is provided, comprising:
[0005] According to the environment setting information of the sheet, obtain the environment that the user needs to authenticate, and set the corresponding authentication URL that needs to be accessed according to the usage environment of the sheet;
[0006] Determine whether there is a token file in the client's local temporary file. If so, send the corresponding token information to the verification server.
[0007] If the Token file does not exist or the Token verification fails, the authentication information is obtained through the ApiKey, and authentication is performed based on the authentication information and the account information entered by the user;
[0008] Based on the token file provided by the authentication service provider, update the token file stored in the local temporary directory of the computer.
[0009] In a second aspect of an embodiment of the present invention, a user authentication system based on an Excel application is provided, comprising:
[0010] Get the setting module, which is used to obtain the environment that the user needs to authenticate according to the environment setting information of the sheet, and set the corresponding authentication URL that needs to be accessed according to the usage environment of the sheet;
[0011] The sending verification module is used to determine whether there is a token file in the client's local temporary file. If the token file exists, the corresponding token information is sent to the verification server;
[0012] The authentication processing module is used to obtain authentication information through ApiKey if the Token file does not exist or the Token verification fails, and perform authentication processing based on the authentication information and the account information entered by the user;
[0013] The update module is used to update the token file stored in the local temporary directory of the computer based on the token file fed back by the authentication service provider.
[0014] In a third aspect of an embodiment of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the steps of the method described in the first aspect of the embodiment of the present invention when executing the computer program.
[0015] In a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method provided in the first aspect of the embodiment of the present invention are implemented.
[0016] In this embodiment of the present invention, the authentication URL to be accessed is set according to the usage environment of the form, and user authentication is performed based on a token file. If authentication fails or the token does not exist, authentication is re-updated. This achieves unified authentication management for Excel tools, simplifies the authentication process, adapts to the management needs of different users, prevents illegal access to the server, reduces server burden, facilitates the expansion of authentication scope, enables flexible access to microservices by Excel tools, effectively improves authentication efficiency, and enhances user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 A flowchart of a user authentication method based on Excel application provided by one embodiment of the present invention;
[0019] Figure 2 A schematic diagram of a user authentication network structure provided by one embodiment of the present invention;
[0020] Figure 3 A schematic diagram of the structure of a user authentication system based on Excel application provided by one embodiment of the present invention;
[0021] Figure 4 The present invention provides a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, features, and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0023] It should be understood that the terms "including" and similar expressions in the specification, claims, and drawings of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, or apparatus comprising a series of steps or units is not limited to the listed steps or units. Furthermore, the terms "first" and "second" are used to distinguish between different objects and are not intended to describe a specific order.
[0024] See also Figure 1 , a flowchart of a user authentication method based on Excel application provided by an embodiment of the present invention includes:
[0025] S101. According to the environment setting information of the sheet, obtain the environment that the user needs to authenticate, and set the corresponding authentication URL that needs to be accessed according to the usage environment of the sheet;
[0026] Get the current environment that needs to be authenticated from the authentication configuration sheet environment information, and set the authentication URL (Uniform Resource Locator) of different hosts that need to be accessed according to the current usage environment.
[0027] The environment setting information is stored in a specific sheet, and a password is added to the sheet. Only users with the password can modify the environment setting information.
[0028] The usage environment includes at least a development environment (DEV), a pre-production environment (STG), and a production environment (PROD). The URLs accessed by the usage environments are uniformly defined, and different usage environments and corresponding URLs are accessed through authentication configuration.
[0029] Define the URLs for accessing the development environment, pre-production environment, and production environment in a unified manner. When using, configure the sheet to access different environments.
[0030] S102: Determine whether there is a Token file in the client's local temporary file. If there is a Token file, send the corresponding Token information to the verification server.
[0031] The token file (a string of characters) is generally stored in a local temporary directory on the computer. If a token file exists in the directory, the token file is sent to the verification server for verification.
[0032] For different Excel tools, after the first login, the server generates a token and returns it to the client. In the future, the client only needs to bring the token to request data without the need for a username and password.
[0033] Among them, Figure 2 As shown in the figure, after the user initiates a verification request to the microservice, the microservice server will further initiate a token validity verification to the authentication service provider. After the authentication service provider completes the verification, it returns the verification result, and the microservice server feeds back the verification result to the user.
[0034] When the microservice server receives the request, the header of the request contains token information. It verifies whether the token is correct. If not, it returns an error message indicating that the token is invalid and the request is terminated. If the token verification is successful, it continues to process the remaining business processes.
[0035] In microservices, user authentication information is stored in the database or configuration file, and can be obtained through ApiKey.
[0036] S103. If the Token file does not exist or the Token verification fails, the authentication information is obtained through the ApiKey, and authentication processing is performed based on the authentication information and the account information entered by the user;
[0037] Specifically, obtain the URL that needs to be accessed in the current usage environment, initiate a request to the microservice server through the pre-set Apikey, and obtain the corresponding authentication information.
[0038] The ApiKey is stored in the code and is encrypted, making it inaccessible to ordinary users. This ensures its safe use. The ApiKey is confidential and stored in Excel's VBA code, requiring a password to view.
[0039] When the token file does not exist or token verification fails, the Excel tool needs to be authenticated. The authentication information can be requested from the microservice server through API key.
[0040] According to the authentication information, the authentication screen provided by the authentication service provider is opened. After the user enters the username and password and confirms them, the authentication server will return the valid Token provided by the authentication service provider.
[0041] S104: Based on the Token file fed back by the authentication service provider, update the Token file stored in the local temporary directory of the computer.
[0042] Based on the token file returned by the authentication service provider, update the token file in the local temporary directory of the computer.
[0043] Optionally, after obtaining the authentication information through ApiKey, open the logout interface provided by the authentication service provider according to the authentication information, and clear the Token file in the local temporary directory of the computer based on the instruction information entered on the logout interface.
[0044] For token files that need to be deregistered, deregistration can be performed based on the deregistration screen provided by the authentication service provider.
[0045] Optionally, open the corresponding authentication screen based on the authentication screen URL provided by the authentication service provider; start the background monitoring thread to detect in real time whether the authentication screen has obtained the Token; if the authentication screen has been authenticated, obtain the Token string and terminate the processing, otherwise continue to monitor the authentication screen; determine whether the authentication screen has not obtained the Token within the specified time, and if so, prompt that the authentication timeout has occurred.
[0046] Each authentication service provider provides a unique authentication screen. The content of this screen is not within the scope of the program known to the user. In order to know whether the authentication screen has been successfully authenticated, it is necessary to monitor the URL and return content of the screen at regular intervals to see whether the authentication has been completed.
[0047] This embodiment avoids frequent microservice calls and facilitates Excel authentication service management. It also addresses the authentication screen call issue that occurs when different Excel tools access microservices. By calling the authentication URL based on different usage environments, the development and production environments of Excel tools can be separated, and user sensitive information and access keys can be separated.
[0048] It should be understood that the sequence numbers of the steps in the above embodiments do not imply a specific order of execution; the order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0049] Figure 3 A schematic diagram of the structure of a user authentication system based on Excel application provided in an embodiment of the present invention, the system includes:
[0050] The acquisition setting module 310 is used to obtain the environment that the user needs to authenticate based on the environment setting information of the sheet, and set the corresponding authentication URL that needs to be accessed based on the usage environment of the sheet;
[0051] The usage environment includes at least a development environment, a pre-production environment, and a production environment;
[0052] The URLs accessed by the usage environments are uniformly defined, and different usage environments and corresponding URLs are accessed through authentication configuration.
[0053] The sending verification module 320 is used to determine whether there is a token file in the client's local temporary file. If the token file exists, the corresponding token information is sent to the verification server;
[0054] Authentication processing module 330, which is used to obtain authentication information through ApiKey if the Token file does not exist or the Token verification fails, and perform authentication processing based on the authentication information and the account information entered by the user;
[0055] Specifically, obtain the URL that needs to be accessed in the current usage environment, initiate a request to the microservice server through the pre-set Apikey, and obtain the corresponding authentication information.
[0056] The updating module 340 is configured to update the Token file stored in the local temporary directory of the computer based on the Token file fed back by the authentication service provider.
[0057] Optionally, the updating module 340 further includes:
[0058] The logout module is used to obtain authentication information through ApiKey, open the logout interface provided by the authentication service provider according to the authentication information, and clear the Token file in the local temporary directory of the computer based on the instruction information entered on the logout interface.
[0059] Optionally, the token file based on the authentication service provider's feedback includes
[0060] Open the corresponding authentication screen based on the authentication screen URL provided by the authentication service provider; start the background monitoring thread to detect in real time whether the authentication screen has obtained the token; if the authentication screen has been authenticated, obtain the token string and terminate the process; otherwise, continue monitoring the authentication screen;
[0061] Determine whether the monitoring authentication screen has not obtained the Token within the specified time. If so, it will prompt that the authentication timeout has occurred.
[0062] Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0063] Figure 4 This is a schematic diagram of the structure of an electronic device provided by one embodiment of the present invention. The electronic device is used for Excel user authentication. Figure 4 As shown, the electronic device 4 of this embodiment includes: a memory 410, a processor 420 and a system bus 430, wherein the memory 410 includes an executable program 4101 stored thereon. It can be understood by those skilled in the art that Figure 4 The electronic device structure shown in the figure does not constitute a limitation to the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0064] The following combination Figure 4 A detailed introduction to the various components of electronic equipment:
[0065] The memory 410 can be used to store software programs and modules. The processor 420 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 410. The memory 410 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as cached data), etc. In addition, the memory 410 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0066] The memory 410 includes an executable program 4101 for the network request method. The executable program 4101 can be divided into one or more modules / units. The one or more modules / units are stored in the memory 410 and executed by the processor 420 to implement user authentication, etc. The one or more modules / units can be a series of computer program instruction segments that can perform specific functions. The instruction segments are used to describe the execution process of the computer program 4101 in the electronic device 4. For example, the computer program 4101 can be divided into an acquisition module, a screen capture module, a feature matching module, and a result generation module.
[0067] Processor 420 is the control center of the electronic device, connecting the various components of the entire electronic device using various interfaces and lines. By running or executing software programs and / or modules stored in memory 410 and accessing data stored in memory 410, it performs various functions of the electronic device and processes data, thereby monitoring the overall status of the electronic device. Optionally, processor 420 may include one or more processing units; preferably, processor 420 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, application programs, etc., and the modem processor primarily handles wireless communications. It is understood that the modem processor described above may not be integrated into processor 420.
[0068] The system bus 430 connects the various functional components within the computer and can transmit data, address information, and control information. It can be a PCI bus, an ISA bus, a VESA bus, or other bus types. Instructions from the processor 420 are transmitted to the memory 410 via the bus, and the memory 410 feeds data back to the processor 420. The system bus 430 is responsible for the exchange of data and instructions between the processor 420 and the memory 410. Of course, the system bus 430 can also connect to other devices, such as network interfaces and display devices.
[0069] In an embodiment of the present invention, the executable program executed by the processing 420 included in the electronic device includes:
[0070] Obtain the target code of the new system to be tested, and automatically generate test cases and test scripts based on the keywords and method names in the target code;
[0071] Execute the test script to test the new and old system screen functions respectively, capture the system screen, save the captured pictures to the corresponding target folders, and mark the picture names;
[0072] After pre-processing the pre-matched images in the target folder, extract the image features and match the image feature points;
[0073] Among them, the SURF algorithm is used to extract the feature points of the image, and the matching degree of the feature points is calculated based on the Euclidean distance between the feature points;
[0074] Save the image comparison results to the specified folder and generate a test case report.
[0075] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0076] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A user authentication method based on Excel application, characterized in that: include: According to the environment setting information of the sheet, obtain the environment that the user needs to authenticate, and set the corresponding authentication URL that needs to be accessed according to the usage environment of the sheet; The usage environment includes at least a development environment, a pre-production environment, and a production environment; Among them, the URLs accessed by the usage environment are uniformly defined, and different usage environments and corresponding URLs are accessed through authentication configuration; Determine whether there is a token file in the client's local temporary file. If so, send the corresponding token information to the verification server. If the Token file does not exist or the Token verification fails, the authentication information is obtained through the ApiKey, and authentication is performed based on the authentication information and the account information entered by the user; Based on the token file provided by the authentication service provider, update the token file stored in the local temporary directory of the computer.
2. The method according to claim 1, characterized in that The authentication information obtained through ApiKey includes: Get the URL that needs to be accessed in the current usage environment, initiate a request to the microservice server through the pre-set API key, and obtain the corresponding authentication information.
3. The method according to claim 1, characterized in that The token file based on the token file fed back by the authentication service provider, updating the token file stored in the local temporary directory of the computer also includes: After obtaining the authentication information through ApiKey, open the logout interface provided by the authentication service provider according to the authentication information, and clear the Token file in the local temporary directory of the computer based on the instruction information entered on the logout interface.
4. The method according to claim 1, wherein The token file based on the token file fed back by the authentication service provider, updating the token file stored in the local temporary directory of the computer also includes: Open the corresponding authentication screen based on the authentication screen URL provided by the authentication service provider; Start the background monitoring thread to detect in real time whether the authentication screen has obtained the token; If the authentication screen has been authenticated, then get the Token string and the process ends, otherwise continue to monitor the authentication screen; Determine whether the monitoring authentication screen has not obtained the Token within the specified time. If so, it will prompt that the authentication timeout has occurred.
5. A user authentication system based on Excel application, characterized in that: include: Get the setting module, which is used to obtain the environment that the user needs to authenticate according to the environment setting information of the sheet, and set the corresponding authentication URL that needs to be accessed according to the usage environment of the sheet; The usage environment includes at least a development environment, a pre-production environment, and a production environment; Among them, the URLs accessed by the usage environment are uniformly defined, and different usage environments and corresponding URLs are accessed through authentication configuration; The sending verification module is used to determine whether there is a token file in the client's local temporary file. If the token file exists, the corresponding token information is sent to the verification server; The authentication processing module is used to obtain authentication information through ApiKey if the Token file does not exist or the Token verification fails, and perform authentication processing based on the authentication information and the account information entered by the user; The update module is used to update the token file stored in the local temporary directory of the computer based on the token file fed back by the authentication service provider.
6. The system according to claim 5, characterized in that The update module also includes: The logout module is used to obtain authentication information through ApiKey, open the logout interface provided by the authentication service provider according to the authentication information, and clear the Token file in the local temporary directory of the computer based on the instruction information entered on the logout interface.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the user authentication method based on Excel application according to any one of claims 1 to 4 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed, the steps of the Excel application-based user authentication method according to any one of claims 1 to 4 are implemented.