CN-122019610-A - Data fusion management method and device, electronic equipment and storage medium
Abstract
The application provides a data fusion management method, a data fusion management device, electronic equipment and a storage medium, which are suitable for the technical field of data processing. The method comprises the steps of responding to a login request of a user, determining a session identifier of the user, setting a first key in a cache database based on the session identifier, storing user information in the login request as a key value of the first key, obtaining equipment information of charging equipment, wherein the equipment information comprises equipment coding information and equipment state information, setting a second key in the cache database based on the equipment coding information, storing the equipment state information as a key value of the second key, and indicating whether the charging equipment is in an on-line state or not. The embodiment of the application realizes data fusion and unified management through the cache database, improves the data processing efficiency due to the uniqueness of the session identifier, effectively avoids the data rupture of an operation end, and improves the response speed of data reading and writing.
Inventors
- SONG JIACHENG
- HU YANPING
- CHEN JIANWEI
Assignees
- 中消云(北京)物联网科技研究院有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260116
Claims (10)
- 1. A data fusion management method, comprising: responding to a login request of a user, and determining a session identifier of the user; setting a first key in a cache database based on the session identifier, and storing user information in the login request as a key value of the first key; acquiring equipment information of charging equipment, wherein the equipment information comprises equipment coding information and equipment state information; And setting a second key in the cache database based on the equipment coding information, and storing the equipment state information as a key value of the second key, wherein the equipment state information is used for indicating whether the charging equipment is in an on-line state or not.
- 2. The data fusion management method according to claim 1, wherein after setting a first key in the cache database based on the session identifier, the method comprises: Setting the validity period of the first key to a first time length; after storing the user information in the login request as the key value of the first key, the method includes: responding to a user request, and acquiring a session identifier in the user request, wherein the user request comprises a login request and a charging request; And based on the session identifier, reading the user information and/or updating the user information, and renewing the validity period of the first key corresponding to the session identifier to be the first duration.
- 3. The data fusion management method according to claim 1, wherein after setting a second key in the cache database based on the device encoding information and storing the device state information as a key value of the second key, further comprising: acquiring heartbeat data of the charging equipment, wherein the heartbeat data comprises equipment coding information; And updating the equipment state information of the second key to which the heartbeat data belongs to an on-line state based on the equipment coding information.
- 4. The data fusion management method according to claim 3, wherein after setting a second key in the cache database based on the device encoding information, comprising: Setting the validity period of the second key to be a second duration; after the heartbeat data of the charging equipment is acquired, the method further comprises the following steps: And re-renewing the validity period of the second key to which the heartbeat data belongs to the second duration based on the equipment coding information.
- 5. The data fusion management method according to claim 1, wherein after setting a first key in the cache database based on the session identifier and storing the user information in the login request as a key value of the first key, the method comprises: responding to a charging request of a user, and acquiring a session identifier in the charging request; And when the cache database is searched based on the session identifier and the user is in a login state, sending a starting instruction to charging equipment corresponding to the equipment coding information based on the equipment coding information in the charging request.
- 6. The data fusion management method according to claim 5, wherein after the session identifier in the charging request is acquired in response to the charging request of the user, further comprising: When the cache database is searched based on the session identifier and the user is in an unregistered state, acquiring user information in the charging request, wherein the user information comprises a login interface; Logging in the user based on the login interface so as to enable the user to be in a login state; And sending a starting instruction to the charging equipment corresponding to the equipment coding information based on the equipment coding information in the charging request.
- 7. The data fusion management method according to any one of claims 1 to 6, further comprising at least one of: when the offline rate of the charging equipment is detected to be larger than a first preset value, corresponding first alarm information is generated; And when the risk index of the cache database is detected to meet the alarm condition, generating corresponding second alarm information, wherein the risk index comprises at least one of hit rate, key number and expiration key number.
- 8. A data fusion management device, comprising: the determining module is used for responding to a login request of a user and determining a session identifier of the user; The first storage module is used for setting a first key in a cache database based on the session identifier and storing user information in the login request as a key value of the first key; the device comprises an acquisition module, a charging module and a control module, wherein the acquisition module is used for acquiring device information of charging equipment, and the device information comprises device coding information and device state information; the second storage module is used for setting a second key in the cache database based on the equipment coding information and storing the equipment state information as a key value of the second key, wherein the equipment state information is used for indicating whether the charging equipment is in an on-line state or not.
- 9. An electronic device comprising a memory, a processor and a computer program stored in 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 7 when the computer program is executed.
- 10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.
Description
Data fusion management method and device, electronic equipment and storage medium Technical Field The present application relates to the field of data processing technologies, and in particular, to a data fusion management method, a device, an electronic apparatus, and a storage medium. Background The existing charging operation platform often stores session identifications of terminal equipment used by users in a memory or a database, and the applet end uses tokens token and has different local storage modes. Meanwhile, the heartbeat data received by the charging equipment each time are also independently written into the database. However, in practical application, repeated login of the user can cause different session identifications to be generated by each invocation of the applet, so that the data processing efficiency is low, and the online state of the charging equipment is lagged and the data of the operation end is split due to lack of uniform state data management. Disclosure of Invention In view of the above, the embodiments of the present application provide a data fusion management method, apparatus, electronic device, and storage medium, so as to solve the problems in the prior art, such as low data processing efficiency, lag in online state of charging equipment, or data splitting at an operation end. A first aspect of an embodiment of the present application provides a data fusion management method, including: responding to a login request of a user, and determining a session identifier of the user; Setting a first key in a cache database based on the session identifier, and storing user information in a login request as a key value of the first key; Acquiring equipment information of the charging equipment, wherein the equipment information comprises equipment coding information and equipment state information; And setting a second key in the cache database based on the equipment coding information, and storing equipment state information as a key value of the second key, wherein the equipment state information is used for indicating whether the charging equipment is in an on-line state or not. In one possible implementation, after setting a first key in the cache database based on the session identifier, the method includes: setting the validity period of the first key to a first time length; after storing the user information in the login request as the key value of the first key, the method comprises the following steps: Responding to a user request, and acquiring a session identifier in the user request, wherein the user request comprises a login request and a charging request; based on the session identification, reading user information and/or updating user information, and renewing the validity period of the first key corresponding to the session identification to be the first time length. In one possible implementation, after setting a second key in the cache database based on the device encoding information and storing the device state information as a key value of the second key, the method further includes: acquiring heartbeat data of the charging equipment, wherein the heartbeat data comprises equipment coding information; and updating the device state information of the second key to which the heartbeat data belongs to an online state based on the device coding information. In one possible implementation, after setting a second key in the cache database based on the device encoding information, the method includes: setting the validity period of the second key to a second duration; after obtaining the heartbeat data of the charging device, the method further comprises: And re-renewing the validity period of the second key to which the heartbeat data belongs to a second duration based on the equipment coding information. In one possible implementation manner, after setting a first key in the cache database based on the session identifier and storing the user information in the login request as a key value of the first key, the method includes: Responding to a charging request of a user, and acquiring a session identifier in the charging request; When the user is in a login state according to the search of the cache database based on the session identification, a starting instruction is sent to charging equipment corresponding to the equipment coding information based on the equipment coding information in the charging request. In one possible implementation manner, after the session identifier in the charging request is obtained in response to the charging request of the user, the method further includes: when the user is in an unregistered state based on the session identification searching cache database, acquiring user information in a charging request, wherein the user information comprises a login interface; Logging in the user based on the login interface so as to enable the user to be in a login state; And sending a starting instruction to the charging equipment correspon