Data fusion management method and device, electronic equipment and storage medium
By setting key-value storage of session identifiers and device encoding information in the cache database, the problems of frequent user logins and lagging device online status in the charging operation platform are solved, data fusion management is realized, system performance and user experience are improved, and low-latency expansion is supported in high-concurrency scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA XIAOYUN (BEIJING) INTERNET OF THINGS TECH RES INST CO LTD
- Filing Date
- 2026-01-16
- Publication Date
- 2026-05-12
AI Technical Summary
In existing charging operation platforms, frequent user logins lead to low data processing efficiency, lagging online status of charging equipment, fragmented data on the operation side, poor scalability, and a lack of unified status data management.
By setting key-value storage for session identifiers and device encoding information in the cache database, unified management of user information and device status information is achieved. A cache database such as Redis is used to reduce access to the main database. Device status is updated in conjunction with heartbeat data, and a silent renewal mechanism is used to optimize the login process.
It improves data processing efficiency, reduces online status update latency for charging devices, avoids data fragmentation on the operational side, enhances system performance and user experience, and supports low-latency expansion in high-concurrency scenarios.
Smart Images

Figure CN122019610A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data fusion management method, apparatus, electronic device and storage medium. Background Technology
[0002] Existing charging operation platforms typically store the session identifier of the user's terminal device in memory or a database, while mini-programs use tokens, with varying local storage methods. Additionally, the heartbeat data received by the charging device each time is also written separately to the database.
[0003] However, in practical applications, repeated user logins result in different session identifiers for each mini-program call, leading to low data processing efficiency. Furthermore, the lack of unified status data management causes delays in the online status of charging devices and fragmented data on the operational side. Summary of the Invention
[0004] In view of this, embodiments of this application provide a data fusion management method, apparatus, electronic device, and storage medium to solve problems such as low data processing efficiency, delayed online status of charging equipment, or fragmented data at the operation end in the prior art.
[0005] The first aspect of this application provides a data fusion management method, including: In response to a user's login request, determine the user's session identifier; A first key is set in the cache database based on the session identifier, and the user information in the login request is stored as the key-value pair of the first key. Obtain device information for the charging equipment; device information includes device coding information and device status information. A second key is set in the cache database based on the device encoding information, and the device status information is stored as the key-value pair of the second key; the device status information is used to indicate whether the charging device is online.
[0006] In one possible implementation, after setting a first key in the cache database based on the session identifier, the following is included: Set the validity period of the first key to the first duration; After storing the user information from the login request as the key-value pair for the first key, it includes: In response to a user request, obtain the session identifier from the user request; user requests include login requests and charging requests; Based on the session identifier, read user information and / or update user information, and renew the validity period of the first key corresponding to the session identifier to the first duration.
[0007] In one possible implementation, after setting a second key in the cache database based on the device encoding information and storing the device status information as the key-value pair of the second key, the following is also included: Acquire the heartbeat data of the charging device; the heartbeat data includes device coding information; Based on the device coding information, the device status information of the second key to which the heartbeat data belongs is updated to online status.
[0008] In one possible implementation, after setting a second key in the cache database based on device encoding information, the following is included: Set the validity period of the second key to the second duration; After obtaining the heartbeat data of the charging device, the following is also included: Based on the device coding information, the validity period of the second key to which the heartbeat data belongs is renewed to the second duration.
[0009] In one possible implementation, after setting a first key in the cache database based on the session identifier and storing the user information from the login request as the key-value pair of the first key, the following steps are taken: In response to a user's charging request, obtain the session identifier from the charging request; When the user is confirmed to be logged in by looking up the cache database based on the session identifier, a start command is sent to the charging device corresponding to the device code information based on the device code information in the charging request.
[0010] In one possible implementation, after obtaining the session identifier from the user's charging request, the process further includes: When it is determined from the cache database based on the session identifier that the user is not logged in, the user information in the charging request is retrieved; the user information includes the login interface. Based on the login interface, users are logged in to ensure they are in a logged-in state. Based on the device coding information in the charging request, a start command is sent to the charging device corresponding to the device coding information.
[0011] In one possible implementation, the data fusion management method also includes at least one of the following: When the offline rate of the charging device is detected to be greater than a first preset value, a corresponding first alarm message is generated; When the risk indicators of the cache database meet the alarm conditions, a corresponding second alarm message is generated; the risk indicators include at least one of the following: hit rate, number of keys, and number of expired keys.
[0012] A second aspect of this application provides a data fusion management device, comprising: The determination module is used to determine the user's session identifier in response to the user's login request; The first storage module is used to set a first key in the cache database based on the session identifier, and store the user information in the login request as the key-value pair of the first key; The acquisition module is used to acquire device information of the charging device; the device information includes device coding information and device status information. The second storage module is used to set a second key in the cache database based on the device encoding information, and to store the device status information as the key value of the second key; the device status information is used to indicate whether the charging device is online.
[0013] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method of the first aspect.
[0014] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the first aspect.
[0015] Compared with the prior art, the embodiments of this application have at least the following technical effects: The data fusion management method of the first aspect of this application can respond to a user's login request, determine the user's session identifier, and then set a first key in a cache database based on the session identifier, storing the user information in the login request as the key-value pair of the first key. This application embodiment sets a first key with a unique session identifier corresponding to the user, and stores the corresponding user information as the key-value pair in the cache database. Since the cache database can reduce direct access to the main database, it improves the overall system performance, and the uniqueness of the session identifier also improves data processing efficiency.
[0016] Simultaneously, this embodiment can also obtain device information of the charging device; then, based on the device encoding information, a second key is set in the cache database, and the device status information is stored as the key value of the second key. Since the device status information is used to indicate whether the charging device is online, this embodiment can improve the speed of heartbeat data updating the online status of the charging device by setting the second key value in the cache database.
[0017] Furthermore, this application embodiment sets a first key based on the session identifier and a second key based on the device encoding information, and stores both user information and device status information in the cache database, thereby realizing data fusion and unified management, effectively avoiding data fragmentation on the operation side, and improving the response speed of data reading and writing.
[0018] It is understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of a data fusion management method provided in an embodiment of this application; Figure 2 This is a flowchart of another data fusion management method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of a data fusion management device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0022] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0023] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0024] In the description of this application, unless otherwise stated, the " / " used in this specification and appended claims indicates that the related objects are in an "or" relationship. For example, A / B can mean A or B. The "and / or" in this application merely describes the relationship between the related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a, b, and c. Here, a, b, and c can be single or multiple.
[0025] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0026] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0027] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0028] Research has revealed the following technical problems with existing charging operation platforms: (1) Frequent logins: When accessing across terminals or when a session expires, the user needs to grant authorization again.
[0029] (2) Heartbeat lag: The device's heartbeat write to the database causes a large reading delay, resulting in untimely offline warnings.
[0030] (3) Data fragmentation: User status and device status exist in different systems, making it difficult to perform linked analysis.
[0031] (4) Poor scalability: The database is under great pressure under high concurrency and cannot be expanded quickly.
[0032] (5) Lack of security coordination: Different media storage makes it difficult to uniformly implement access control and auditing.
[0033] The data fusion management method, apparatus, electronic device, and storage medium provided in this application are intended to solve the above-mentioned technical problems of the prior art.
[0034] The technical solution of this application and how it solves the above-mentioned technical problems are described in detail below with specific embodiments. It should be noted that the following embodiments can be referenced, borrowed, or combined with each other, and the same terms, similar features, and similar implementation steps in different embodiments will not be described again.
[0035] See Figure 1 As shown, this application provides a flowchart of a data fusion management method. Figure 1 As shown, the data fusion management method includes steps S101 to S104.
[0036] S101. In response to the user's login request, determine the user's session identifier.
[0037] Optionally, the user's login request can be made by logging in via a mini-program on a terminal device (e.g., a smartphone) or by scanning a QR code on a charging device.
[0038] Optionally, the server generates a session identifier for each logged-in user, which is used to identify user information across requests.
[0039] S102. Set a first key in the cache database based on the session identifier, and store the user information in the login request as the key-value pair of the first key.
[0040] A caching database is a technique that stores frequently accessed data in high-speed storage media (such as memory) to reduce direct access to the main database, thereby improving overall system performance. The caching database used is Redis.
[0041] In this embodiment of the application, the corresponding user information can be found through the session identifier for reading or updating / writing operations.
[0042] In some embodiments, after setting a first key in the cache database based on the session identifier and storing the user information in the login request as the key-value pair of the first key in step S102, the process includes: In response to a user's charging request, obtain the session identifier from the charging request; When the user is confirmed to be logged in by looking up the cache database based on the session identifier, a start command is sent to the charging device corresponding to the device code information based on the device code information in the charging request.
[0043] Optionally, the device coding information includes the charging cabinet code and the socket code, thus making the device coding information unique. The activation command is used to activate the socket code corresponding to the device coding information.
[0044] This application embodiment can send a start command to the corresponding charging device when a user's charging request is received.
[0045] In some embodiments, after obtaining the session identifier in the charging request in response to the user's charging request, the method further includes: When it is determined from the cache database based on the session identifier that the user is not logged in, the user information in the charging request is retrieved; the user information includes the login interface. Based on the login interface, users are logged in to ensure they are in a logged-in state.
[0046] Based on the device coding information in the charging request, a start command is sent to the charging device corresponding to the device coding information.
[0047] This application embodiment enables silent session renewal for mini-programs. By encapsulating the charging request and carrying the session identifier JSESSIONID by default, if the response indicates that the user is not logged in, the login interface is automatically called to obtain new login confirmation information, forming a new session identifier and retrying the charging request, thus achieving seamless session renewal. Therefore, the background of this application embodiment can achieve silent login, that is, the mini-program automatically calls the WeChat authorization interface to update the login status after detecting session expiration.
[0048] Furthermore, in this embodiment, users are not required to log in to the mini-program repeatedly. The background can perform default login, which reduces the repeated login rate, improves the login success rate and satisfaction, and enhances the user experience.
[0049] S103. Obtain device information of the charging device; device information includes device coding information and device status information.
[0050] Optionally, the device information of the charging device can be obtained from the user's charging request or the charging device's first heartbeat data or other means.
[0051] The device information may also include charging information, which includes charging status and charging amount, among other charging-related information.
[0052] S104. Based on the device encoding information, set a second key in the cache database and store the device status information as the key value of the second key; the device status information is used to indicate whether the charging device is online.
[0053] Optionally, device status information can be used to determine if the charging device is online upon receiving heartbeat data.
[0054] The data fusion management method of this application embodiment can respond to a user's login request, determine the user's session identifier, and then set a first key in the cache database based on the session identifier, storing the user information in the login request as the key-value pair of the first key. This application embodiment sets a first key with a unique session identifier corresponding to the user, and stores the corresponding user information as the key-value pair in the cache database. Since the cache database can reduce direct access to the main database, it improves the overall system performance, and the uniqueness of the session identifier also improves data processing efficiency.
[0055] Meanwhile, the data fusion management method of this application embodiment can also obtain device information of the charging device; then, based on the device encoding information, a second key is set in the cache database, and the device status information is stored as the key value of the second key. Since the device status information is used to indicate whether the charging device is online, this application embodiment can improve the speed of heartbeat data updating the online status of the charging device by setting the second key value in the cache database.
[0056] Furthermore, the data fusion management method of this application embodiment can set a first key based on the session identifier and a second key based on the device encoding information, and store user information and device status information in the cache database accordingly, thereby realizing data fusion and unified management, effectively avoiding data fragmentation on the operation side, and improving the response speed of data reading and writing.
[0057] Furthermore, the data fusion in this application embodiment can perform linked statistics such as "online users corresponding to online devices," providing a basis for operational strategies. Moreover, the cache database is easy to expand, supports horizontal scaling, and can maintain low latency even in high-concurrency scenarios, achieving a better balance between functionality, performance, and cost.
[0058] In some embodiments, after setting a first key in the cache database based on the session identifier, the process includes: Set the validity period of the first key to the first duration; After storing the user information from the login request as the key-value pair for the first key, it includes: In response to a user request, obtain the session identifier from the user request; user requests include login requests and charging requests; Based on the session identifier, read user information and / or update user information, and renew the validity period of the first key corresponding to the session identifier to the first duration.
[0059] Optionally, Redis key-value pairs have a time-to-live (TTL) expiration period, after which they automatically expire. The Redis utility layer can provide unified encapsulation for string, hash, batch deletion, and expiration settings, hiding the serialization details.
[0060] In practical applications, the following login write and backfill process is adopted in the embodiments of this application: After the user logs in successfully, the session identifier is stored in Redis with JSESSIONID as the key, a 5-hour TTL is set, the key is read in each request, and the expiration is renewed at the same time.
[0061] In some embodiments, after setting a second key in the cache database based on device encoding information and storing device status information as the key-value pair of the second key, the method further includes: Acquire the heartbeat data of the charging device; the heartbeat data includes device coding information; Based on the device coding information, the device status information of the second key to which the heartbeat data belongs is updated to online status.
[0062] Optionally, the heartbeat data is online status information periodically reported by the charging device, and the heartbeat data includes device information.
[0063] In some embodiments, after setting a second key in the cache database based on 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 following is also included: Based on the device coding information, the validity period of the second key to which the heartbeat data belongs is renewed to the second duration.
[0064] Optionally, the second duration can be set to 10 minutes.
[0065] See Figure 2 As shown, this application provides a flowchart of another data fusion management method. Figure 2 As shown, the data fusion management method includes steps S201 to S209.
[0066] S201. In response to the user's login request, determine the user's session identifier.
[0067] S202. Based on the session identifier, set a first key in the cache database, set the validity period of the first key to the first duration, and store the user information in the login request as the key-value pair of the first key.
[0068] Steps S201 to S202 in this embodiment are in the same principle as steps S101 to S102 in this embodiment, and will not be repeated here.
[0069] S203. In response to a user request, obtain the session identifier from the user request; the user request includes a login request and a charging request.
[0070] S204. Based on the session identifier, read user information and / or update user information, and renew the validity period of the first key corresponding to the session identifier to the first duration.
[0071] S205. Obtain device information for the charging equipment; device information includes device coding information and device status information.
[0072] S206. Based on the device encoding information, set a second key in the cache database, set the validity period of the second key to a second duration, and store the device status information as the key value of the second key; the device status information is used to indicate whether the charging device is online.
[0073] Steps S205 to S206 in this embodiment are in the same principle as steps S103 to S104 in this embodiment, and will not be repeated here.
[0074] S207. Obtain the heartbeat data of the charging device; the heartbeat data includes device coding information.
[0075] S208. Based on the device coding information, update the device status information of the second key to which the heartbeat data belongs to the online status; S209. Based on the device coding information, renew the validity period of the second key to which the heartbeat data belongs to the second duration.
[0076] Optionally, steps S208 and S209 can be executed in any order.
[0077] In some embodiments, the data fusion management method further includes at least one of the following: When the offline rate of the charging device is detected to be greater than a first preset value, a corresponding first alarm message is generated; When the risk indicators of the cache database meet the alarm conditions, a corresponding second alarm message is generated; the risk indicators include at least one of the following: hit rate, number of keys, and number of expired keys.
[0078] The embodiments of this application can provide timely warnings when the offline rate of charging devices is high and when the cache database is abnormal, thereby reducing the heartbeat delay to the second level and enabling offline devices to quickly issue alarms.
[0079] Furthermore, this application embodiment can provide logically isolated data storage for different operators on the same platform, allocate tenant space through key prefixes or independent databases, and ensure data security by combining ACL (Access Control List) and TLS (Transmission Encryption). This application embodiment also has an expansion mechanism to support master-slave, sentinel, or cluster deployments, and hot data can be further accelerated using local caching or distributed replicas.
[0080] In summary, the data fusion management method of this application is a multi-terminal session sharing and device heartbeat fusion management method based on Redis, and its main technical solutions include: (1) JSESSIONID sharing and automatic renewal strategy to solve the cross-terminal login problem between mini-program and backend.
[0081] (2) Heartbeat data and session identifiers are managed in the same database to achieve real-time linkage between device status and user status.
[0082] (3) Silent re-login mechanism to improve user experience and maintain security control.
[0083] (4) Unify the tool layer and monitoring system to ensure the observability and controllability of operation and maintenance.
[0084] Based on the above technical solution, the embodiments of this application can achieve at least the following technical effects: (1) Build a unified state center to realize session sharing and renewal between mini-programs and web backends.
[0085] (2) Establish a low-latency device heartbeat management mechanism to provide real-time online monitoring capabilities.
[0086] (3) Integrate session identifiers and heartbeat data in Redis to support cross-terminal and cross-business collaboration.
[0087] (4) Provide an easily scalable and maintainable distributed deployment solution to reduce operation and maintenance costs.
[0088] Furthermore, the embodiments of this application verify the data fusion management method in practical applications, and the following conclusions are drawn: (1) Joint debugging test: verify the processes of login, renewal, silent login, logout, heartbeat data writing and query.
[0089] (2) Stress test: Simulate 50,000 active users and 30,000 devices operating simultaneously, with memory usage within a controllable range.
[0090] (3) Pilot operation: After the deployment of 500 cabinets in the park, the repeated login rate was reduced to 4%, and the offline detection time of charging equipment was shortened from 6 minutes to 30 seconds.
[0091] See Figure 3 As shown in the diagram, this application provides a schematic diagram of the structure of a data fusion management device 30. Figure 3 As shown, the data fusion management device 30 includes: a determination module 301, a first storage module 302, an acquisition module 303, and a second storage module 304.
[0092] The determination module 301 is used to determine the user's session identifier in response to the user's login request.
[0093] The first storage module 302 is used to set a first key in the cache database based on the session identifier, and store the user information in the login request as the key-value pair of the first key.
[0094] The acquisition module 303 is used to acquire device information of the charging device; the device information includes device coding information and device status information.
[0095] The second storage module 304 is used to set a second key in the cache database based on the device encoding information, and to store the device status information as the key value of the second key; the device status information is used to indicate whether the charging device is online.
[0096] By applying the embodiments of this application, at least the following beneficial effects can be achieved: The data fusion management device 30 of this application embodiment can respond to a user's login request, determine the user's session identifier, and then set a first key in the cache database based on the session identifier, storing the user information in the login request as the key-value pair of the first key. This application embodiment sets a first key with a unique session identifier corresponding to the user, and stores the corresponding user information as the key-value pair in the cache database. Since the cache database can reduce direct access to the main database, it improves the overall system performance, and the uniqueness of the session identifier also improves data processing efficiency.
[0097] Meanwhile, the data fusion management device 30 of this embodiment can also acquire device information of the charging device; then, based on the device encoding information, it sets a second key in the cache database and stores the device status information as the key value of the second key. Since the device status information is used to indicate whether the charging device is online, this embodiment of the application can improve the speed of heartbeat data updating the online status of the charging device by setting the second key value in the cache database.
[0098] Furthermore, the data fusion management device 30 in this application embodiment can set a first key based on the session identifier and a second key based on the device encoding information, and store user information and device status information in the cache database accordingly, thereby realizing data fusion and unified management, effectively avoiding data fragmentation at the operation end, and improving the response speed of data reading and writing.
[0099] Optionally, the first storage module 302 is used to set the validity period of the first key to a first duration; The determining module 301 is configured to: in response to a user request, obtain a session identifier from the user request; the user request includes a login request and a charging request; The first storage module 302 is used to read user information and / or update user information based on the session identifier, and renew the validity period of the first key corresponding to the session identifier to the first duration.
[0100] Optionally, the acquisition module 303 is used to acquire the heartbeat data of the charging device; the heartbeat data includes device coding information; The second storage module 304 is used to update the device status information of the second key to which the heartbeat data belongs to the online status based on the device encoding information.
[0101] Optionally, the second storage module 304 is used to set the validity period of the second key to a second duration; and based on the device encoding information, to renew the validity period of the second key to which the heartbeat data belongs to the second duration.
[0102] Optionally, the determining module 301 is used to obtain the session identifier in the charging request in response to the user's charging request. The data fusion management device 30 also includes a sending module; the sending module is used to send a start command to the charging device corresponding to the device code information based on the device code information in the charging request when it is determined from the cache database based on the session identifier that the user is logged in.
[0103] Optionally, the data fusion management device 30 further includes a login module; the login module is used to obtain user information from the charging request when it is determined from the cache database based on the session identifier that the user is not logged in; the user information includes a login interface; based on the login interface, the user is logged in so that the user is in a logged-in state; correspondingly, the sending module is used to send a start command to the charging device corresponding to the device code information based on the device code information in the charging request.
[0104] Optionally, the data fusion management device 30 further includes an alarm module, which is used to implement at least one of the following: When the offline rate of the charging device is detected to be greater than a first preset value, a corresponding first alarm message is generated; When the risk indicators of the cache database meet the alarm conditions, a corresponding second alarm message is generated; the risk indicators include at least one of the following: hit rate, number of keys, and number of expired keys.
[0105] In applications, the modules in the data fusion management device 30 can be software program modules, or they can be implemented through different logic circuits integrated in the processor, or they can be implemented through multiple distributed processors.
[0106] The data fusion management device 30 of this application embodiment can execute the method provided in this application embodiment. The implementation principle is similar. The actions performed by each module in the data fusion management device 30 of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the data fusion management device 30, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0107] See Figure 4 As shown, this application provides a schematic diagram of the structure of an electronic device 40. Figure 4 As shown, the electronic device 40 of this application embodiment includes: a memory 42, a processor 41, and a computer program 43 stored in the memory 42 and executable on the processor 41. When the processor 41 executes the computer program, it implements the steps of the methods of the various embodiments of this application.
[0108] Electronic device 40 can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. Electronic device 40 may include, but is not limited to, a processor 41 and a memory 42. Those skilled in the art will understand that electronic device 40 may also include more or fewer components, or combinations of certain components, or different components, such as input / output devices, network access devices, etc.
[0109] The processor 41 can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0110] In some embodiments, memory 42 may be an internal storage unit, such as a hard disk or RAM. Memory 42 may be a removable / non-removable, volatile / non-volatile computer system storage medium; for example, memory 42 may be a non-volatile memory used for reading and writing non-volatile magnetic media. In other embodiments, memory 42 may be an external storage device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., provided on electronic device 40. Memory 42 is used to store operating systems, applications, bootloaders, data, and other programs, such as program code for computer programs. Memory 42 may also be used to temporarily store data that has been output or will be output.
[0111] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0112] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0113] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the above-described method embodiments.
[0114] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / terminal equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0115] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc. The storage medium can also include combinations of the above types of memory.
[0116] This application provides a computer program product that, when run on a processor, enables the processor to execute the steps described in the various method embodiments above.
[0117] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0118] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0119] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0120] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0121] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A data fusion management method, characterized in that, include: In response to a user's login request, determine the user's session identifier; Based on the session identifier, a first key is set in the cache database, and the user information in the login request is stored as the key-value pair of the first key; Obtain device information for the charging device; the device information includes device coding information and device status information. Based on the device encoding information, a second key is set in the cache database, and the device status information is stored as the key value of the second key; The device status information is used to indicate whether the charging device is online.
2. The data fusion management method according to claim 1, characterized in that, After setting a first key in the cache database based on the session identifier, the process includes: Set the validity period of the first key to the first duration; After storing the user information in the login request as the key-value pair of the first key, the process includes: In response to a user request, obtain the session identifier from the user request; the user request includes a login request and a charging request; Based on the session identifier, read the user information and / or update the user information, and renew the validity period of the first key corresponding to the session identifier to the first duration.
3. The data fusion management method according to claim 1, characterized in that, After setting a second key in the cache database based on the device encoding information and storing the device status information as the key-value pair of the second key, the method further includes: Acquire the heartbeat data of the charging device; the heartbeat data includes device coding information; Based on the device encoding information, the device status information of the second key to which the heartbeat data belongs is updated to online status.
4. The data fusion management method according to claim 3, characterized in that, After setting a second key in the cache database based on the device encoding information, the process includes: Set the validity period of the second key to the second duration; After acquiring the heartbeat data of the charging device, the method further includes: Based on the device encoding information, the validity period of the second key to which the heartbeat data belongs is renewed to the second duration.
5. The data fusion management method according to claim 1, characterized in that, The step of setting a first key in the cache database based on the session identifier and storing the user information in the login request as the key-value pair of the first key includes: In response to a user's charging request, obtain the session identifier from the charging request; When the user is found to be logged in by searching the cache database based on the session identifier, a start command is sent to the charging device corresponding to the device code information based on the device code information in the charging request.
6. The data fusion management method according to claim 5, characterized in that, After obtaining the session identifier from the user's charging request, the process of responding to the user's charging request further includes: When the user is determined to be in an unlogged-in state by searching the cache database based on the session identifier, the user information in the charging request is obtained; the user information includes the login interface. Based on the login interface, the user is logged in so that the user is in a logged-in state; Based on the device coding information in the charging request, a start command is sent to the charging device corresponding to the device coding information.
7. The data fusion management method according to any one of claims 1-6, characterized in that, It also includes at least one of the following: When the offline rate of the charging device is detected to be greater than a first preset value, a corresponding first alarm message is generated; When the risk indicators of the cache database are detected to meet the alarm conditions, a corresponding second alarm message is generated; the risk indicators include at least one of hit rate, number of keys, and number of expired keys.
8. A data fusion management device, characterized in that, include: The determination module is used to determine the user's session identifier in response to the user's login request; The first storage module is used to set a first key in the cache database based on the session identifier, and store the user information in the login request as the key value of the first key; The acquisition module is used to acquire device information of the charging device; the device information includes device coding information and device status information. The second storage module is used to set a second key in the cache database based on the device encoding information, and store the device status information as the key value of the second key; The device status information is used to indicate whether the charging device is online.
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, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.