CN116962514A - Health code acquisition method, apparatus, server, storage medium, and program product - Google Patents

Health code acquisition method, apparatus, server, storage medium, and program product Download PDF

Info

Publication number
CN116962514A
CN116962514A CN202210384774.3A CN202210384774A CN116962514A CN 116962514 A CN116962514 A CN 116962514A CN 202210384774 A CN202210384774 A CN 202210384774A CN 116962514 A CN116962514 A CN 116962514A
Authority
CN
China
Prior art keywords
health code
identification information
server
local cache
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210384774.3A
Other languages
Chinese (zh)
Inventor
崔彦博
王宇
兰逸正
刘瑞麟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Didi Infinity Technology and Development Co Ltd
Original Assignee
Beijing Didi Infinity Technology and Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Didi Infinity Technology and Development Co Ltd filed Critical Beijing Didi Infinity Technology and Development Co Ltd
Priority to CN202210384774.3A priority Critical patent/CN116962514A/en
Publication of CN116962514A publication Critical patent/CN116962514A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • GPHYSICS
    • G08SIGNALLING
    • G08BSIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
    • G08B21/00Alarms responsive to a single specified undesired or abnormal condition and not otherwise provided for
    • G08B21/18Status alarms
    • G08B21/24Reminder alarms, e.g. anti-loss alarms

Abstract

The embodiment of the disclosure relates to a health code acquisition method, a health code acquisition device, a server, a storage medium and a program product. The method is applied to a first server, and comprises the following steps: receiving a first acquisition request sent by a terminal, wherein the first acquisition request comprises identification information of a user; inquiring a local cache space of a first server according to the identification information, and acquiring a target health code corresponding to the identification information; the target health code is acquired from a third party platform by the first server in historical time; and sending the target health code to the terminal. The method can solve the problem of flow overload of the platform running the health code.

Description

Health code acquisition method, apparatus, server, storage medium, and program product
Technical Field
The embodiment of the disclosure relates to the technical field of information processing, in particular to a health code acquisition method, a health code acquisition device, a server, a storage medium and a program product.
Background
Along with the development of computer technology, the two-dimensional code technology is also mature gradually, and the two-dimensional code technology is also widely applied to daily life of people, for example, a restaurant can establish a two-dimensional code menu through two-dimensional codes, information such as dishes, seats and the like of the restaurant is input according to relevant guidance, and a user can place an order by scanning the two-dimensional codes on a dining table, so that the dining of the user is facilitated.
Aiming at the current epidemic situation, when a user enters a public place or takes a vehicle, the user terminal is required to scan the two-dimensional code of the public place or the two-dimensional code of the vehicle so as to acquire the health code from a platform running the health code, and the user can enter or take the vehicle when the health code of the user is displayed in a normal state.
However, with the increase of health code service access parties, a traffic overload problem occurs on a platform running the health code.
Disclosure of Invention
The embodiment of the disclosure provides a health code acquisition method, a health code acquisition device, a server, a storage medium and a program product, which can be used for solving the problem that a platform running health codes is overloaded with traffic.
In a first aspect, an embodiment of the present disclosure provides a health code acquisition method, which is applied to a first server, and includes:
receiving a first acquisition request sent by a terminal, wherein the first acquisition request comprises identification information of a user;
inquiring a local cache space of a first server according to the identification information, and acquiring a target health code corresponding to the identification information; the target health code is acquired from a third party platform by the first server in historical time;
and sending the target health code to the terminal.
In a second aspect, an embodiment of the present disclosure provides a health code acquisition apparatus, which is applied to a first server, the apparatus including:
the first receiving module is used for receiving a first acquisition request sent by the terminal, wherein the first acquisition request comprises identification information of a user;
the first acquisition module is used for inquiring the local cache space of the first server according to the identification information and acquiring a target health code corresponding to the identification information; the target health code is acquired from a third party platform by the first server in historical time;
and the first sending module is used for sending the target health code to the terminal.
In a third aspect, an embodiment of the disclosure provides a server, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method of the first aspect when the processor executes the computer program.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements the method of the first aspect described above.
According to the health code acquisition method, the device, the server, the storage medium and the program product, the target health code corresponding to the identification information of the user acquired by the first server is acquired by the server from the third-party platform in the history time and stored in the local cache space of the first server, and the reading and writing interfaces of the health code are separated, so that after the first server receives the first acquisition request sent by the terminal, the first server inquires in the local cache of the first server according to the identification information of the user included in the first acquisition request, the target health code corresponding to the identification information of the user can be acquired from the local cache space in time, the problem of flow overload of the first server is avoided, and the terminal is ensured to acquire the target health code corresponding to the identification information of the user in time.
Drawings
FIG. 1 is a diagram of an application environment for a health code acquisition method in one embodiment;
FIG. 2 is a flow chart of a method for acquiring health codes according to one embodiment;
FIG. 3 is a flowchart of a health code acquisition method according to another embodiment;
FIG. 4 is a flowchart of a health code acquisition method according to another embodiment;
FIG. 5 is a flowchart of a health code acquisition method according to another embodiment;
FIG. 6 is a flowchart of a health code acquisition method according to another embodiment;
FIG. 7 is a block diagram of a health code acquisition device in one embodiment;
fig. 8 is an internal structural diagram of a server in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the disclosed embodiments and are not intended to limit the disclosed embodiments.
First, before the technical solution of the embodiments of the present disclosure is specifically described, a description is given of a technical background or a technical evolution context on which the embodiments of the present disclosure are based. Aiming at the current situation that a user needs to scan the two-dimensional code of the vehicle through a user terminal when riding the vehicle so as to acquire the health code from a platform running the health code, the user can ride the vehicle when the health code of the user is displayed as a normal state, however, when more users are scanning the two-dimensional code, namely health code service access parties are increased, the platform running the health code can have the problem of flow overload, when the platform running the health code has the problem of flow overload, a firewall defense mechanism of government cloud can be triggered, the platform running the health code can not call data on the government cloud, and the two-dimensional code state of the user can not be fed back. Based on the background, the applicant discovers some hot spot areas in the map through long-term model simulation research and development and collection, demonstration and verification of experimental data, and when the number of driving demands reaches 60%, the problem that the platform running the health code is overloaded with flow occurs. How to solve the problem of traffic overload occurring on a platform running health codes under the requirement of 60% becomes a current urgent problem to be solved. In addition, the applicant has made a great deal of creative effort from determining the peak point of 60% and the technical solutions described in the following examples.
The following describes a technical scheme related to an embodiment of the present disclosure in conjunction with a scenario in which the embodiment of the present disclosure is applied.
The health code acquisition method provided by the embodiment of the disclosure can be applied to an application environment as shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network and the server 104 communicates with the third party platform 106 via the network. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster formed by a plurality of servers; the third party platform 106 may be implemented as a stand-alone server or as a cluster of servers.
In one embodiment, as shown in fig. 2, a health code acquisition method is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
s201, a first acquisition request sent by a terminal is received, wherein the first acquisition request comprises identification information of a user.
It should be noted that, the health code acquisition method provided by the embodiment of the application can be applied to a scene of network about vehicle travel, a scene of a user riding a public transport means, and the like. The following describes an example of a network about travel scenario, in which the user may be a passenger or a driver, as an alternative. Optionally, the first obtaining request received by the first server may be sent by the terminal to the first server when the terminal scans the two-dimensional code on the network bus when the passenger takes the bus; or, when the driver goes out, the terminal scans the two-dimension code on the network bus, and the terminal sends the two-dimension code to the first server.
Optionally, the identification information of the user may include at least one of a name, a mobile phone number, and an identification card number of the user. Optionally, the first acquisition request received by the first server may be an encrypted request, and after the first server receives the first acquisition request, the first acquisition request may be decrypted first, and identification information of the user is parsed from the decrypted acquisition request.
S202, inquiring a local cache space of a first server according to the identification information, and acquiring a target health code corresponding to the identification information; the target health code is obtained by the first server from the third party platform at a historical time.
Optionally, after the first server receives the first obtaining request, the first server may query in a local cache space of the first server according to a correspondence between the identification information of the user and the health code corresponding to the identification information included in the first obtaining request, to obtain a target health code corresponding to the identification information of the user; or the first server may traverse the health codes stored in the local cache space, and determine the health code corresponding to the found identification information matched with the identification information of the user as the target health code. Optionally, if the first server does not find the target health code corresponding to the identification information in the local cache, the first server may send an instruction of failed query to the terminal, or the first server may also re-acquire the target health code corresponding to the identification information from the third party platform according to the identification information. Alternatively, the local cache space of the first server may be a redis database cluster or the like.
The target health code is obtained from a third party platform by a first server in historical time. Here, the historical time refers to a period of time between the first server receiving the first acquisition request. For example, the terminal may send the identification information of the user to the first server when it is detected that the user logs in the taxi taking application and is not taking a taxi, so that the first server may obtain, from the third party platform, a health code corresponding to the identification information of the user according to the identification information of the user, and store the obtained health code in a local cache of the first server. It may be appreciated that the third party platform stores health codes corresponding to respective users, for example, the third party platform may be a government cloud platform or the like. Optionally, after the first server obtains the health code from the third party platform in the historical time, the obtained health code may be stored in a local cache space of the first server in a form of a queue.
And S203, the target health code is sent to the terminal.
Optionally, the first server may encrypt the obtained target health code and send the encrypted target health code to the terminal. Optionally, the type information of the target health code sent to the terminal by the first server may be included in the target health code sent to the terminal by the first server, for example, the target health code sent to the terminal by the first server may be a red code, or the target health code sent to the terminal by the first server is a green code, or the target health code sent to the terminal by the first server is a yellow code.
In the health code acquisition method, the target health code corresponding to the identification information of the user acquired by the first server is acquired by the server from the third-party platform in the history time and stored in the local cache space of the first server, and the read-write interface of the health code is separated, so that the first server inquires in the local cache of the first server according to the identification information of the user included in the first acquisition request after receiving the first acquisition request sent by the terminal, the target health code corresponding to the identification information of the user can be timely acquired from the local cache space, the problem that the first server is overloaded in flow is avoided, and the terminal is ensured to be capable of timely acquiring the target health code corresponding to the identification information of the user.
In the scenario where the first server obtains the target health code from the third party platform at the historical time, in one embodiment, as shown in fig. 3, the method further includes:
s301, receiving a login request sent by a terminal; the login request carries identification information of the user.
Optionally, the login request received by the first server may be sent by the terminal to the first server when the passenger triggers the taxi taking software in the terminal; alternatively, the terminal may send to the first server when the driver triggers the departure software in the terminal.
Optionally, the login request and the first obtaining request sent by the terminal may be sent by the same application program of the terminal, or may be sent by a different application program of the terminal, for example, the first obtaining request may be sent by an application program with a scanning function of the terminal, and the login request may be sent by a taxi taking application software of the terminal.
Optionally, after the first server receives the login request sent by the terminal, the first server may analyze the received login request, and obtain the carried identification information of the user from the analyzed login request.
S302, based on the login request, the target health code is obtained from the third party platform according to the identification information, and the target health code is stored in the local cache space.
Optionally, in this embodiment, the first server may parse the identification information of the user from the login request based on the login request, and send an acquisition request carrying the identification information of the user to the third party platform, so that the third party platform may acquire, according to the acquisition request, a target health code corresponding to the identification information of the user, and send the target health code to the first server, where the first server stores the target health code in a local cache space of the first server after receiving the target health code. Optionally, the third party platform may search the target health code corresponding to the identification information of the user in the third party platform in a matching search manner according to the identification information of the user. Alternatively, the first server may store the target health code in a queue in a local cache space of the first server.
In this embodiment, the first server may obtain, based on the received login request and according to the identification information of the user carried in the login request, the target health code corresponding to the identification information of the user from the third party platform, so that the target health code may be stored in the local cache of the first server, and thus, when the first obtaining request sent by the terminal is received, a process that the first server obtains, from the third party platform, the target health code corresponding to the identification information of the user is avoided, and further, a problem that the first server is overloaded with traffic is avoided, so that it is ensured that the terminal may timely obtain the target health code corresponding to the identification information of the user.
In the above scenario of querying the local cache space of the server according to the identification information of the user to obtain the target health code corresponding to the identification information, in one embodiment, as shown in fig. 4, the step S202 includes:
s401, determining whether candidate health codes corresponding to the identification information exist in the local cache space within effective time according to the identification information.
Alternatively, the effective time in this embodiment may be a period of time before the current time, for example, two hours before the current time, or three hours before the current time, or the like. Taking the effective time as two hours before the current time as an example, the first server can search whether the candidate health code corresponding to the identification information of the user exists in the two hours before the current time in the local cache space according to the identification information of the user. Optionally, the first server may search in the local cache space according to the correspondence between the identification information and the candidate health code corresponding to the identification information, and determine whether the candidate health code corresponding to the identification information of the user exists in the local cache space within the effective time.
And S402, if the candidate health code exists, determining the candidate health code as the target health code.
Specifically, if the first server determines that the candidate health code corresponding to the identification information of the user exists in the local cache space within the effective time, the first server determines the candidate health code corresponding to the identification information of the user as the target health code.
Optionally, if the candidate health code corresponding to the identification information of the user does not exist in the local cache space within the effective time, the first server queries whether the history health code corresponding to the identification information of the user exists in the history time in the local cache space, and if the first server finds the history health code in the local cache, the first server can determine the history health code as the target health code. Illustratively, taking the above effective time as an example of one hour before the current time, the historical time in this embodiment may be two hours before the current time.
Or if the candidate health code corresponding to the identification information of the user does not exist in the local cache space within the effective time, the first server may send a third acquisition request to the third party platform, where the third acquisition request includes the identification information of the user, after the third party platform receives the third acquisition request sent by the first server, the third party platform may search the health code corresponding to the identification information of the user according to the identification information of the user included in the third acquisition request, send the searched health code corresponding to the identification information of the user to the first server, and the first server receives the health code corresponding to the identification information of the user returned by the third party platform, and determines the health code corresponding to the received identification information of the user as the target health code. Optionally, after the first server receives the health code corresponding to the identification information of the user returned by the third party platform, the first server may update the local cache space of the first server by using the health code corresponding to the received identification information, and update the health code stored in the local cache space of the first server.
Further, if the first server does not find the historical health code in the local cache space, that is, if the historical health code does not exist in the local cache space, the first server may send a second acquisition request to the third party platform, where the second acquisition request includes identification information of the user, after the third party platform receives the second acquisition request sent by the first server, the third party platform may find a health code corresponding to the identification information of the user according to the identification information of the user included in the second acquisition request, send the found health code corresponding to the identification information of the user to the first server, and the first server receives the health code corresponding to the identification information of the user returned by the third party platform, and determines the health code corresponding to the received identification information of the user as the target health code. Optionally, after the first server receives the health code corresponding to the identification information of the user returned by the third party platform, the first server may update the local cache space of the first server by using the health code corresponding to the received identification information, and update the health code stored in the local cache space of the first server.
In this embodiment, the first server determines, according to the identification information of the user, whether the candidate health code corresponding to the identification information of the user exists in the local cache space of the first server within the effective time, and may determine, as the target health code, the candidate health code corresponding to the identification information of the user when the candidate health code corresponding to the identification information of the user exists in the local cache space, thereby avoiding a process that the first server acquires, from the third party platform, the target health code corresponding to the identification information of the user again, and avoiding a problem that the first server is overloaded with traffic, and ensuring that the terminal can acquire, in time, the target health code corresponding to the identification information of the user.
In some scenarios, the first server may further determine whether the third party platform is abnormal, and in one embodiment, the method further includes: if the number of times of failure in acquiring the health code from the third party platform is greater than a preset number of times threshold in a preset statistical period, determining that the third party platform is abnormal.
For example, taking 10s as one statistical period as an example, if the number of failures of the first server to obtain the health code from the third party platform within 10s continuously is greater than the preset number threshold, the first server may determine that the third party platform is abnormal. Or, optionally, if the number of times that the first server fails to acquire the health code from the third party platform is greater than the preset number of times threshold in three continuous statistical periods, the first server may also determine that the third party platform is abnormal.
Optionally, if the first server determines that the third party platform is abnormal, the first server may trigger the fusing mechanism, and no longer send an acquisition request for acquiring the health code to the third party platform. Alternatively, the third party platform exception may be a database exception storing the health code in the third party, or may be a request exception for the third party platform to receive the first server, or the like.
In this embodiment, if the number of times that the first server fails to acquire the health code from the third party platform is greater than the preset number of times threshold in the preset statistics period, the first server determines that the third party platform is abnormal, and by timely determining whether the third party platform is abnormal, the first server can be ensured to accurately acquire the health code corresponding to the identification information of the user from the third party platform, so that the success rate of the first server for acquiring the health code corresponding to the identification information of the user is improved.
In some scenarios, there may be a case where the storage amount of the local cache space of the first server is smaller and the acquired health code cannot be stored, and in one embodiment, as shown in fig. 5, the method further includes:
s501, if the storage amount of the local cache space is greater than a first threshold value, determining a second server from the cluster where the first server is located.
Taking the first threshold value as 80% as an example, if the first server determines that the storage capacity of the local cache space of the first server is greater than 80%, the first server determines the second server from the cluster where the first server is located. Alternatively, the determined second server may be one server or may be a plurality of servers.
S502, when the storage amount of the local cache space is larger than a second threshold value, storing the acquired health code into a second server; wherein the second threshold is greater than the first threshold.
For example, taking the second threshold value as 95%, when the first server determines that the storage amount of the local cache space is greater than 95%, the first server may not store the health code acquired from the third party platform in the local cache of the first server, but store the acquired health code in the determined second server.
In this embodiment, when the storage amount of the local cache space of the first server is greater than the first threshold, the first server may determine the second server from the cluster where the first server is located, and when the storage amount of the local cache space is greater than the second threshold, the obtained health code is stored in the determined second server, so that loss of the obtained health code is avoided, complete storage of the obtained health code can be ensured, and integrity of storing the obtained health code is improved.
In some scenarios, the first server may further monitor whether the obtained target health code is abnormal, and when it is monitored that the number of abnormal target health codes reaches a preset threshold, alarm prompt is performed, and in one embodiment, as shown in fig. 6, the method further includes:
s601, detecting whether the obtained target health code is abnormal.
Optionally, the first server may determine whether the target health code is abnormal according to the type of the target health code, for example, if the target health code is a red code, the first server may determine that the target health code is abnormal, or if the target health code is a yellow code, the first server may determine that the target health code is abnormal, or if the target health code is a null code, the first server may determine that the target health code is abnormal.
S602, if the number of abnormal target health codes reaches a preset threshold, outputting alarm prompt information.
Optionally, if the first server detects that the number of abnormal target health codes reaches the preset threshold, the first server may output an alarm prompt message by dialing an alarm phone, or the first server may also send a message to the terminal to output the alarm prompt message.
In this embodiment, when the first server detects that the number of the abnormal target health codes reaches the preset threshold, the abnormal state of the target health codes can be timely fed back by outputting the alarm prompt information, so that the user can timely acquire the state of the target health codes.
An embodiment of the present disclosure is described below in connection with a specific travel scenario, the method comprising the steps of:
s1, receiving a login request sent by a terminal; the login request carries identification information of the user.
S2, based on the login request, acquiring a target health code from the third party platform according to the identification information, and storing the target health code in a local cache space.
S3, receiving a first acquisition request sent by the terminal, wherein the first acquisition request comprises identification information of a user.
And S4, determining whether candidate health codes corresponding to the identification information exist in the local cache space within effective time according to the identification information.
And S5, if the candidate health code exists, determining the candidate health code as the target health code.
S6, if no candidate health codes exist, inquiring whether the history time in the local cache space exists the history health codes corresponding to the identification information or not; or, sending a third acquisition request to the third party platform, receiving the health code corresponding to the identification information returned by the third party platform based on the third acquisition request, determining the health code corresponding to the identification information as a target health code, and updating the local cache space by utilizing the health code corresponding to the identification information; the third acquisition request includes identification information of the user.
And S7, if the history health code exists in the local cache space, determining the history health code as the target health code.
S8, if the historical health code does not exist in the local cache space, a second acquisition request is sent to a third party platform; the second acquisition request includes identification information of the user.
S9, receiving the health code corresponding to the identification information returned by the third party platform based on the second acquisition request, determining the health code corresponding to the identification information as a target health code, and updating the local cache space by utilizing the health code corresponding to the identification information.
The working principle of the health code obtaining method provided in this embodiment is please refer to the detailed description in the above embodiment, which is not repeated here.
It should be understood that, although the steps in the flowcharts of fig. 2-6 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-6 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 7, there is provided a health code acquisition apparatus applied to a first server, including: the device comprises a first receiving module, a first obtaining module and a first sending module, wherein:
the first receiving module is used for receiving a first acquisition request sent by the terminal, wherein the first acquisition request comprises identification information of a user;
the first acquisition module is used for inquiring the local cache space of the first server according to the identification information and acquiring a target health code corresponding to the identification information; the target health code is acquired from a third party platform by a first server in historical time;
and the first sending module is used for sending the target health code to the terminal.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
On the basis of the above embodiment, optionally, the above apparatus further includes: the device comprises a second receiving module and a second obtaining module, wherein:
the second receiving module is used for receiving a login request sent by the terminal; the login request carries identification information of the user.
The second acquisition module is used for acquiring the target health code from the third party platform according to the identification information based on the login request and storing the target health code in the local cache space.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
On the basis of the foregoing embodiment, optionally, the first acquisition module includes: a first determination unit and a second determination unit, wherein:
and the first determining unit is used for determining whether the candidate health code corresponding to the identification information exists in the local cache space within the effective time according to the identification information.
And the second determining unit is used for determining the candidate health code as the target health code if the candidate health code exists.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
On the basis of the above embodiment, optionally, the above apparatus further includes: a query module and a first determination module, wherein:
and the query module is used for querying whether the historical time in the local cache space has the historical health code corresponding to the identification information if the candidate health code does not exist.
The first determining module is configured to determine the historical health code as the target health code if the historical health code exists in the local cache space.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
On the basis of the above embodiment, optionally, the above apparatus further includes: a second transmitting module and a third receiving module, wherein:
the second sending module is used for sending a second acquisition request to the third party platform if the historical health code does not exist in the local cache space; the second acquisition request includes identification information of the user.
The third receiving module is used for receiving the health code corresponding to the identification information returned by the third party platform based on the second acquisition request and determining the health code corresponding to the identification information as the target health code.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
On the basis of the above embodiment, optionally, the above apparatus further includes: a third transmitting module and a fourth receiving module, wherein:
the third sending module is used for sending a third acquisition request to the third party platform if the candidate health code corresponding to the identification information does not exist in the effective time; the third acquisition request includes identification information of the user.
And the fourth receiving module is used for receiving the health code corresponding to the identification information returned by the third party platform based on the third acquisition request and determining the health code corresponding to the identification information as the target health code.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
On the basis of the above embodiment, optionally, the above apparatus further includes: an update module, wherein:
and the updating module is used for updating the local cache space by utilizing the health code corresponding to the identification information.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
On the basis of the above embodiment, optionally, the above apparatus further includes: a second determination module, wherein:
the second determining module is configured to determine that the third party platform is abnormal if the number of failures in acquiring the health code from the third party platform is greater than a preset number of thresholds in a preset statistical period.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
On the basis of the above embodiment, optionally, the above apparatus further includes: a third determination module and a storage module, wherein:
and the third determining module is used for determining a second server from the cluster where the first server is located if the storage amount of the local cache space is larger than the first threshold value.
The storage module is used for storing the acquired health code into the second server when the storage amount of the local cache space is larger than a second threshold value; wherein the second threshold is greater than the first threshold.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
On the basis of the above embodiment, optionally, the above apparatus further includes: the device comprises a detection module and an output module, wherein:
the detection module is used for detecting whether the obtained target health code is abnormal or not.
The output module is used for outputting alarm prompt information if the number of the abnormal target health codes reaches a preset threshold value.
The health code acquiring device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
For specific limitations of the health code acquisition device, reference may be made to the above limitation of the health code acquisition method, and no further description is given here. The respective modules in the above-described health code acquisition apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in a server, or may be stored in software in a memory in an electronic device, so that the processor may call and execute operations corresponding to the above modules.
Fig. 8 is a block diagram of a server 1400 shown in accordance with an exemplary embodiment. With reference to fig. 8, server 1400 includes a processing component 1420 that further includes one or more processors and memory resources, represented by memory 1422, for storing instructions or computer programs, such as application programs, executable by the processing component 1420. The application programs stored in memory 1422 can include one or more modules, each corresponding to a set of instructions. Further, the processing component 1420 is configured to execute instructions to perform the method of health code acquisition described above.
The server 1400 may also include a power component 1424 configured to perform power management of the device 1400, a wired or wireless network interface 1426 configured to connect the device 1400 to a network, and an input/output (I/O) interface 1428. The server 1400 may operate an operating system based on storage 1422, such as Window14 14erverTM,Mac O14 XTM,UnixTM,LinuxTM, freeB14DTM or the like.
In an exemplary embodiment, a storage medium is also provided that includes instructions, such as memory 1422 including instructions, that can be executed by a processor of server 1400 to perform the above-described methods. The storage medium may be a non-transitory computer readable storage medium, which may be, for example, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In an exemplary embodiment, a computer program product is also provided, which, when being executed by a processor, may implement the above-mentioned method. The computer program product includes one or more computer instructions. When loaded and executed on a computer, these computer instructions may implement some or all of the methods described above, in whole or in part, in accordance with the processes or functions described in embodiments of the present disclosure.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided by the present disclosure may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few implementations of the disclosed examples, which are described in more detail and are not to be construed as limiting the scope of the application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made to the disclosed embodiments without departing from the spirit of the disclosed embodiments. Accordingly, the protection scope of the disclosed embodiment patent should be subject to the appended claims.

Claims (14)

1. A method for obtaining a health code, wherein the method is applied to a first server, the method comprising:
receiving a first acquisition request sent by a terminal, wherein the first acquisition request comprises identification information of a user;
inquiring a local cache space of a first server according to the identification information, and acquiring a target health code corresponding to the identification information; the target health code is acquired from a third party platform by the first server in historical time;
and sending the target health code to the terminal.
2. The method according to claim 1, wherein the method further comprises:
receiving a login request sent by a terminal; the login request carries the identification information of the user;
and acquiring the target health code from the third party platform according to the identification information based on the login request, and storing the target health code in the local cache space.
3. The method of claim 2, wherein the querying the local cache space of the first server according to the identification information, and obtaining the target health code corresponding to the identification information, includes:
determining whether a candidate health code corresponding to the identification information exists in the local cache space within effective time according to the identification information;
and if the candidate health code exists, determining the candidate health code as the target health code.
4. A method according to claim 3, characterized in that the method further comprises:
if the candidate health codes do not exist, inquiring whether the history time in the local cache space exists the history health codes corresponding to the identification information or not;
and if the history health code exists in the local cache space, determining the history health code as the target health code.
5. The method according to claim 4, wherein the method further comprises:
if the history health code does not exist in the local cache space, a second acquisition request is sent to the third party platform; the second acquisition request comprises identification information of the user;
and receiving a health code corresponding to the identification information returned by the third party platform based on the second acquisition request, and determining the health code corresponding to the identification information as the target health code.
6. A method according to claim 3, characterized in that the method further comprises:
if the candidate health codes corresponding to the identification information do not exist in the effective time, a third acquisition request is sent to the third party platform; the third acquisition request comprises identification information of the user;
and receiving a health code corresponding to the identification information returned by the third party platform based on the third acquisition request, and determining the health code corresponding to the identification information as the target health code.
7. The method according to claim 5 or 6, characterized in that the method further comprises:
and updating the local cache space by using the health code corresponding to the identification information.
8. The method according to claim 1, wherein the method further comprises:
if the number of times of failure in acquiring the health code from the third party platform is greater than a preset number of times threshold in a preset statistical period, determining that the third party platform is abnormal.
9. The method according to claim 1 or 2, characterized in that the method further comprises:
if the storage amount of the local cache space is larger than a first threshold value, determining a second server from the cluster where the first server is located;
when the storage amount of the local cache space is larger than a second threshold value, the acquired health code is stored in the second server; wherein the second threshold is greater than the first threshold.
10. The method according to claim 1, wherein the method further comprises:
detecting whether the obtained target health code is abnormal or not;
and if the number of the abnormal target health codes reaches a preset threshold, outputting alarm prompt information.
11. A health code acquisition device, the device being applied to a first server, the device comprising:
the first receiving module is used for receiving a first acquisition request sent by the terminal, wherein the first acquisition request comprises identification information of a user;
the first acquisition module is used for inquiring the local cache space of the first server according to the identification information and acquiring a target health code corresponding to the identification information; the target health code is acquired from a third party platform by the first server in historical time;
and the first sending module is used for sending the target health code to the terminal.
12. A server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 10 when the computer program is executed.
13. A storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of the method of any of claims 1 to 10.
14. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1-10.
CN202210384774.3A 2022-04-13 2022-04-13 Health code acquisition method, apparatus, server, storage medium, and program product Pending CN116962514A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210384774.3A CN116962514A (en) 2022-04-13 2022-04-13 Health code acquisition method, apparatus, server, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210384774.3A CN116962514A (en) 2022-04-13 2022-04-13 Health code acquisition method, apparatus, server, storage medium, and program product

Publications (1)

Publication Number Publication Date
CN116962514A true CN116962514A (en) 2023-10-27

Family

ID=88453337

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210384774.3A Pending CN116962514A (en) 2022-04-13 2022-04-13 Health code acquisition method, apparatus, server, storage medium, and program product

Country Status (1)

Country Link
CN (1) CN116962514A (en)

Similar Documents

Publication Publication Date Title
CN106792992B (en) Method and equipment for providing wireless access point information
US10171964B2 (en) Location-oriented services
EP3562257B1 (en) Wireless fidelity (wi-fi) connection method and related product
US10492236B2 (en) Method and device for establishing wireless connection
EP2985730A1 (en) Method and device for partially-upgrading
CN110889096B (en) Login method, login device, computer equipment and storage medium
WO2017075755A1 (en) Apparatus, method and computer program product for privacy protection
CN111611573A (en) Data processing method for realizing terminal equipment switching, related equipment and medium
CN114556861A (en) Anonymization and randomization of device identities
CN106156258B (en) Method, device and system for counting data in distributed storage system
US20210112025A1 (en) Method and server for processing messages
CN112261570B (en) Method, device, server and storage medium for associating interest point with wireless network
JP2015158799A (en) Space-time clustering processing device, method and program
CN110972071A (en) Multi-mode positioning method, positioning server, terminal and storage medium
WO2020181819A1 (en) Intelligent scheduling method and apparatus, computer device and storage medium
CN116962514A (en) Health code acquisition method, apparatus, server, storage medium, and program product
US11917699B2 (en) Device tracing architecture
CN113114734B (en) Information processing method, device, equipment and storage medium
CN112532512B (en) Session message processing method, related device, equipment and medium
US20160156726A1 (en) Method, server, terminal, system, and storage medium for displaying multiuser map
CN107632919B (en) Database monitoring method and device
CN112099771A (en) Data processing method and device, electronic equipment and storage medium
US20160056994A1 (en) Diagnosing Network Misconfiguration Externally
CN112785739B (en) Sign-in processing method, computer equipment and readable storage medium
CN115134405B (en) Data processing method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination