Method and device for storing digital key at equipment end, electronic equipment and medium

By acquiring key data in response to user requests and comparing and replacing it in account information in the digital key storage method on the device side, the problem of digital key data coverage or mixing is solved, data isolation and independence are achieved, and management efficiency and user experience are improved.

CN119939681APending Publication Date: 2025-05-06SHENZHEN SNOWBALL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510021169.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, the storage method of the digital key on the device side results in data overwriting or mixing, and the digital key cannot be effectively managed.

Method used

By implementing a digital key storage method on the device side, key data is obtained in response to user requests, and compared and replaced in account information, ensuring that the data of each account is isolated and stored in an independent storage area.

Benefits of technology

The isolation and independence of digital key data is achieved, data crossover or loss is avoided, and the management efficiency and user experience of digital keys are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119939681A_ABST
    Figure CN119939681A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for storing a digital key at an equipment end, electronic equipment and a medium, and relates to the field of digital keys.The method comprises the steps that in response to a digital key processing request triggered by a user, key data are obtained; the key data comprises current attribute data and a key identifier of the digital key; when the current account information corresponding to the user contains the key identifier, comparing historical attribute data corresponding to the key identifier of the current account information with the current attribute data; if the historical attribute data is different from the current attribute data, the historical attribute data is replaced with the current attribute data, and isolation and independence of the data can be achieved in the digital key management process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of digital keys, and more specifically, to a method, apparatus, electronic device and medium for storing digital keys on a device. Background Art

[0002] In the prior art, the storage of digital keys usually relies on local storage on the device (such as UserDefaults in iOS). When a user logs in and switches, the key data stored in the old account of the current device may be overwritten by the key data stored in the new account, or the key data of the old and new accounts may be mixed and stored together, making the digital key unmanageable. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method, apparatus, electronic device and medium for storing a digital key on a device side, so as to solve the above-mentioned problems existing in the prior art and realize the isolation and independence of data in the digital key management process.

[0004] In a first aspect, a method for storing a digital key on a device is provided, which is applied to a processor on the device. The method may include:

[0005] In response to a digital key processing request triggered by a user, key data is obtained; the key data includes current attribute data and a key identification of the digital key;

[0006] When the current account information corresponding to the user includes the key identifier, comparing the historical attribute data corresponding to the key identifier of the current account information with the current attribute data;

[0007] If the historical attribute data is different from the current attribute data, the historical attribute data is replaced by the current attribute data.

[0008] In a possible implementation, at least one piece of account information is stored in the device end, and the account information includes an account identifier, multiple key identifiers, and a correspondence between different key identifiers and different attribute data.

[0009] In a possible implementation, the account identifier is generated based on user data of the device.

[0010] In a possible implementation, the storage area of ​​the device is divided into regions according to the number of the account identifiers to obtain storage sub-regions corresponding to the respective account identifiers.

[0011] In a possible implementation, after acquiring the key data, the method further includes:

[0012] When the current account information corresponding to the user does not include the key identifier, the key identifier and the current attribute data corresponding to the key identifier are stored in the storage sub-area corresponding to the current account information.

[0013] In a possible implementation, when the digital key processing request is a key deletion request, and the current account information corresponding to the user includes the key identifier, the method further includes:

[0014] The key identification and the historical attribute data corresponding to the key identification are deleted.

[0015] In a second aspect, a storage device for a digital key on a device side is provided, which is applied to a processor on the device side, and the device may include:

[0016] An acquisition unit, configured to acquire key data in response to a digital key processing request triggered by a user; the key data includes current attribute data of the key and a key identification;

[0017] A comparing unit, configured to compare the historical attribute data corresponding to the key identifier of the current account information with the current attribute data when the current account information corresponding to the user includes the key identifier;

[0018] A processing unit is used to replace the historical attribute data with the current attribute data if the historical attribute data is different from the current attribute data.

[0019] In a third aspect, an electronic device is provided, the electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0020] Memory, used to store computer programs;

[0021] The processor is used to implement any method step described in the first aspect when executing the program stored in the memory.

[0022] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.

[0023] The present application provides a method for storing a digital key on a device, the method comprising: obtaining key data in response to a digital key processing request triggered by a user; the key data comprises the current attribute data and key identification of the digital key; when the current account information corresponding to the user contains the key identification, comparing the historical attribute data corresponding to the key identification of the current account information with the current attribute data; if the historical attribute data is different from the current attribute data, replacing the historical attribute data with the current attribute data. The present application achieves significant technical effects through the following methods:

[0024] Data isolation: The digital key-related data of each account is stored in a separate storage area, avoiding the problem of data crossover or loss when users switch accounts.

[0025] Security and integrity: Users can obtain communication results without manually processing instructions. The entire process is transparent to users, improving the user experience of digital keys.

[0026] Efficiency and simplicity: When users switch accounts, the system can quickly load and switch the digital key-related data of the corresponding account, improving the user experience and reducing unnecessary storage operations.

[0027] Flexibility: This application has good scalability, and more functions can be expanded as needed in the future, such as encrypted storage, data backup and recovery, etc., to provide higher security and flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 A system architecture diagram of a method for storing a digital key on a device provided in an embodiment of the present application;

[0030] Figure 2 A schematic diagram of a flow chart of a method for storing a digital key on a device provided in an embodiment of the present application;

[0031] Figure 3 A schematic diagram of the structure of a storage device of a digital key on a device provided in an embodiment of the present application;

[0032] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] The method for storing a digital key on a device provided in the embodiment of the present application can be applied to Figure 1 In the system architecture shown in Figure 1 As shown, the system may include: a processor and a device. The device may be a user equipment (UE) such as a mobile phone, a smart phone (mainly for Apple mobile phone devices), a laptop computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem, a mobile station (MS), a mobile terminal, etc.

[0035] A device is used for a user to trigger a digital key processing request through a device end of the device, and send the digital key processing request to a processor.

[0036] The processor is used to receive a digital key processing request to execute a digital key storage method on a device provided in the present application.

[0037] In the prior art, the storage of digital keys usually relies on local storage on the device (such as UserDefaults in iOS). When a user logs in and switches, the key data stored in the old account of the current device may be overwritten by the key data stored in the new account, or the key data of the old and new accounts may be mixed and stored together, making the digital key unmanageable.

[0038] For example, when user A logs in, downloads and stores the key, and then switches to user B to log in, the system may delete user A's key and download user B's key, or store the key data of both together, making it impossible to achieve data isolation and independence.

[0039] The lack of secure and efficient storage management may lead to key data loss or accidental deletion, which is especially prone to problems in the case of multiple accounts or frequent account switching.

[0040] When switching between multiple accounts, keys need to be downloaded repeatedly, affecting the user experience.

[0041] Therefore, the present application provides a method for storing digital keys on the device side to solve the above-mentioned problems existing in the prior art. It can realize the isolation and independence of data in the digital key management process, while improving the user's management efficiency of the digital key, thereby improving the user experience.

[0042] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0043] Figure 2 A schematic diagram of a method for storing a digital key on a device provided in an embodiment of the present application. Figure 2 As shown, the method may include:

[0044] Step S210: Responding to a digital key processing request triggered by a user, obtaining key data.

[0045] The key data includes the current attribute data and key identification of the digital key;

[0046] The digital key processing request may be a request to update a digital key, a request to obtain digital key related data, or a request to delete a digital key.

[0047] Among them, the request for obtaining digital key related data may be a key identification request for obtaining one or more digital keys under a certain account information.

[0048] A digital key deletion request may be a request to delete one or more digital keys under a certain account information.

[0049] Step S220: Check whether the key identifier is included in the current account information corresponding to the user, and determine the processing method based on the check result.

[0050] Specifically, before executing step S220, at least one account information is stored in the device, and the account information includes an account identifier, multiple key identifiers, and a correspondence between different key identifiers and different attribute data.

[0051] In order to ensure that data from different accounts do not interfere with each other, a unique storage identifier is first generated for each account. This identifier will be used as a keyword for data storage to distinguish different account information. In other words, there is at least one account information on the device.

[0052] The account ID is generated based on the user data on the device. Specifically, the account ID is generated by combining device information, timestamp, random number and encryption algorithm. This not only ensures the uniqueness and security of the account ID, but also avoids directly exposing the user's sensitive information. The hardware information, operating system information, user-specific information, timestamp and random number can be processed through the encryption algorithm to obtain a fixed-length string as the final account ID.

[0053] The storage area of ​​the device is divided into regions according to the number of account identifiers to obtain storage sub-regions corresponding to each account identifier.

[0054] Use the getUserDefaultsKeyForAllKeyData(with:) method to generate a unique storage identifier for each account’s accountId, thereby ensuring that each account’s key data is stored in a separate storage area.

[0055] Step S220 specifically includes:

[0056] When the checking result is that the current account information corresponding to the user does not contain the key identifier, the key identifier and the current attribute data corresponding to the key identifier are stored in the storage sub-area corresponding to the current account information.

[0057] That is to say, when the device obtains new key data from the server or other means, it will use the saveKeyData(keyData:) method to store the key data in the local storage (UserDefaults). In order to avoid repeated storage of key data of the same cardId, the following saveKeyData(keyData:) method will first check whether the data of the same cardId already exists in the corresponding storage sub-area. If not, the key identifier and the current attribute data corresponding to the key identifier will be stored in the storage sub-area corresponding to the current account information.

[0058] The saveKeyData(keyData:) method checks and updates the stored key data to ensure that the stored data for each account is always up to date.

[0059] If it exists, that is, when the check result shows that the current account information corresponding to the user contains the key identifier, the historical attribute data corresponding to the key identifier of the current account information is compared with the current attribute data;

[0060] If the historical attribute data is different from the current attribute data, the historical attribute data is replaced by the current attribute data.

[0061] The replacement process is as follows: deleting historical attribute data and saving current attribute data.

[0062] Specifically, if the current attribute data and historical attribute data of the user's digital key change (such as expiration, modification, etc.), the updateKeyData(keyData:) method will be called to update the historical attribute data stored locally. The update operation will first delete the historical attribute data through saveKeyData and store the current attribute data in the corresponding storage sub-area.

[0063] In some embodiments, the digital key processing request is a request to obtain key data, which may specifically include: obtaining key data corresponding to a specified cardId: When it is necessary to obtain key data corresponding to a specific cardId, the local storage may be queried through the getKeyData(forCardId:) method. If data matching the cardId is found, the data is returned; otherwise, nil is returned.

[0064] In some embodiments, the digital key processing request is a request to obtain all key data of the current account information, which may specifically include: returning all stored key data under the current account through the getAllDigitalKeys() method, ensuring that the user can only access the data belonging to his own account, avoiding cross-account data access problems.

[0065] In some embodiments, the digital key processing request is a request to remove all key data of the current account information, which may specifically include: if the user chooses to log out or clear all key data, or the device resets the account status, the removeAllDigitalKeys() method can be called to delete all key data under the current account.

[0066] In another example, for each storage sub-area, an access control list is maintained to record which accounts hold the digital key that can unlock the storage sub-area. Maintaining an access control list (ACL) is an important mechanism for implementing secure and fine-grained data access control. For each storage sub-area, the ACL records which accounts hold the digital key that can unlock the area, ensuring that only authorized users can access specific data resources. Specifically, it may include:

[0067] 1. Define the ACL structure:

[0068] Each storage sub-area is associated with one or more ACL entries.

[0069] Each ACL entry consists of at least two parts: the subject, which is the account identifier; and the permission, which indicates the type of operation allowed (such as read, write, delete, etc.).

[0070] 2. Create and distribute digital keys:

[0071] When an account needs to be granted access to a specific storage sub-area, a corresponding digital key is generated and associated with the account.

[0072] Digital keys should be delivered securely to account owners and used only when necessary.

[0073] 3. Update ACL:

[0074] Add the newly created digital key information to the corresponding ACL, indicating which account owns the key and what operations it can perform.

[0075] If permissions need to be modified or revoked, the entries in the ACL are updated or removed accordingly.

[0076] 4. Verification and inspection:

[0077] Each time an access request occurs, the system searches for a matching ACL entry based on the current user's account information.

[0078] The system checks whether the digital key provided by the user is valid and confirms whether the user has the authority to perform the requested operation.

[0079] 5. Regular review and cleanup:

[0080] Review ACLs regularly to ensure they are up-to-date and in compliance with your organization's security policies.

[0081] Clean up unused digital keys or expired ACL entries to prevent potential security vulnerabilities.

[0082] The present application provides a method for storing a digital key on a device, the method comprising: obtaining key data in response to a digital key processing request triggered by a user; the key data comprises the current attribute data and key identification of the digital key; when the current account information corresponding to the user contains the key identification, comparing the historical attribute data corresponding to the key identification of the current account information with the current attribute data; if the historical attribute data is different from the current attribute data, replacing the historical attribute data with the current attribute data. The present application achieves significant technical effects through the following methods:

[0083] Data isolation: The digital key-related data of each account is stored in a separate storage area, avoiding the problem of data crossover or loss when users switch accounts.

[0084] Security and integrity: Users can obtain communication results without manually processing instructions. The entire process is transparent to users, improving the user experience of digital keys.

[0085] This method can effectively use ACL to manage and control the access rights of different accounts to each storage sub-area, thereby improving the overall security of the system. At the same time, good practices and continuous optimization can assist the efficient operation of the system and improve service quality.

[0086] Efficiency and simplicity: When users switch accounts, the system can quickly load and switch the digital key-related data of the corresponding account, improving the user experience and reducing unnecessary storage operations.

[0087] Flexibility: This application has good scalability, and more functions can be expanded as needed in the future, such as encrypted storage, data backup and recovery, etc., to provide higher security and flexibility.

[0088] Corresponding to the above method, the embodiment of the present application also provides a storage device of a digital key on a device side, such as Figure 3 As shown, the device comprises:

[0089] The acquisition unit 310 is used to acquire key data in response to a digital key processing request triggered by a user; the key data includes current attribute data of the key and a key identification;

[0090] A comparison unit 320, configured to compare the historical attribute data corresponding to the key identifier of the current account information with the current attribute data when the current account information corresponding to the user includes the key identifier;

[0091] The processing unit 330 is configured to replace the historical attribute data with the current attribute data if the historical attribute data is different from the current attribute data.

[0092] The functions of each functional unit of a storage device of a digital key on the device side provided in the above-mentioned embodiment of the present application can be realized through the above-mentioned method steps. Therefore, the specific working process and beneficial effects of each unit in a storage device of a digital key on the device side provided in the embodiment of the present application will not be repeated here.

[0093] The present application also provides an electronic device, such as Figure 4 As shown, it includes a processor 410 , a communication interface 420 , a memory 430 and a communication bus 440 , wherein the processor 410 , the communication interface 420 , and the memory 430 communicate with each other via the communication bus 440 .

[0094] Memory 430, for storing computer programs;

[0095] The processor 410 is used to execute the program stored in the memory 430 to implement the following steps:

[0096] In response to a digital key processing request triggered by a user, key data is obtained; the key data includes current attribute data and a key identification of the digital key;

[0097] When the current account information corresponding to the user includes the key identifier, comparing the historical attribute data corresponding to the key identifier of the current account information with the current attribute data;

[0098] If the historical attribute data is different from the current attribute data, the historical attribute data is replaced by the current attribute data.

[0099] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0100] The communication interface is used for communication between the above electronic device and other devices.

[0101] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0102] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0103] The implementation methods and beneficial effects of the components of the electronic device in the above embodiments to solve the problems can be seen in Figure 2The various steps in the illustrated embodiment are implemented, therefore, the specific working process and beneficial effects of the electronic device provided by the embodiment of the present application are not repeated here.

[0104] In another embodiment provided in the present application, a computer-readable storage medium is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes a method for storing a digital key on a device side as described in any of the above embodiments.

[0105] In another embodiment provided in the present application, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer executes a method for storing a digital key on a device as described in any of the above embodiments.

[0106] Those skilled in the art will appreciate that the embodiments in the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt a complete hardware embodiment, a complete software embodiment, or a form of an embodiment combining software and hardware. Moreover, the present application may adopt a form of a computer program product implemented 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.

[0107] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0108] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0110] Unless otherwise defined, the technical terms or scientific terms used in this application should be understood by people with ordinary skills in the field to which the present invention belongs. "First", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect", "couple" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0111] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the present application embodiments are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application embodiments.

[0112] Obviously, those skilled in the art can make various changes and modifications to the embodiments in the present application without departing from the spirit and scope of the embodiments in the present application. Thus, if these modifications and variations of the embodiments in the present application are within the scope of the embodiments in the present application and their equivalents, the embodiments in the present application are also intended to include these modifications and variations.

Claims

1. A method for storing a digital key on a device, characterized in that: The method is applied to a processor on a device side, and includes: In response to a digital key processing request triggered by a user, key data is obtained; the key data includes current attribute data and a key identification of the digital key; When the current account information corresponding to the user includes the key identifier, comparing the historical attribute data corresponding to the key identifier of the current account information with the current attribute data; If the historical attribute data is different from the current attribute data, the historical attribute data is replaced by the current attribute data.

2. The method according to claim 1, characterized in that At least one account information is stored in the device end, and the account information includes an account identifier, multiple key identifiers, and a correspondence between different key identifiers and different attribute data.

3. The method according to claim 2, characterized in that The account identifier is generated based on the user data of the device.

4. The method according to claim 3, characterized in that The storage area of ​​the device is divided into regions according to the number of the account identifiers to obtain storage sub-regions corresponding to the respective account identifiers.

5. The method according to claim 4, characterized in that After acquiring the key data, the method further includes: When the current account information corresponding to the user does not include the key identifier, the key identifier and the current attribute data corresponding to the key identifier are stored in the storage sub-area corresponding to the current account information.

6. The method according to claim 1, characterized in that When the digital key processing request is a key deletion request, and the current account information corresponding to the user includes the key identifier, the method further includes: The key identification and the historical attribute data corresponding to the key identification are deleted.

7. A storage device for a digital key on a device, characterized in that: A processor applied to a device, the device comprising: An acquisition unit, configured to acquire key data in response to a digital key processing request triggered by a user; the key data includes current attribute data of the key and a key identification; A comparing unit, configured to compare the historical attribute data corresponding to the key identifier of the current account information with the current attribute data when the current account information corresponding to the user includes the key identifier; A processing unit is used to replace the historical attribute data with the current attribute data if the historical attribute data is different from the current attribute data.

8. An electronic device, characterized in that: The electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.