Detailed Description
In practical applications, all users in a service system will not perform a service process with a server at the same time. Generally, the server of any service system will not configure its hardware and network resources according to the standard of being able to access all users simultaneously, otherwise there is a huge waste of resources in more than 99% of the time. Thus, even if all users make requests to the server at the same time, the limitations of the processing power and access capacity of the server do not allow the server to respond to all users at the same time. The identity information of the user needs to ensure that each user is unique in the service system, and in the operation process of the service system, the server only needs to be able to distinguish the identity of each user in the currently accessed users.
Therefore, the embodiment of the present application provides a new service implementation method based on user identity, in which a server uses a short identity identifier shorter than identity information to distinguish a currently accessed user, and replaces the identity information with the short identity identifier to perform a subsequent service process, thereby reducing the number of bytes required for identifying the user identity in the service process, and solving the problems existing in the prior art.
In the embodiment of the application, the terminal and the server are mutually accessible through the network. The terminal can be a mobile phone, a tablet Computer, a Personal Computer (PC), a notebook Computer, or the like; the server is used for providing a network side service of a certain service, and may be a physical or logical server, or two or more physical or logical servers sharing different responsibilities and cooperating with each other to implement various functions of the server in the embodiment of the present application. The embodiment of the application does not limit the types of the terminal and the server, and the type, the protocol and the like of a communication network between the terminal and the server.
In the embodiment of the present application, a flow of the service implementation method based on the user identity applied to the server is shown in fig. 1, and a flow of the service implementation method applied to the terminal is shown in fig. 2.
On the terminal, step 210, identity information of the user is sent to the server.
At the server, step 110, identity information of the user from the terminal is received.
For the service based on the user identity, when the terminal connects to the server, the server is provided with the identity information of the user using the terminal. The identity information of the user may be a user identifier of the user in a service system where the server is located, or may be a terminal identifier of the user identifier and a terminal used by the user in the service system.
The user identification can uniquely represent the user in the service system, such as a registered account of the user, a user name, a unique code allocated to the user by the service system, and the like; the terminal Identifier can uniquely represent a certain terminal in the service system, and may be a hardware address of the terminal, such as a Media Access Control (MAC) address, a Universal Unique Identifier (UUID), and the like, or may be a Unique code allocated by the service system to the terminal, or may be another Identifier, which is not limited in the embodiments of the present application.
The terminal can send the identity information of the user to the server in the login request when the user logs in the service system.
On the server, step 120, determining the identity short identifier corresponding to the received identity information and issuing the identity short identifier to the terminal; the number of bytes occupied by the identity short identifier is less than the identity information.
At the terminal, an identity short identifier corresponding to the transmitted identity information is received from the server, step 220.
The server may map the identity information from the terminal to the short identity based on a predetermined algorithm as long as different identity information is made to correspond to different short identity. For example, a digest algorithm may be applied to the identity information to obtain an information digest; checking whether the information abstract is the same as the currently used identity short identifier, and if so, modifying the information abstract until the information abstract is different from the currently used identity short identifier; and taking the obtained information abstract as an identity short mark corresponding to the identity information.
The server may delete the correspondence between the identity information of the user and the identity short identifier after the service process of the user is finished. For example, the terminal sends a login logout request of the user to the server, wherein the login logout request carries identity information or identity short identification of the user; and the server deletes the corresponding relation between the identity information of the user and the identity short identifier after the service process of the user is finished. For another example, after the connection between the terminal and the server is disconnected, the server considers that the service process of the user using the terminal is finished, and then deletes the corresponding relationship between the identity information of the user and the identity short identifier.
The terminal can store the received short identity after receiving the short identity corresponding to the user identity information sent by the terminal from the server; after the service process is finished, the terminal can delete the stored identity short identifier. Deleting the locally stored short identity can improve the safety of the business process.
In one implementation, the server uses an identity serial number with a predetermined length as the identity short identifier, and maintains a record of currently used identity serial numbers (i.e., those already assigned to the terminal for use) or maintains a record of currently unused identity serial numbers. After receiving the user identity information sent by the terminal, the server selects one identity serial number which is not used currently as the identity short identifier of the user and sends the identity short identifier to the terminal. For example, the server may add 1 to the currently used maximum identity serial number, if the obtained identity serial number is not used, the obtained identity serial number is used as the short identity of the user, and if the obtained identity serial number is used, the server may continue to add 1 until the unused identity serial number is obtained as the short identity of the user. After the identity short identifier of the user is determined, the server stores the corresponding relation between the identity information and the identity serial number of the user, and adds the identity serial number of the user to the currently used identity serial number record or deletes the identity serial number of the user from the currently unused identity serial number record.
After the business process of the user is finished, the server deletes the corresponding relation between the identity information and the identity serial number of the user, and puts the identity serial number corresponding to the identity information of the user into the currently unused identity serial number, namely deletes the identity serial number of the user from the currently used identity serial number record or adds the identity serial number of the user into the currently unused identity serial number record.
In this implementation, a certain number of identity serial numbers are used as short identity identifiers of users currently accessing the server, and these identity serial numbers can be reused by multiple users at different time periods, so that the identities of the accessing users can be distinguished by using serial numbers with lengths much shorter than the identity information of the users.
On the terminal, step 230, the received identity short identifier is used to make a service request to the server for the server to perform service processing for the user having the identity information corresponding to the identity short identifier.
On the server, step 130, a service request initiated according to the identity short identifier is received, and service processing is performed for the user having the identity information corresponding to the identity short identifier.
And after receiving the short identity mark sent by the server, the terminal replaces the identity information of the user with the short identity mark to perform the subsequent service process. The terminal uses the received short identity mark to carry out a service request to the server, and specifically, the terminal can directly initiate the service request to the server by using the short identity mark; the service information with the short identity can also be provided to other equipment, and the other equipment uses the short identity to initiate a service request related to the user to the server.
The server receives a service request initiated according to the identity short identifier, wherein the service request can come from a terminal which sends the identity short identifier by the server or from other equipment. And the server carries out service processing aiming at the user corresponding to the identity short identifier.
In one example, the terminal generates a one-dimensional code or a two-dimensional code according to the received short identity identifier, and displays the generated one-dimensional code or two-dimensional code; after scanning the one-dimensional code or the two-dimensional code displayed by the terminal, other equipment acquires the identity short identifier therein, and initiates a service request to the server by using the identity short identifier; after receiving the service request, the server processes the service for the user corresponding to the identity short identifier in the request. Because the information capacity that the bar code can carry is limited (especially one-dimensional code), and with the diversification of the business and the improvement of the complexity of the business process, the information that needs to be conveyed through the bar code is increasing, after replacing the complete user identity information with the short identification of identity in the business process, there are more capacities that can be used for other business information in the bar code, more complicated business system and business system that the user quantity is bigger can all adopt the bar code to realize the business process like this, thus make full use of the convenience of the bar code, simplify the operation of the user, raise the business efficiency.
The service request and the service processing procedures are different according to the service characteristics and specific implementation of different service systems, and reference may be made to the prior art, which is not described again.
It can be seen that, in the embodiment of the application, the server distinguishes the currently accessed user through the short identity identifier which is allocated to the terminal and corresponds to the user identity information and has a smaller byte number, and the terminal and the server can complete the subsequent service process by adopting the short identity identifier, thereby reducing the byte number required for identifying the user identity in the service process, expanding the implementation modes of the service system with a large user number and based on the user identity, and providing more convenience for the user.
In one application example of the application, a user installs a client application program, namely a payment App, of a payment business system on a mobile phone to carry out mobile payment through the payment business system. When the payment App operates for the first time after being installed, a server of the payment service system allocates a 32-bit terminal identifier to the mobile phone and sends the terminal identifier to the payment App, and the terminal identifier is used for uniquely representing the mobile phone in the payment service system. When a user logs in a payment service system through a payment App, a server sends a 16-bit user identifier distributed for the user to the payment App, and the user identifier is used for uniquely representing the user in the payment service system. The user identification and the terminal identification are stored locally by the payment App. The payment service system requires the user identifier and the terminal identifier to be bound and then used in the payment service, so as to increase the security.
One specific payment service is as follows: when a user carries out mobile payment by using a mobile phone, a payment App generates a one-dimensional bar code and displays the bar code to payee equipment; the payee's device obtains the user's identity in the payment transaction system by scanning the one-dimensional code displayed on the mobile phone to request payment of money from the server.
If the payment App uses the user id and the terminal id to generate the one-dimensional code, the payment service cannot be realized because the one-dimensional code does not have enough bytes to carry the user id information and the terminal id information which are 48 bits long in total, in addition to other necessary information.
In the application example, the server uses an identity serial number with a length of 10 bits as the identity short identifier. The server maintains a record of the identity serial number that is not currently being used.
When a user logs in a payment service system through a payment App, the payment App sends identity information (a user identifier and a terminal identifier) of the user to a server in a login request. After receiving the login request, the server allocates an identity serial number which is not used currently for the user, and the identity serial number is used as an identity short identifier of the user and sent to the payment App. The server stores the corresponding relation among the identity serial number, the user identification and the terminal identification, and deletes the identity serial number from the identity serial number record which is not used currently.
And the payment App receives the identity serial number sent by the server and stores the identity serial number in the local. When the user carries out mobile payment by using the mobile phone, the payment App generates a one-dimensional code by using the stored 10-bit identity serial number and displays the one-dimensional code to the payee device. The payee device scans the one-dimensional code displayed on the mobile phone and takes the identity serial number as a payer in a service request sent to the server.
The server receives the service request of the payee device, searches the user identification and the terminal identification corresponding to the identity serial number in the service request, and completes the payment service process requested by the payee device by using the corresponding user identification and terminal identification.
And when the user quits the payment App, the payment business process is ended. The payment App deletes the locally stored identity serial number. The server deletes the corresponding relation between the identity serial number of the user and the user identification and the terminal identification, and adds the identity serial number of the user into the identity serial number record which is not used currently. Thus, the identity serial number can be used in the payment business process of other mobile phone payment apps.
Corresponding to the above flow implementation, the embodiment of the present application further provides a service implementation apparatus based on the user identity, which is applied to the server, and a service implementation apparatus based on the user identity, which is applied to the terminal. Both of these means can be implemented by software, or by hardware, or by a combination of hardware and software. In the case of software implementation, the logical device is formed by reading corresponding computer program instructions into a memory for operation by a Central Processing Unit (CPU) of a terminal or a server. In terms of hardware, in addition to the CPU, the memory, and the nonvolatile memory shown in fig. 3, a terminal where the service implementation apparatus based on the user identity is located generally includes other hardware such as a chip for performing wireless signal transmission and reception, and a server where the service implementation apparatus based on the user identity is located generally includes other hardware such as a board card for implementing a network communication function.
Fig. 4 shows a service implementation apparatus based on a user identity, which is applied to a server and includes an identity information receiving unit, an identity short identifier issuing unit, and a service request processing unit, where: the identity information receiving unit is used for receiving identity information of a user from the terminal; the identity short identifier issuing unit is used for determining the identity short identifier which has a corresponding relation with the received identity information and issuing the identity short identifier to the terminal; the number of bytes occupied by the identity short identification is less than the identity information; the service request processing unit is used for receiving a service request initiated according to the identity short identifier and processing the service aiming at the user with the identity information corresponding to the identity short identifier.
Optionally, the identity information receiving unit is specifically configured to: receiving a user login request from a terminal, wherein the login request comprises identity information of a user; the device also comprises a corresponding relation deleting unit which is used for deleting the corresponding relation between the identity information of the user and the identity short identifier after the service process of the user is finished.
In one example, the short identification comprises: an identity serial number having a predetermined length; the identity short identifier issuing unit is specifically used for: and selecting one of the identity serial numbers which are not used at present as the identity short identifier which has a corresponding relation with the received identity information and sending the identity short identifier to the terminal.
In the above example, the apparatus may further include an identity serial number recycling unit, configured to, after the service process is finished, attribute an identity serial number corresponding to the identity information of the user to a currently unused identity serial number.
Optionally, the identity information includes: and the user identifier, or the user identifier and the terminal identifier.
Optionally, the service request initiated according to the identity short identifier includes: and scanning the service request initiated after the one-dimensional code or the two-dimensional code generated according to the identity short identifier.
Fig. 5 shows a service implementation apparatus based on user identity, which is applied to a terminal and includes an identity information sending unit, an identity short identifier receiving unit, and a short identifier service request unit, where: the identity information sending unit is used for sending the identity information of the user to the server; the identity short identifier receiving unit is used for receiving the identity short identifier corresponding to the identity information from the server; the number of bytes occupied by the identity short identification is less than the identity information; the short identification service request unit is used for using the identity short identification to carry out service request to the server, and the server carries out service processing aiming at the user with the identity information corresponding to the identity short identification.
Optionally, the identity information sending unit is specifically configured to: and sending a user login request to the server, wherein the login request comprises the identity information of the user.
Optionally, the apparatus further includes an identity short identifier storage unit and an identity short identifier deletion unit, where: the identity short identifier storage unit is used for storing the received identity short identifier after receiving the identity short identifier from the server; and the identity short identifier deleting unit is used for deleting the stored identity short identifier after the service process is finished.
Optionally, the identity information includes: and the user identifier, or the user identifier and the terminal identifier.
Optionally, the service request to the server by using the short identity identifier includes: generating a one-dimensional code or a two-dimensional code according to the identity short identifier; and after the one-dimensional code or the two-dimensional code is scanned by other equipment, the other equipment initiates a service request to the server.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.