User management methods, devices, electronic equipment, and storage media

By initializing the user manager object and parsing user operation data, the embedded device implements offline user management when the network is abnormal, which solves the problem that the device cannot use the user management function normally and ensures the normal operation of the device.

CN119892783BActive Publication Date: 2025-11-14GUANGZHOU ZHIYUAN ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411852801.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-11-14
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

When the network conditions are abnormal, the embedded terminal device cannot use the user management function, which makes it impossible to access or use content or functions that require user permissions, such as files, peripherals, and application functions, thus affecting the normal operation of the device.

Method used

By initializing the user manager object, setting up the user information list, user ID list, data storage object, and communication interface object, it iterates through and calls each communication interface object, parses user operation data, executes user management operations such as registration, login, logout, destruction, and query, and generates operation result data. It supports multiple communication interface types and offline local user management.

Benefits of technology

It enables the embedded device to operate normally even in the event of network anomalies, supports multiple communication interface types and offline local user management functions, and ensures the normal operation of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892783B_ABST
    Figure CN119892783B_ABST
Patent Text Reader

Abstract

This application discloses a user management method, apparatus, electronic device, and storage medium. The user management method includes: initializing a user manager object; upon reading user operation data by calling the first communication interface object among various communication interface objects; parsing the user operation data through the user manager object to obtain an operation code and user data; if the user operation corresponding to the operation code is a user registration operation; extracting a first user identifier from the user data through the user manager object; extracting first user information from the user data through the user manager object and creating a first user information item; adding the first user information item to the user information list and generating first operation result data; and sending the first operation result data to the client by calling the first communication interface object through the user manager object, thereby realizing local user management functions that support multiple communication interface types and offline operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to user management methods, devices, electronic devices, and storage media. Background Technology

[0002] Currently, embedded terminal devices, such as smart home devices, network cameras, printers, network speakers, and wearable devices, often need to use smartphone applications, cloud servers, or other remote servers to implement user management functions, such as user login, user registration, and user modification, in order to ensure device security.

[0003] However, when network conditions are abnormal, embedded terminal devices cannot connect to remote servers and need to communicate through other communication interfaces such as serial ports, Bluetooth, and direct data cable connections. However, because user management functions cannot be used, access to files, peripherals, application functions, and other content or functions that require user permissions cannot be performed, affecting the normal operation of the device. Summary of the Invention

[0004] This invention provides a user management method, apparatus, electronic device, and storage medium to solve the problem that embedded terminal devices cannot use user management functions when network conditions are abnormal, and cannot access or use content or functions that require user permissions, such as files, peripherals, and application functions, thus affecting the normal operation of the device. It realizes a local user management function that supports multiple communication interface types and offline, adapts to application scenarios with abnormal networks, and ensures the normal operation of embedded devices.

[0005] In a first aspect, embodiments of this application provide a user management method, including:

[0006] Initialize a user manager object, which includes a user information list, a user identifier list, a data storage object, and at least one communication interface object.

[0007] The user manager object is used to iterate through and call each communication interface object to determine whether user operation data sent by the client has been read.

[0008] When the user operation data is read by calling the first communication interface object among the various communication interface objects, the operation code and user data are obtained by parsing the user operation data through the user manager object;

[0009] When the user operation corresponding to the operation code is a user registration operation, the first user identifier is extracted from the user data through the user manager object, and the validity of the first user identifier is checked. If the first user identifier is determined to be valid, the first user information is extracted from the user data through the user manager object, the first user information is saved by calling the data storage object, a first user information item is created based on the first user information, the first user information item is added to the user information list, and a first operation result data is generated, which carries a success flag.

[0010] The user manager object calls the first communication interface object to send the first operation result data to the client, so that the client can parse the first operation result data to obtain the first operation result and output the first operation result.

[0011] Optionally, initializing the user manager object includes:

[0012] Create a user manager object and add a pre-created list of user information, a list of user identifiers, a data storage object, and at least one communication interface object to the user manager object;

[0013] Detect whether there is an initial administrator information item in the user information list. If there is no initial administrator information item in the user information list, generate initial administrator information through the user manager object. The initial administrator information includes the initial administrator name, the initial administrator password, and the initial administrator permission data.

[0014] The user manager object calls the data storage object to save the initial administrator information, creates an initial administrator information item based on the initial administrator information, and adds the initial administrator information item to the user information list.

[0015] Optionally, before adding the pre-created user information list, user ID list, data storage object, and at least one communication interface object to the user manager object, the method further includes:

[0016] The embedded device is tested for storage modules to determine the currently set target storage module, and a data storage object corresponding to the target storage module is created.

[0017] The embedded device is tested for its physical communication interface, at least one physical communication interface is determined, the communication function corresponding to each physical communication interface is enabled, and a communication interface object corresponding to each communication function is created.

[0018] Create a list of user information and a list of user identifiers.

[0019] Optionally, after parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes:

[0020] When the user operation corresponding to the operation code is a login operation, the second user information is extracted from the user data through the user manager object, and the second user information is matched with the existing user information items in the user information list. If the second user information successfully matches the target user information item in the existing user information items, a second user identifier is generated, the second user identifier is added to the user identifier list, and a login time is generated based on the current system time. The second user identifier and the login time are added to the target user information item, and second operation result data is generated. The second operation result data carries a success flag and the second user identifier.

[0021] The user manager object calls the first communication interface object to send the second operation result data to the client, so that the client can parse the second operation result data to obtain the second operation result and output the second operation result.

[0022] Optionally, after parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes:

[0023] When the user operation corresponding to the operation code is a logout operation, the third user identifier is extracted from the user data through the user manager object, and the third user identifier is matched with the existing user identifiers in the user identifier list. If the third user identifier successfully matches the target user identifier in the existing user identifiers, the target user identifier is deleted from the user identifier list, and the target user identifier and the corresponding login time are deleted from the user information list to generate third operation result data, which carries a success flag.

[0024] The user manager object calls the first communication interface object to send the third operation result data to the client, so that the client can parse the third operation result data to obtain the third operation result and output the third operation result.

[0025] Optionally, after parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes:

[0026] When the user operation corresponding to the operation code is a user deletion operation, the fourth user identifier is extracted from the user data through the user manager object, and it is checked whether the fourth user identifier is in a valid state. If it is determined that the fourth user identifier is in a valid state, the username to be deleted is extracted from the user data through the user manager object, the corresponding target user data item is deleted from the user information list based on the username to be deleted, and a deletion time is generated based on the current system time. The data storage object is called to associate and store the deletion time with the user information corresponding to the username to be deleted, and a fourth operation result data is generated, which carries a success flag.

[0027] The user manager object calls the first communication interface object to send the fourth operation result data to the client, so that the client can parse the fourth operation result data to obtain the fourth operation result and output the fourth operation result.

[0028] Optionally, after parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes:

[0029] When the user operation corresponding to the operation code is a query user operation, the fifth user identifier is extracted from the user data through the user manager object, and it is checked whether the fifth user identifier is in a valid state. If it is determined that the fifth user identifier is in a valid state, and the username to be queried is extracted from the user data through the user manager object, the data storage object is called to query the target user information corresponding to the username to be queried, and the fifth operation result data is generated based on the target user information. The fifth operation result data carries a success flag.

[0030] The user manager object calls the first communication interface object to send the fifth operation result data to the client, so that the client can parse the fifth operation result data to obtain the fifth operation result and output the fifth operation result.

[0031] Optionally, after parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes:

[0032] When the user operation corresponding to the operation code is a user modification operation, the sixth user identifier is extracted from the user data through the user manager object, and it is checked whether the sixth user identifier is in a valid state. If the sixth user identifier is determined to be in a valid state, the current login password, the target login password, and the target permission data are extracted from the user data. The current login password is compared with the password of the second user information item corresponding to the sixth user identifier in the user information list. If the passwords match, a modification time is generated based on the current system time, and the second user information item is updated based on the target login password, the target permission data, and the modification time. The data storage object is then called to update the corresponding user information, and the sixth operation result data is generated.

[0033] The user manager object calls the first communication interface object to send the sixth operation result data to the client, so that the client can parse the sixth operation result data to obtain the sixth operation result and output the sixth operation result.

[0034] Secondly, embodiments of this application also provide a user management device, including:

[0035] An initialization unit is configured to initialize a user manager object, which includes a user information list, a user identifier list, a data storage object, and at least one communication interface object.

[0036] The data reading unit is configured to iterate through and call each communication interface object using the user manager object to determine whether user operation data sent by the client has been read.

[0037] The data parsing unit is configured to, when the user operation data is read by calling the first communication interface object among the various communication interface objects, parse the user operation data through the user manager object to obtain the operation code and user data;

[0038] The user registration operation processing unit is configured to, when the user operation corresponding to the operation code is a user registration operation, extract a first user identifier from the user data through the user manager object, check whether the first user identifier is in a valid state, and if it is determined that the first user identifier is in a valid state, extract first user information from the user data through the user manager object, call the data storage object to save the first user information, create a first user information item based on the first user information, add the first user information item to the user information list, and generate first operation result data, wherein the first operation result data carries a success flag.

[0039] The operation result sending unit is configured to send the first operation result data to the client by calling the first communication interface object through the user manager object, so that the client can parse the first operation result data to obtain the first operation result and output the first operation result.

[0040] Optional, initialization unit, specifically configured as follows:

[0041] Create a user manager object and add a pre-created list of user information, a list of user identifiers, a data storage object, and at least one communication interface object to the user manager object;

[0042] Check if there is an initial administrator information item in the user information list. If there is no initial administrator information item in the user information list, generate initial administrator information through the user manager object. The initial administrator information includes the initial administrator name, the initial administrator password and the initial administrator permission data.

[0043] The user manager object calls the data storage object to save the initial administrator information, creates an initial administrator information item based on the initial administrator information, and adds the initial administrator information item to the user information list.

[0044] Optionally, the user management device also includes an object creation unit, configured as follows:

[0045] The embedded device is tested for its storage module, the target storage module is determined, and a data storage object corresponding to the target storage module is created.

[0046] The embedded device's physical communication interface is detected to determine at least one currently configured physical communication interface, the communication function corresponding to each physical communication interface is enabled, and a communication interface object corresponding to each communication function is created.

[0047] Create a list of user information and a list of user identifiers.

[0048] Optionally, the user management device also includes a login operation processing unit, configured as follows:

[0049] When the user operation corresponding to the operation code is a login operation, the second user information is extracted from the user data through the user manager object. The second user information is matched with the existing user information items in the user information list. If the second user information successfully matches the target user information item in the existing user information items, a second user identifier is generated and added to the user identifier list. A login time is generated based on the current system time. The second user identifier and login time are added to the target user information item, and the second operation result data is generated. The second operation result data carries a success flag and the second user identifier.

[0050] The user manager object calls the first communication interface object to send the second operation result data to the client, so that the client can parse the second operation result data to obtain the second operation result and output the second operation result.

[0051] Optionally, the user management device also includes a logout operation processing unit, configured as follows:

[0052] When the user operation corresponding to the operation code is to log out, the third user identifier is extracted from the user data through the user manager object. The third user identifier is matched with the existing user identifiers in the user identifier list. If the third user identifier successfully matches the target user identifier in the existing user identifiers, the target user identifier is deleted from the user identifier list and the target user identifier and the corresponding login time are deleted from the user information list. The third operation result data is generated, and the third operation result data carries a success flag.

[0053] The user manager object calls the first communication interface object to send the third operation result data to the client, so that the client can parse the third operation result data to obtain the third operation result and output the third operation result.

[0054] Optionally, the user management device also includes a user operation processing unit, configured as follows:

[0055] When the user operation corresponding to the operation code is to destroy the user, the fourth user identifier is extracted from the user data through the user manager object, and it is checked whether the fourth user identifier is in a valid state. If it is determined that the fourth user identifier is in a valid state, the username to be deregistered is extracted from the user data through the user manager object, the corresponding target user data item is deleted from the user information list based on the username to be deregistered, and a destruction time is generated based on the current system time. The data storage object is called to associate and store the destruction time with the user information corresponding to the username to be deregistered, and the fourth operation result data is generated. The fourth operation result data carries a success flag.

[0056] The user manager object calls the first communication interface object to send the fourth operation result data to the client, so that the client can parse the fourth operation result data to obtain the fourth operation result and output the fourth operation result.

[0057] Optionally, the user management device also includes a user operation processing unit, configured as follows:

[0058] When the user operation corresponding to the operation code is a query user operation, the fifth user identifier is extracted from the user data through the user manager object, and it is checked whether the fifth user identifier is in a valid state. If it is determined that the fifth user identifier is in a valid state, and the username to be queried is extracted from the user data through the user manager object, the data storage object is called to query the target user information corresponding to the username to be queried, and the fifth operation result data is generated based on the target user information. The fifth operation result data carries a success flag.

[0059] The user manager object calls the first communication interface object to send the fifth operation result data to the client, so that the client can parse the fifth operation result data to obtain the fifth operation result and output the fifth operation result.

[0060] Optionally, the user management device also includes a user operation processing unit, configured as follows:

[0061] When the user operation corresponding to the operation code is a user modification operation, the sixth user identifier is extracted from the user data through the user manager object, and it is checked whether the sixth user identifier is in a valid state. If the sixth user identifier is determined to be in a valid state, the current login password, the target login password, and the target permission data are extracted from the user data. The current login password is compared with the password of the second user information item corresponding to the sixth user identifier in the user information list. If the passwords match, the modification time is generated based on the current system time, and the second user information item is updated based on the target login password, the target permission data, and the modification time. The data storage object is called to update the corresponding user information and generate the sixth operation result data.

[0062] The user manager object calls the first communication interface object to send the sixth operation result data to the client, so that the client can parse the sixth operation result data to obtain the sixth operation result and output the sixth operation result.

[0063] Thirdly, embodiments of this application also provide an electronic device, including:

[0064] One or more processors;

[0065] Memory, used to store one or more computer programs;

[0066] When one or more computer programs are executed by one or more processors, an electronic device performs any of the methods described in the first aspect.

[0067] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method as described in any of the first aspects.

[0068] As described above, by initializing a user manager object, which includes a user information list, a user identifier list, a data storage object, and at least one communication interface object, the user manager object iterates through and calls each communication interface object to determine whether user operation data sent by the client has been read. If the user operation data is read by calling the first communication interface object, the user manager object parses the user operation data to obtain the operation code and user data. If the user operation corresponding to the operation code is a user registration operation, the user manager object extracts the first user identifier from the user data and checks whether the first user identifier is valid. If the first user identifier is valid, the user manager object extracts the first user information from the user data, calls the data storage object to save the first user information, creates a first user information item based on the first user information, adds the first user information item to the user information list, and generates first operation result data, which carries a success flag. The user manager object calls the first communication interface object to send the first operation result data to the client, so that the client can parse the first operation result data to obtain the first operation result and output the first operation result. In the above scheme, by initializing the user manager object, user operation data from different communication interfaces can be read, and user operation data can be processed according to the user operation type. The relevant user management processing flow can be executed, and the operation results can be fed back to the client. It can support multiple communication interface types and offline local user management functions, adapt to application scenarios with network anomalies, and ensure the normal operation of embedded devices. Attached Figure Description

[0069] Figure 1 A flowchart illustrating a user management method provided in an embodiment of this application.

[0070] Figure 2 This is a flowchart illustrating a specific implementation process for initializing a user manager object, as provided in an embodiment of this application.

[0071] Figure 3 This is a flowchart illustrating a specific implementation process for creating a data storage object, a communication interface object, a user information list, and a user identifier list, as provided in an embodiment of this application.

[0072] Figure 4 This is a flowchart illustrating a specific implementation process for processing user login operations and returning relevant result data, as provided in an embodiment of this application.

[0073] Figure 5 This is a flowchart illustrating a specific implementation process for processing a logout operation and returning relevant result data, as provided in an embodiment of this application.

[0074] Figure 6 This is a flowchart illustrating a specific implementation process for processing user operations to destroy data and returning relevant result data, as provided in an embodiment of this application.

[0075] Figure 7 This is a flowchart illustrating a specific implementation process for processing user queries and returning relevant result data, as provided in an embodiment of this application.

[0076] Figure 8 This is a flowchart illustrating a specific implementation process for modifying user operations and returning relevant result data, as provided in an embodiment of this application.

[0077] Figure 9 This is a schematic diagram of the structure of a user management device provided in an embodiment of this application.

[0078] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0079] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and not for limiting the invention. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention and not the entire structure.

[0080] It should be noted that, due to space limitations, this application specification does not exhaustively list all possible implementation methods. Those skilled in the art should be able to conceive after reading this application specification that, as long as the technical features do not contradict each other, any combination of technical features can constitute an optional implementation method.

[0081] Figure 1 A flowchart illustrating a user management method provided in this application embodiment, wherein the user management method is applied to an embedded device, such as... Figure 1 As shown, it includes the following steps:

[0082] Step S101: Initialize the user manager object. The user manager object is set up with a user information list, a user ID list, a data storage object, and at least one communication interface object.

[0083] The user manager object can be a software object that implements user management functions. This object can perform the following functions: 1. Call the communication interface object to receive and parse user operation data corresponding to user actions, such as login and registration, and reply with operation result data. 2. Manage user identifiers, assigning a unique user identifier upon user login. This identifier is added to the user identifier list and bound to the user information. 3. Manage user login status, such as login timeout. 4. Call the data storage object to read and write user information. 5. Manage user information, creating user information items based on user information and adding them to the user information list. If user information is modified, the data storage object can be called to update the user information. 6. If a network-connected communication interface exists, user information can be synchronized to a remote server. The user information list can be used to store user information items. Each registered user can have a corresponding user information item. User information items can include persistent and temporary information. The persistent information needs to be stored on the hard drive using the data storage object, while the temporary information is only used in memory and will be lost when the device loses power. The persistent information includes username, password, user permission data, user creation time, user modification time, and user destruction time. The username is the user account used for login and cannot be modified after registration. The password is the login password and can be modified. The user permission data describes all the user's operational permissions. Before performing an operation, the user's permissions must be checked against this data; if the user lacks the necessary permissions, the operation cannot be performed. This user permission data can be modified. Temporary information includes a user identifier and login time. The user identifier is assigned upon successful login, and the login time is a timestamp saved upon successful login to determine if the login has expired. The data storage object is an abstract object that provides a unified interface for reading, writing, and deleting persistent data for reading and persistently storing user data. The communication interface object is also an abstract object that provides a unified interface for sending and receiving binary data for data interaction between the client and embedded devices. It also provides a unified interface for determining network connectivity for accessing remote servers.

[0084] In an optional embodiment, a specific implementation process for initializing a user manager object is described; please refer to [reference needed]. Figure 2 This is a flowchart illustrating a specific implementation process for initializing a user manager object, as provided in an embodiment of this application. Figure 2 As shown, the specific steps for initializing the user manager object are as follows:

[0085] Step S201: Create a user manager object by adding the pre-created user information list, user ID list, data storage object, and at least one communication interface object to the user manager object.

[0086] In one specific implementation, please refer to Figure 3 This is a flowchart illustrating a specific implementation process for creating a data storage object, a communication interface object, a user information list, and a user identifier list, provided in an embodiment of this application. Before adding the pre-created user information list, user identifier list, data storage object, and at least one communication interface object to the user manager object, as follows... Figure 3 As shown, it also includes the following steps:

[0087] Step S301: Detect the storage module of the embedded device, determine the target storage module currently set, and create the data storage object corresponding to the target storage module.

[0088] Since embedded devices may use different storage modules, such as file modules, FLASH modules, EEPROM modules, etc., it is necessary to detect the currently set target storage module and create a data storage object corresponding to the target storage module to facilitate operation of the corresponding storage module.

[0089] Step S302: Detect the physical communication interface of the embedded device, determine at least one physical communication interface currently set, enable the communication function corresponding to each physical communication interface, and create a communication interface object corresponding to each communication function.

[0090] It should be noted that detecting the physical communication interface of an embedded device can determine the communication interface it possesses. In one specific implementation, if a serial port is detected, the process for enabling the corresponding serial port communication function can be as follows: Open the serial port and set parameters such as the baud rate to enable normal serial communication. Then, create a communication interface object corresponding to the serial port communication function, allowing normal data transmission and reception using the serial port's read and write functions. In another specific implementation, if a network port is detected, the process for enabling the corresponding network port communication function can be as follows: Create a TCP socket object, configure it as a TCP server, and listen on a specified port number. Whenever the TCP server detects an incoming TCP client connection, a corresponding socket object can be generated to enable network port communication. Then, create a communication interface object corresponding to the network port communication function, allowing normal data transmission and reception using the network port's read and write functions. In one specific implementation, if an embedded device is detected to have a Bluetooth module, the specific process for enabling the corresponding Bluetooth communication function can be as follows: Enable the Bluetooth module's broadcast function and set the Bluetooth connection pairing mode to Just Works, i.e., no input and no output I / O capability. Then, wait for the target device to initiate scanning and connection. After successfully establishing a connection, the Bluetooth communication function is enabled normally. Then, create the communication interface object corresponding to the Bluetooth communication function, and the Bluetooth read and write functions can be used normally for data transmission and reception.

[0091] Step S303: Create a user information list and a user identifier list.

[0092] As described above, by creating a data storage object, a communication interface object, a user information list, and a user identifier list, the user manager object can be provided with operation objects to perform user management functions, ensuring that the embedded device can perform user management functions normally.

[0093] Step S202: Check if there is an initial administrator information item in the user information list. If there is no initial administrator information item in the user information list, generate initial administrator information through the user manager object. The initial administrator information includes the initial administrator name, initial administrator password and initial administrator permission data.

[0094] Since the user manager object may not have an initial administrator account before it leaves the factory, after adding the user information list, it is necessary to check whether the initial administrator information item exists in the user information list. If the initial administrator information item does not exist, the initial administrator information needs to be generated to provide users with an administrator account with user management permissions such as registering users, destroying users, and modifying users.

[0095] Step S203: Save the initial administrator information by calling the data storage object through the user manager object, create an initial administrator information item based on the initial administrator information, and add the initial administrator information item to the user information list.

[0096] The initial administrator information can be read from the embedded device by the supplier when the device leaves the factory and recorded in a document or physical tag. After the target user obtains the initial administrator information through the document or physical tag, he / she can perform user operations such as creating ordinary administrator accounts, registering ordinary accounts, and destroying accounts based on the initial administrator information.

[0097] As described above, by creating a user manager object and adding a user information list, a user ID list, a data storage object, and at least one communication interface object, the user management function can be constructed. By generating initial administrator information, users can easily log in to the initial administrator account based on this initial administrator information and perform related user management operations.

[0098] Step S102: Iterate through each communication interface object using the user manager object to determine whether user operation data sent by the client has been read.

[0099] It should be noted that after initializing the user manager object, you can iterate through and call various communication interface objects using the user manager object. The iteration order can be achieved by pre-setting the iteration priority of different communication interface objects. By calling the communication interface objects, you can determine whether the physical communication interface has received user operation data sent by the client. The physical communication interface corresponding to this communication interface object can be based on serial port, Bluetooth, Ethernet port, WIFI, etc. Due to weak or no network conditions, the client may use a non-networked physical communication interface to transmit user operation data. Therefore, it is necessary to confirm whether user operation data has been received by calling each communication interface object individually.

[0100] Step S103: If the user operation data is read from the first communication interface object in each communication interface object, the user operation data is parsed through the user manager object to obtain the operation code and user data.

[0101] During the iteration, if the first communication interface object among the various communication interface objects is called to read user operation data during the process, the read user operation data can be processed, and the data processing result can be returned along the same path. It should be noted that the user operation data and operation result data interacting between the client and the embedded device can use a unified data format. For example, this data format can include a frame header, operation code, data length, user data, and checksum. The frame header can be a fixed value used to indicate the beginning of the data; the operation code is used to represent the specific user management operation, such as registering a user, deleting a user, modifying a user, logging in, logging out, querying user information, etc.; the data length is used to identify the length of the user data; the user data can be related information corresponding to different user management operations. For example, for a user registration operation, the user data needs to include the user identifier, user name, user password, and user permission level. According to the data, user permission data needs to include the registered user's operation permissions; if it is a user deletion operation, the user data needs to include the user identifier, current login password, and username to be deleted, and the user permission data needs to include the user deletion operation permission; if it is a user modification operation, the user data needs to include the user identifier, current login password, target login password, and target permission data; if it is a user login operation, the user data needs to include the user identifier and user password; if it is a user logout operation, the user data needs to include the user identifier; if it is a user query operation, the user data needs to include the user identifier; this verification bit is used to verify the "operation code" to "user data" fields to verify that there are no data transmission errors. Therefore, the operation code and user data can be obtained by parsing the user operation data based on the aforementioned data format. Of course, developers can also customize other data formats according to the needs of actual application scenarios, which are not limited in this application.

[0102] Step S104: When the user operation corresponding to the operation code is a registered user operation, the first user identifier is extracted from the user data through the user manager object, and the validity of the first user identifier is checked. If the first user identifier is determined to be valid, the first user information is extracted from the user data through the user manager object, the first user information is saved by calling the data storage object, the first user information item is created based on the first user information, the first user information item is added to the user information list, and the first operation result data is generated. The first operation result data carries a success flag.

[0103] It should be noted that user registration requires the user to log in using an administrator account and possess the corresponding operation permissions. Therefore, it is necessary to first extract the first user identifier from the user data and check whether the first user identifier is valid, i.e., confirm whether the user is logged in and the login time has not expired, and whether they have the operation permissions of a registered user. If the first user identifier is valid, it can be considered that the user has logged in normally and has the operation permissions of a registered user. Therefore, the first user information can be extracted from the user data. This first user information can include relevant information of the registered user, such as username, password, and user permission data. The first user information can be saved by calling the data storage object through the user manager object, and the corresponding first user information item can be added to the user information list. Thus, if the first user identifier is verified to be valid and the user is successfully created, the first operation result data can carry a success flag. Optionally, if the first user identifier is not valid, the user cannot be created, and the corresponding first operation result data can carry a failure flag and a description of the failure reason, such as invalid first user identifier or lack of registration user permissions for the first user identifier.

[0104] In one optional embodiment, a specific implementation process for processing user login operations and returning relevant result data is described. Please refer to [link / reference]. Figure 4 This is a flowchart illustrating a specific implementation process for processing user login operations and returning relevant result data, provided in an embodiment of this application. After parsing the user operation data through the user manager object to obtain the operation code and user data, as follows... Figure 4 As shown, it includes the following steps:

[0105] Step S401: When the user operation corresponding to the operation code is a login operation, extract the second user information from the user data through the user manager object, match the second user information with the existing user information items in the user information list, and if the second user information successfully matches the target user information item in the existing user information items, generate a second user identifier, add the second user identifier to the user identifier list, generate a login time based on the current system time, add the second user identifier and login time to the target user information item, and generate second operation result data. The second operation result data carries a success flag and the second user identifier.

[0106] It should be noted that the user login operation needs to confirm whether the user's relevant information has already been stored. Therefore, it is necessary to extract second user information from the user data. This second user information may include the username and password. The second user information is then compared with existing user information items in the user information list. If a match is found, a second user identifier can be assigned. This second user identifier can be used to identify the user after login, such as a regular user or administrator. The second user identifier and login time are then added to the target user information item for subsequent identity matching. Thus, if the second user information match is successful, the response data for the second operation can carry a success flag and the second user identifier, allowing the client to perform other user management operations after successful login based on this identifier. Optionally, if the second user information cannot be matched, login cannot be completed. The corresponding second operation result data can carry a failure flag and a description of the failure reason, such as "user not registered" or "incorrect password."

[0107] Step S402: The user manager object calls the first communication interface object to send the second operation result data to the client, so that the client can parse the second operation result data to obtain the second operation result and output the second operation result.

[0108] As described above, by calling the first communication interface object through the user manager object to return the second operation result data to the client, the client can parse the second operation result data to confirm whether its user login operation was successful and display the second operation result to the user.

[0109] In one optional embodiment, a specific implementation process for processing the logout operation and returning relevant result data is described. Please refer to [link / reference]. Figure 5 This is a flowchart illustrating a specific implementation process for processing a login exit operation and returning relevant result data, provided in an embodiment of this application. After parsing the user operation data through the user manager object to obtain the operation code and user data, as follows... Figure 5 As shown, it includes the following steps:

[0110] Step S501: If the user operation corresponding to the operation code is a logout operation, extract the third user identifier from the user data through the user manager object, match the third user identifier with the existing user identifiers in the user identifier list, and if the third user identifier successfully matches the target user identifier in the existing user identifiers, delete the target user identifier from the user identifier list and delete the target user identifier and the corresponding login time from the user information list, and generate the third operation result data, which carries a success flag.

[0111] It should be noted that since a user identifier is assigned when processing a user login operation, the logout operation requires checking if the user identifier exists in the user identifier list to determine if the user is already logged in. Therefore, the user manager object extracts a third user identifier from the user data and matches it against existing user identifiers in the user identifier list. If a match is found, the user is considered logged in and can be removed from the user identifier list. The corresponding target user identifier and login time are also deleted from the user information list, thus clearing the user's login record. Therefore, when the third user identifier matches successfully and the third user identifier and corresponding login time are successfully cleared, the returned third operation result data can carry a success flag. Optionally, if the third user identifier cannot be matched, the corresponding second operation result data can carry a failure flag and a failure reason description, such as "third user identifier is invalid."

[0112] Step S502: The user manager object calls the first communication interface object to send the third operation result data to the client, so that the client can parse the third operation result data to obtain the third operation result and output the third operation result.

[0113] As described above, by calling the first communication interface object through the user manager object to return the third operation result data to the client, the client can parse the third operation result data to confirm whether its logout operation was successful and display the third operation result to the user.

[0114] In one optional embodiment, a specific implementation process for processing a user's destruction operation and returning relevant result data is described. Please refer to [link / reference]. Figure 6 This is a flowchart illustrating a specific implementation process for processing and returning relevant result data in an embodiment of this application. After parsing the user operation data through the user manager object to obtain the operation code and user data, as shown... Figure 6 As shown, it includes the following steps:

[0115] Step S601: When the user operation corresponding to the operation code is a user destruction operation, the fourth user identifier is extracted from the user data through the user manager object, and it is checked whether the fourth user identifier is in a valid state. If it is determined that the fourth user identifier is in a valid state, the username to be deregistered is extracted from the user data through the user manager object, the corresponding target user data item is deleted from the user information list based on the username to be deregistered, and a destruction time is generated based on the current system time. The data storage object is called to associate and store the destruction time with the user information corresponding to the username to be deregistered, and the fourth operation result data is generated. The fourth operation result data carries a success flag.

[0116] It should be noted that deleting a user requires the user to log in with an administrator account and possess the corresponding operation permissions. Therefore, it is necessary to first extract the fourth user identifier from the user data and check whether this fourth user identifier is valid, i.e., confirm whether the user is logged in and the login time has not expired, and whether they have the operation permission to delete the user. If the fourth user identifier is valid, it can be considered that the user has logged in normally and has the operation permission to delete the user. Therefore, the username to be deleted can be extracted from the user data. Optionally, to ensure information security, the current login password can also be extracted from the user data. The user manager object calls the data storage object to query the corresponding user password based on the fourth user identifier, and compares whether the two are consistent. If they are consistent, the user deletion operation can continue. Furthermore, after retrieving the username to be deregistered, the target user data item corresponding to that username in the user information list can be deleted. A destruction time is generated based on the current system time, and the data storage object is called to associate and store this destruction time with the user information corresponding to the username to be deregistered. It's worth noting that the user destruction operation only deletes data from the user information list, but still stores complete user information for later network recovery and synchronization with the remote server. This allows the remote server to confirm that it does not need to synchronize user information with destruction times. Therefore, if the fourth user identifier is verified as valid, the first operation result data after deleting the target user data item can carry a success flag. Optionally, if the fourth user identifier is not verified as valid, the user cannot be destroyed, and the corresponding first operation result data can carry a failure flag and a description of the failure reason, such as invalid fourth user identifier or the username to be deregistered does not exist.

[0117] Step S602: The user manager object calls the first communication interface object to send the fourth operation result data to the client, so that the client can parse the fourth operation result data to obtain the fourth operation result and output the fourth operation result.

[0118] As described above, by calling the first communication interface object through the user manager object to return the fourth operation result data to the client, the client can parse the fourth operation result data to confirm whether the user destruction operation was successful and display the fourth operation result to the user.

[0119] In one optional embodiment, a specific implementation process for processing user query operations and returning relevant result data is described. Please refer to [link / reference]. Figure 7 This is a flowchart illustrating a specific implementation process for processing user operations and returning relevant result data, provided in an embodiment of this application. After parsing the user operation data through the user manager object to obtain the operation code and user data, as follows... Figure 7 As shown, it includes the following steps:

[0120] Step S701: When the user operation corresponding to the operation code is a query user operation, the fifth user identifier is extracted from the user data through the user manager object, and it is checked whether the fifth user identifier is in a valid state. If it is determined that the fifth user identifier is in a valid state, and the username to be queried is extracted from the user data through the user manager object, the data storage object is called to query the target user information corresponding to the username to be queried, and the fifth operation result data is generated based on the target user information. The fifth operation result data carries a success flag.

[0121] It should be noted that querying users requires the user to log in with an administrator account and possess the corresponding operation permissions. Therefore, it is necessary to first extract the fifth user identifier from the user data and check whether the fifth user identifier is valid, that is, to confirm whether the user is logged in and the login time has not expired, and whether they have the operation permission to query users. If the fifth user identifier is valid, it can be considered that the user has logged in normally and has the operation permission to query users. Therefore, the username to be queried can be extracted from the user data. If the username to be queried can be extracted from the user data through the user manager object, the data storage object can be called to query the target user information corresponding to the username to be queried, and the fifth operation result data can be generated based on the target user information. Optionally, to ensure information security, it can be determined whether the username to be queried is the user name associated with the fifth user identifier. If so, the corresponding fifth operation result data is generated and fed back to the client. If not, it is checked whether the fifth user identifier has the permission to query other people's information. If so, the corresponding fifth operation result data is generated and fed back to the client. Optionally, if the username to be queried cannot be extracted from the user data through the user manager object, it can be further checked whether the fifth user identifier has the permission to query all users. If so, all user information is queried by calling the data storage object, and the corresponding fifth operation result data is generated and fed back to the client. Therefore, if the fifth user identifier is verified to be valid, after retrieving the relevant user information, the returned fifth operation result data can include the relevant user information and a success flag. Optionally, if the fifth user identifier is verified to be invalid, the user cannot be queried, and the corresponding fifth operation result data can carry a failure flag and a description of the failure reason, such as "fifth user identifier is invalid."

[0122] Step S702: The user manager object calls the first communication interface object to send the fifth operation result data to the client, so that the client can parse the fifth operation result data to obtain the fifth operation result and output the fifth operation result.

[0123] As described above, by calling the first communication interface object through the user manager object to return the fifth operation result data to the client, the client can parse the fifth operation result data to confirm whether its query user operation was successful and display the fifth operation result to the user, including the user information that was expected to be queried.

[0124] In one optional embodiment, a specific implementation process for processing modified user actions and returning relevant result data is described. Please refer to [link / reference]. Figure 8 This is a flowchart illustrating a specific implementation process for processing modified user operations and returning relevant result data, provided in an embodiment of this application. After parsing the user operation data through the user manager object to obtain the operation code and user data, as follows... Figure 8 As shown, it includes the following steps:

[0125] Step S801: When the user operation corresponding to the operation code is a user modification operation, extract the sixth user identifier from the user data through the user manager object, and check whether the sixth user identifier is in a valid state. If the sixth user identifier is in a valid state, extract the current login password, the target login password, and the target permission data from the user data. Compare the current login password with the password of the second user information item corresponding to the sixth user identifier in the user information list. If the passwords match, generate the modification time based on the current system time, update the second user information item based on the target login password, the target permission data, and the modification time, and call the data storage object to update the corresponding user information, generating the sixth operation result data.

[0126] It should be noted that modifying user information requires the user to log in with an administrator account and possess the corresponding permissions. Therefore, it is necessary to first extract the sixth user identifier from the user data and check whether this sixth user identifier is valid, i.e., confirm whether the user is logged in and the login time has not expired, and whether they have the permission to modify the user information. If the sixth user identifier is valid, the user can be considered to have logged in normally and has the permission to modify the user information. Therefore, the current login password, target login password, and target permission data can be extracted from the user data, and it can be determined whether the current login password matches the password in the original second user information field. If the passwords match, the password verification can be considered successful. Then, based on the modification time, target login password, and target permission data, the second user information field in the user information list and the stored user information can be updated respectively to achieve the purpose of modifying the user information. Thus, if the sixth user identifier is verified to be valid, the sixth operation result data after modifying the relevant user information can carry a success flag. Optionally, if the sixth user identifier is not verified to be valid, the user cannot be modified, and the corresponding sixth operation result data can carry a failure flag and a description of the failure reason, such as "sixth user identifier is invalid."

[0127] Step S802: The user manager object calls the first communication interface object to send the sixth operation result data to the client, so that the client can parse the sixth operation result data to obtain the sixth operation result and output the sixth operation result.

[0128] As described above, by calling the first communication interface object through the user manager object to return the sixth operation result data to the client, the client can parse the sixth operation result data to confirm whether its query user operation was successful and display the sixth operation result to the user, including the user information that was expected to be queried.

[0129] Step S105: The first operation result data is sent to the client by calling the first communication interface object through the user manager object, so that the client can parse the first operation result data to obtain the first operation result and output the first operation result.

[0130] Specifically, by calling the first communication interface object through the user manager object to return the first operation result data to the client, the client can parse the first operation result data to confirm whether its user registration operation was successful and display the first operation result to the user.

[0131] As described above, by initializing a user manager object, which includes a user information list, a user identifier list, a data storage object, and at least one communication interface object, the user manager object iterates through and calls each communication interface object to determine whether user operation data sent by the client has been read. If the user operation data is read by calling the first communication interface object, the user manager object parses the user operation data to obtain the operation code and user data. If the user operation corresponding to the operation code is a user registration operation, the user manager object extracts the first user identifier from the user data and checks whether the first user identifier is valid. If the first user identifier is valid, the user manager object extracts the first user information from the user data, calls the data storage object to save the first user information, creates a first user information item based on the first user information, adds the first user information item to the user information list, and generates first operation result data, which carries a success flag. The user manager object calls the first communication interface object to send the first operation result data to the client, so that the client can parse the first operation result data to obtain the first operation result and output the first operation result. In the above scheme, by initializing the user manager object, user operation data from different communication interfaces can be read, and user operation data can be processed according to the user operation type. The relevant user management processing flow can be executed, and the operation results can be fed back to the client. It can support multiple communication interface types and offline local user management functions, adapt to application scenarios with network anomalies, and ensure the normal operation of embedded devices.

[0132] Additionally, it's worth noting that the client can interact with the user by providing input / output interfaces, packaging user operation data, and sending it to the embedded device via a communication interface. The client sends user operation data to the embedded device using the communication interface and then receives operation result data using the same interface. When a user wants to log in, the client can provide input boxes for the user to enter their username and password. The client generates user operation data according to a preset data format, sends this data to the embedded device for processing via the communication interface, and then receives the operation result data to determine whether the operation was successful or not. If successful, a user identifier is obtained, and the operation result and user identifier are displayed to the user. Of course, other users can perform similar operations, which will not be elaborated upon here. For the first use, the user logs in using the initial administrator account. After successful login, the initial administrator password must be changed. Then, a new user account is registered, requiring a username, password, and permission data. When the new user account logs in successfully, the result data will include a user identifier, which the client records for subsequent application operations on the embedded device, such as enabling application functions and performing data read / write operations.

[0133] Figure 9 This is a schematic diagram of the structure of a user management device provided in an embodiment of this application. Figure 9 As shown, the user management device includes an initialization unit 110, a data reading unit 120, a data parsing unit 130, a registered user operation processing unit 140, and an operation result sending unit 150.

[0134] The initialization unit 110 is configured to initialize a user manager object, which includes a user information list, a user identifier list, a data storage object, and at least one communication interface object.

[0135] The data reading unit 120 is configured to traverse and call each communication interface object through the user manager object to determine whether user operation data sent by the client has been read.

[0136] The data parsing unit 130 is configured to, when the user operation data is read from the first communication interface object among the various communication interface objects, parse the user operation data through the user manager object to obtain the operation code and user data;

[0137] The user registration operation processing unit 140 is configured to, when the user operation corresponding to the operation code is a user registration operation, extract the first user identifier from the user data through the user manager object, check whether the first user identifier is in a valid state, and if it is determined that the first user identifier is in a valid state, extract the first user information from the user data through the user manager object, call the data storage object to save the first user information, create a first user information item based on the first user information, add the first user information item to the user information list, and generate first operation result data, which carries a success flag.

[0138] The operation result sending unit 150 is configured to send the first operation result data to the client by calling the first communication interface object through the user manager object, so that the client can parse the first operation result data to obtain the first operation result and output the first operation result.

[0139] In the above scheme, by initializing the user manager object, user operation data from different communication interfaces can be read, and user operation data can be processed according to the user operation type. The relevant user management processing flow can be executed, and the operation results can be fed back to the client. It can support multiple communication interface types and offline local user management functions, adapt to application scenarios with network anomalies, and ensure the normal operation of embedded devices.

[0140] Based on the above embodiments, the initialization unit 110 is specifically configured as follows:

[0141] Create a user manager object and add a pre-created list of user information, a list of user identifiers, a data storage object, and at least one communication interface object to the user manager object;

[0142] Check if there is an initial administrator information item in the user information list. If there is no initial administrator information item in the user information list, generate the initial administrator information through the user manager object. The initial administrator information includes the initial administrator name, initial administrator password and initial administrator permission data.

[0143] The user manager object calls the data storage object to save the initial administrator information, creates an initial administrator information item based on the initial administrator information, and adds the initial administrator information item to the user information list.

[0144] Based on the above embodiments, an object creation unit is also included, configured as follows:

[0145] The embedded device is tested for its storage module, the target storage module is determined, and a data storage object corresponding to the target storage module is created.

[0146] The embedded device's physical communication interface is detected to determine at least one currently configured physical communication interface, the communication function corresponding to each physical communication interface is enabled, and a communication interface object corresponding to each communication function is created.

[0147] Create a list of user information and a list of user identifiers.

[0148] Based on the above embodiments, a login operation processing unit is also included, configured as follows:

[0149] When the user operation corresponding to the operation code is a login operation, the second user information is extracted from the user data through the user manager object. The second user information is matched with the existing user information items in the user information list. If the second user information successfully matches the target user information item in the existing user information items, a second user identifier is generated and added to the user identifier list. A login time is generated based on the current system time. The second user identifier and login time are added to the target user information item, and the second operation result data is generated. The second operation result data carries a success flag and the second user identifier.

[0150] The user manager object calls the first communication interface object to send the second operation result data to the client, so that the client can parse the second operation result data to obtain the second operation result and output the second operation result.

[0151] Based on the above embodiments, a login exit operation processing unit is also included, configured as follows:

[0152] When the user operation corresponding to the operation code is to log out, the third user identifier is extracted from the user data through the user manager object. The third user identifier is matched with the existing user identifiers in the user identifier list. If the third user identifier successfully matches the target user identifier in the existing user identifiers, the target user identifier is deleted from the user identifier list and the target user identifier and the corresponding login time are deleted from the user information list. The third operation result data is generated, and the third operation result data carries a success flag.

[0153] The user manager object calls the first communication interface object to send the third operation result data to the client, so that the client can parse the third operation result data to obtain the third operation result and output the third operation result.

[0154] Based on the above embodiments, a user operation processing unit for destruction is also included, configured as follows:

[0155] When the user operation corresponding to the operation code is to destroy the user, the fourth user identifier is extracted from the user data through the user manager object, and it is checked whether the fourth user identifier is in a valid state. If it is determined that the fourth user identifier is in a valid state, the username to be deregistered is extracted from the user data through the user manager object, the corresponding target user data item is deleted from the user information list based on the username to be deregistered, and a destruction time is generated based on the current system time. The data storage object is called to associate and store the destruction time with the user information corresponding to the username to be deregistered, and the fourth operation result data is generated. The fourth operation result data carries a success flag.

[0156] The user manager object calls the first communication interface object to send the fourth operation result data to the client, so that the client can parse the fourth operation result data to obtain the fourth operation result and output the fourth operation result.

[0157] Based on the above embodiments, a user operation processing unit is also included, configured as follows:

[0158] When the user operation corresponding to the operation code is a query user operation, the fifth user identifier is extracted from the user data through the user manager object, and it is checked whether the fifth user identifier is in a valid state. If it is determined that the fifth user identifier is in a valid state, and the username to be queried is extracted from the user data through the user manager object, the data storage object is called to query the target user information corresponding to the username to be queried, and the fifth operation result data is generated based on the target user information. The fifth operation result data carries a success flag.

[0159] The user manager object calls the first communication interface object to send the fifth operation result data to the client, so that the client can parse the fifth operation result data to obtain the fifth operation result and output the fifth operation result.

[0160] Based on the above embodiments, the user operation processing unit is further modified and configured as follows:

[0161] When the user operation corresponding to the operation code is a user modification operation, the sixth user identifier is extracted from the user data through the user manager object, and it is checked whether the sixth user identifier is in a valid state. If the sixth user identifier is determined to be in a valid state, the current login password, the target login password, and the target permission data are extracted from the user data. The current login password is compared with the password of the second user information item corresponding to the sixth user identifier in the user information list. If the passwords match, the modification time is generated based on the current system time, and the second user information item is updated based on the target login password, the target permission data, and the modification time. The data storage object is called to update the corresponding user information and generate the sixth operation result data.

[0162] The user manager object calls the first communication interface object to send the sixth operation result data to the client, so that the client can parse the sixth operation result data to obtain the sixth operation result and output the sixth operation result.

[0163] The user management device provided in this application embodiment is included in an electronic device and can be used to execute the corresponding user management method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0164] It is worth noting that in the above-described embodiments of the user management device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0165] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 10 As shown, the electronic device includes a processor 210 and a memory 220, and may also include an input device 230, an output device 240, and a communication device 250; the number of processors 210 in the electronic device can be one or more. Figure 10 Taking a processor 210 as an example; the processor 210, memory 220, input device 230, output device 240, and communication device 250 in the electronic device can be connected via a bus or other means. Figure 10 Taking the example of a connection between China and Israel via a bus.

[0166] The memory 220, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the user management method in this embodiment. The processor 210 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 220, thereby implementing the aforementioned user management method.

[0167] The memory 220 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 220 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 220 may further include memory remotely located relative to the processor 210, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0168] Input device 230 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the electronic device. Output device 240 may include electronic devices such as a display screen.

[0169] The aforementioned electronic device includes a user management unit, which can be used to execute any user management method and has corresponding functions and beneficial effects.

[0170] This application also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program performs related operations in the methods provided in any embodiment of this application and has corresponding functions and beneficial effects.

[0171] Those skilled in the art will understand that embodiments of this application may be provided as methods, systems, or computer program products.

[0172] Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the 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. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of 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, produce implementations of the flowchart... Figure 1 One or more processes and / or boxes Figure 1The 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 operate 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 functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus 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.

[0173] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0174] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, optical disc-only memory (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0175] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A user management method, applied to embedded devices, characterized in that, include: Initialize a user manager object, which includes a user information list, a user identifier list, a data storage object, and at least one communication interface object. The user manager object is used to iterate through and call each communication interface object to determine whether user operation data sent by the client has been read. When the user operation data is read by calling the first communication interface object among the various communication interface objects, the operation code and user data are obtained by parsing the user operation data through the user manager object; When the user operation corresponding to the operation code is a user registration operation, the first user identifier is extracted from the user data through the user manager object, and the validity of the first user identifier is checked. If the first user identifier is determined to be valid, the first user information is extracted from the user data through the user manager object, the first user information is saved by calling the data storage object, a first user information item is created based on the first user information, the first user information item is added to the user information list, and a first operation result data is generated, which carries a success flag. The user manager object calls the first communication interface object to send the first operation result data to the client, so that the client can parse the first operation result data to obtain the first operation result and output the first operation result.

2. The user management method according to claim 1, characterized in that, The initialization of the user manager object includes: Create a user manager object and add a pre-created list of user information, a list of user identifiers, a data storage object, and at least one communication interface object to the user manager object; Detect whether there is an initial administrator information item in the user information list. If there is no initial administrator information item in the user information list, generate initial administrator information through the user manager object. The initial administrator information includes the initial administrator name, the initial administrator password, and the initial administrator permission data. The user manager object calls the data storage object to save the initial administrator information, creates an initial administrator information item based on the initial administrator information, and adds the initial administrator information item to the user information list.

3. The user management method according to claim 2, characterized in that, Before adding the pre-created user information list, user ID list, data storage object, and at least one communication interface object to the user manager object, the method further includes: The embedded device is tested for storage modules to determine the currently set target storage module, and a data storage object corresponding to the target storage module is created. The embedded device is tested for its physical communication interface, at least one physical communication interface is determined, the communication function corresponding to each physical communication interface is enabled, and a communication interface object corresponding to each communication function is created. Create a list of user information and a list of user identifiers.

4. The user management method according to claim 1, characterized in that, After parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes: When the user operation corresponding to the operation code is a login operation, the second user information is extracted from the user data through the user manager object, and the second user information is matched with the existing user information items in the user information list. If the second user information successfully matches the target user information item in the existing user information items, a second user identifier is generated, the second user identifier is added to the user identifier list, and a login time is generated based on the current system time. The second user identifier and the login time are added to the target user information item, and second operation result data is generated. The second operation result data carries a success flag and the second user identifier. The user manager object calls the first communication interface object to send the second operation result data to the client, so that the client can parse the second operation result data to obtain the second operation result and output the second operation result.

5. The user management method according to claim 1, characterized in that, After parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes: When the user operation corresponding to the operation code is a logout operation, the third user identifier is extracted from the user data through the user manager object, and the third user identifier is matched with the existing user identifiers in the user identifier list. If the third user identifier successfully matches the target user identifier in the existing user identifiers, the target user identifier is deleted from the user identifier list, and the target user identifier and the corresponding login time are deleted from the user information list to generate third operation result data, which carries a success flag. The user manager object calls the first communication interface object to send the third operation result data to the client, so that the client can parse the third operation result data to obtain the third operation result and output the third operation result.

6. The user management method according to claim 1, characterized in that, After parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes: When the user operation corresponding to the operation code is a user deletion operation, the fourth user identifier is extracted from the user data through the user manager object, and it is checked whether the fourth user identifier is in a valid state. If it is determined that the fourth user identifier is in a valid state, the username to be deleted is extracted from the user data through the user manager object, the corresponding target user data item is deleted from the user information list based on the username to be deleted, and a deletion time is generated based on the current system time. The data storage object is called to associate and store the deletion time with the user information corresponding to the username to be deleted, and a fourth operation result data is generated, which carries a success flag. The user manager object calls the first communication interface object to send the fourth operation result data to the client, so that the client can parse the fourth operation result data to obtain the fourth operation result and output the fourth operation result.

7. The user management method according to claim 1, characterized in that, After parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes: When the user operation corresponding to the operation code is a query user operation, the fifth user identifier is extracted from the user data through the user manager object, and it is checked whether the fifth user identifier is in a valid state. If it is determined that the fifth user identifier is in a valid state, and the username to be queried is extracted from the user data through the user manager object, the data storage object is called to query the target user information corresponding to the username to be queried, and the fifth operation result data is generated based on the target user information. The fifth operation result data carries a success flag. The user manager object calls the first communication interface object to send the fifth operation result data to the client, so that the client can parse the fifth operation result data to obtain the fifth operation result and output the fifth operation result.

8. The user management method according to claim 1, characterized in that, After parsing the user operation data through the user manager object to obtain the operation code and user data, the method further includes: When the user operation corresponding to the operation code is a user modification operation, the sixth user identifier is extracted from the user data through the user manager object, and it is checked whether the sixth user identifier is in a valid state. If the sixth user identifier is determined to be in a valid state, the current login password, the target login password, and the target permission data are extracted from the user data. The current login password is compared with the password of the second user information item corresponding to the sixth user identifier in the user information list. If the passwords match, a modification time is generated based on the current system time, and the second user information item is updated based on the target login password, the target permission data, and the modification time. The data storage object is then called to update the corresponding user information, and the sixth operation result data is generated. The user manager object calls the first communication interface object to send the sixth operation result data to the client, so that the client can parse the sixth operation result data to obtain the sixth operation result and output the sixth operation result.

9. A user management device, characterized in that, include: An initialization unit is configured to initialize a user manager object, which includes a user information list, a user identifier list, a data storage object, and at least one communication interface object. The data reading unit is configured to iterate through and call each communication interface object using the user manager object to determine whether user operation data sent by the client has been read. The data parsing unit is configured to, when the user operation data is read by calling the first communication interface object among the various communication interface objects, parse the user operation data through the user manager object to obtain the operation code and user data; The user registration operation processing unit is configured to, when the user operation corresponding to the operation code is a user registration operation, extract a first user identifier from the user data through the user manager object, check whether the first user identifier is in a valid state, and if it is determined that the first user identifier is in a valid state, extract first user information from the user data through the user manager object, call the data storage object to save the first user information, create a first user information item based on the first user information, add the first user information item to the user information list, and generate first operation result data, wherein the first operation result data carries a success flag. The operation result sending unit is configured to send the first operation result data to the client by calling the first communication interface object through the user manager object, so that the client can parse the first operation result data to obtain the first operation result and output the first operation result.

10. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more computer programs; When the one or more computer programs are executed by the one or more processors, the electronic device implements the user management method as described in any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the user management method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Method and system of user-based DNS server access control

    CN102075589A

  • Atypical identity identification processing method, server, terminal and system

    CN117728982A