Multi-dimensional state data processing method and device, computer device and storage medium

By identifying changes in multi-dimensional state data through data consumption services and storing them in a Redis database, the problems of storage pressure and slow query speed are solved, and efficient multi-dimensional state data processing is achieved.

CN116842050BActive Publication Date: 2026-02-06CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310742245.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2026-02-06
Estimated Expiration
2043-06-20

AI Technical Summary

Technical Problem

Existing technologies suffer from high storage pressure and slow query speed when processing large amounts of multi-dimensional state data, which affects computational efficiency.

Method used

The system acquires multi-dimensional state data through data consumption services, identifies state change points, generates state change records, stores them in a Redis database, and receives query commands to perform queries.

Benefits of technology

It reduces storage pressure, improves query speed, and enhances the processing efficiency of multi-dimensional state data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116842050B_ABST
    Figure CN116842050B_ABST
Patent Text Reader

Abstract

The embodiment of the application belongs to the field of big data and financial technology, and relates to a multi-dimensional state data processing method and device, computer equipment and a storage medium. The method comprises the following steps: obtaining multi-dimensional state data of a target object through a data consumption service; for each dimension, determining a state change point in the state data of the dimension through the data consumption service, and generating a state change record according to the recognized state change point; storing the state change records of each dimension into a redis database; receiving a query instruction for the target object, and querying the state change records in the redis database according to the query instruction to obtain a state query result. In addition, the application also relates to blockchain technology, and the state change records can be stored in the blockchain. The application reduces the storage pressure caused by multi-dimensional state data and improves the corresponding data processing speed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of big data and financial technology, and particularly relates to a multi-dimensional state data processing method and device, computer equipment and a storage medium. BACKGROUND

[0002] Due to the complexity of business, the ongoing business will generate multi-dimensional state data. For example, in some specific business activities, the online and offline time of a ride-hailing driver needs to be collected and monitored to reward the driver for the time length; the position of the driver needs to be collected and monitored to determine whether the driver is within the preset fence area; the activity mode of the driver needs to be collected and monitored. These state data need to be stored, calculated and processed.

[0003] In the past, an ES database (Elasticsearch, abbreviated as ES, is a distributed search and analysis engine located at the core of Elastic Stack) is usually used to store and query multi-dimensional state data in real time. When the number of detected objects is large, a large amount of state data will be generated, increasing the storage pressure; and the asynchronous query mechanism of ES will cause the query speed of state data to slow down, affecting the calculation and processing of state data. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a multi-dimensional state data processing method, device, computer equipment and storage medium to solve the storage and query calculation pressure caused by a large amount of multi-dimensional state data.

[0005] In order to solve the above technical problems, the embodiments of the present application provide a multi-dimensional state data processing method, which adopts the technical scheme as follows:

[0006] The data consumption service is used to obtain the multi-dimensional state data of the target object;

[0007] For each dimension, the data consumption service is used to determine the state change point in the state data of the dimension, and generate a state change record according to the identified state change point;

[0008] The state change records of each dimension are stored in a redis database;

[0009] The query instruction for the target object is received, and the state change records in the redis database are queried according to the query instruction to obtain a state query result.

[0010] In order to solve the above technical problems, the embodiments of the present application also provide a multi-dimensional state data processing device, which adopts the technical scheme as follows:

[0011] The data acquisition module is configured to acquire multi-dimension state data of the target object through a data consumption service.

[0012] The record generation module is configured to determine a state change point in the state data of each dimension through the data consumption service, and generate a state change record according to the identified state change point.

[0013] The record storage module is configured to store the state change records of the dimensions into a redis database.

[0014] The record query module is configured to receive a query instruction for the target object, and query the state change records in the redis database according to the query instruction to obtain a state query result.

[0015] To solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the technical scheme as follows:

[0016] The data acquisition module is configured to acquire multi-dimension state data of the target object through a data consumption service.

[0017] The record generation module is configured to determine a state change point in the state data of each dimension through the data consumption service, and generate a state change record according to the identified state change point.

[0018] The record storage module is configured to store the state change records of the dimensions into a redis database.

[0019] The record query module is configured to receive a query instruction for the target object, and query the state change records in the redis database according to the query instruction to obtain a state query result.

[0020] To solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the technical scheme as follows:

[0021] The data acquisition module is configured to acquire multi-dimension state data of the target object through a data consumption service.

[0022] The record generation module is configured to determine a state change point in the state data of each dimension through the data consumption service, and generate a state change record according to the identified state change point.

[0023] The record storage module is configured to store the state change records of the dimensions into a redis database.

[0024] The record query module is configured to receive a query instruction for the target object, and query the state change records in the redis database according to the query instruction to obtain a state query result.

[0025] Compared with the prior art, the embodiments of the application have the following beneficial effects: the multi-dimensional state data of the target object is obtained through the data consumption service; for each dimension, a state change point in the state data of the dimension is determined, the state change point is a time point at which the target object has a state change in the dimension, and is a relatively key time point; a state change record is generated according to the identified state change point, and the state change records of the dimensions are stored in the redis database, only the key data in the multi-dimensional state data is saved, and the storage pressure is reduced; a query instruction for the target object is received, the state change records in the redis database are queried according to the query instruction, a state query result is obtained, and the state distribution of the target object in a certain dimension is obtained, the query and processing based on the redis improve the query speed, and thus the processing speed of the multi-dimensional state data is improved. BRIEF DESCRIPTION OF DRAWINGS

[0026] In order to more clearly illustrate the scheme in the application, the drawings needed in the description of the embodiments of the application will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0027] Figure 1 is an exemplary system architecture diagram to which the application can be applied;

[0028] Figure 2 is a flowchart of one embodiment of the multi-dimensional state data processing method according to the application;

[0029] Figure 3 is a structural schematic diagram of one embodiment of the multi-dimensional state data processing device according to the application;

[0030] Figure 4 is a structural schematic diagram of one embodiment of the computer device according to the application. DETAILED DESCRIPTION

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the application belongs; the terms used in the specification of the application are only for the purpose of describing specific embodiments and are not intended to limit the application; the terms "include" and "have" and any variations thereof in the specification and claims of the application and the above description of drawings are intended to cover non-exclusive inclusion. The terms "first", "second" and the like in the specification and claims of the application or the above description of drawings are used to distinguish different objects, not to describe a particular order.

[0032] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase that an "embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive or alternative embodiments. It is expressly understood that the embodiments described herein are merely example and that a person skilled in the art would readily recognize items described herein in connection with one embodiment can be incorporated into other embodiments.

[0033] For those skilled in the art to better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings.

[0034] As shown in Figure 1 The system architecture 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0035] A user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0036] The terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smartphones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.

[0037] The server 105 can be a server providing various services, such as a background server supporting the pages displayed on the terminal devices 101, 102, 103.

[0038] It should be noted that the multi-dimensional state data processing method provided by the embodiments of the present application is generally executed by a server, and correspondingly, the multi-dimensional state data processing apparatus is generally arranged in the server.

[0039] It should be understood that Figure 1The number of terminal devices, networks and servers in the system is merely illustrative. Any number of terminal devices, networks and servers can be provided according to implementation needs.

[0040] With reference to the accompanying drawings still, Figure 2 , a flow chart of one embodiment of the multi-dimensional state data processing method according to the present application is shown. The multi-dimensional state data processing method includes the following steps:

[0041] In step S201, multi-dimensional state data of a target object is obtained through a data consumption service.

[0042] In this embodiment, the electronic device (for example, the server shown in Figure 1 The server can communicate with the terminal device through a wired connection or a wireless connection. It should be noted that the wireless connection can include, but is not limited to, 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other now known or future developed wireless connection methods.

[0043] Specifically, the data consumption service is a service for processing data, and the multi-dimensional state data of the target object can be obtained through the data consumption service. The target object is an object that needs to be monitored in a business activity, such as some commercial activities, and the target object has dimensions to be monitored, and each dimension has state data. For example, in the online car-hailing business, the target object can be a driver, and the driver's online and offline time, the driver's driving vehicle location, and the driver's activity mode can be dimensions for monitoring and evaluating the driver.

[0044] Further, the above step S201 can include accessing each message queue through the data consumption service, wherein the data consumption service is built based on a spring service, and the message queue corresponds to a state dimension one by one; obtaining state data of the target object from each message queue, and obtaining the multi-dimensional state data based on the obtained state data.

[0045] Specifically, a plurality of message queues are provided in the present application, and the message queue corresponds to a state dimension one by one, that is, each message queue stores state data under a dimension. For example, the location queue locate_MQ stores location information, the online / offline queue online / offline_MQ stores online and offline time, and the listen_type queue listen_type_MQ stores the driver's listening mode.

[0046] The data consumption service is built based on a spring service, and the spring service can run on multiple nodes. The spring service can consume the messages in the message queue, obtain the state data of the target object from each message queue, and based on the obtained state data, the multi-dimensional state data of the target object can be composed.

[0047] In this embodiment, the data consumption service accesses each message queue, the data consumption service is built based on a spring service, and the spring service can run on multiple nodes, thereby improving the data processing efficiency. The message queue corresponds to the state dimension one by one, so that the state data of each dimension of the target object is obtained from each message queue, and the multi-dimensional state data is obtained.

[0048] In step S202, for each dimension, the data consumption service determines the state change point in the state data of the dimension, and generates a state change record according to the identified state change point.

[0049] Specifically, the state data under each dimension can include multiple time points, and each time point has a state. For example, in the online and offline dimension of the driver, the state of each time point is that the driver is online or offline.

[0050] Since the target object has more than one state in each dimension, the target object can have a state change in a certain dimension. The state change point refers to the time point at which the state changes compared to the previous time point. For example, the online and offline state of the driver is online before time point 101062, and becomes offline at the next adjacent time point 101063, so the state change occurs at time point 101063. Time point 101063 is recorded as a state change point in the online and offline dimension. It can be understood that there can be multiple state change points in a certain dimension, or there can be only one, or there can be none.

[0051] According to the identified state change point, a state change record is generated. The state change record includes the timestamp of the state change point and the state code, wherein the state code is used to identify the state. For example, in the online and offline dimension, state code 1 indicates that the driver is online, and state code 0 indicates that the driver is offline.

[0052] In step S203, the state change records of each dimension are stored in the redis database.

[0053] Specifically, the state change point in the state change record is a key point in each time point. In order to save storage space, the application can only store the state change record of the target object in each dimension in the redis database, instead of storing the multi-dimensional state data in full.

[0054] Redis(Remote Dictionary Server), which is a remote dictionary service, is an open source Key-Value database written in ANSI C language, supporting network, being based on memory or being persistent, and providing APIs in multiple languages, and has high performance.

[0055] In step S204, a query instruction for the target object is received, and a state change record in the redis database is queried according to the query instruction to obtain a state query result.

[0056] Specifically, the application is provided with a query service query_service, and a user (for example, a business personnel) can initiate a query instruction for the target object through the query service to obtain a state distribution of the target object in each dimension.

[0057] The data consumption service queries the state change record in the redis database according to the query instruction, can query the state change record of the target object in the specified dimension, and generates a state query result. Since redis is based on cache, the state change record in each dimension is stored in the redis database, and the redis database is queried, so that the query speed is improved, and the processing speed and efficiency of the multi-dimensional state data are improved.

[0058] In the embodiment, the multi-dimensional state data of the target object is obtained through the data consumption service; for each dimension, a state change point in the state data of the dimension is determined, the state change point is a time point at which the state of the target object changes in the dimension, and is a relatively key time point; a state change record is generated according to the recognized state change point, and the state change record of each dimension is stored in the redis database, only the key data in the multi-dimensional state data is saved, and the storage pressure is reduced; a query instruction for the target object is received, a state change record in the redis database is queried according to the query instruction, and a state query result is obtained, so that the state distribution of the target object in a certain dimension is obtained, the query and processing based on redis are improved, the query speed is improved, and the processing speed of the multi-dimensional state data is improved.

[0059] Further, the above step S202 can include: for each dimension, obtaining a state evaluation standard corresponding to the dimension; determining the state of each time point in the state data of the dimension through the data consumption service according to the state evaluation standard; determining a time point at which a state change occurs in each time point according to the state of each time point; determining the time point at which the state change occurs as a state change point, and generating a state change record according to the determined state change point, the state change record containing a timestamp of the state change point and a state code.

[0060] Specifically, for each dimension, a state evaluation criterion corresponding to the dimension is obtained, and the state evaluation criterion is used for state determination on the original state data. For example, in the state data under the location dimension, the location information of the vehicle is recorded at each time point, and the state evaluation criterion under the location dimension is the fence coordinates. If the location information is within the fence, the location state is valid / inside the circle, otherwise the location state is invalid / outside the circle.

[0061] According to the state evaluation criterion, the state of each time point in the state data is determined by the data consumption service; then according to the state of each time point, the time point at which the state change occurs is determined in each time point, the time point at which the state change occurs is determined as the state change point, and the state change record is generated according to each state change point, the state change record contains the timestamp of the state change point and the state code, and the timestamp is used to represent the state change point.

[0062] In this embodiment, for each dimension, the corresponding state evaluation criterion is obtained; according to the state evaluation criterion, the data of each time point in the state data is parsed and converted to obtain a simple and readable state of each time point; according to the state of each time point, the time point at which the state change occurs is determined in each time point to obtain the state change point, and the state change record is generated according to the state change point, the state change record contains the timestamp of the state change point and the state code, so as to filter and record the key information in the state data.

[0063] Further, the step of querying the state change record in the redis database according to the query instruction to obtain the state query result can include: querying the redis database according to the object identifier, at least one target dimension and time information in the query instruction to obtain the state change record of each target dimension; merging and calculating the state change record of each target dimension to obtain the overall state record, and generating the query result according to the overall state record.

[0064] Specifically, the redis database is a Key-Value database, and the key of the state change record stored therein is in the form of object identifier_dimension_date, and the value is in the form of timestamp_state code.

[0065] The query instruction has an object identifier, at least one target dimension and time information (represented by date), so that the state change record of the target object under the target dimension on the target date can be queried from the redis database according to the query instruction.

[0066] In addition to querying the state change records stored in the redis database, the user can also perform a combined calculation on the state change records of each target dimension to obtain an overall state record. The overall state record refers to the state of the target object when multiple target dimensions are considered. For example, when the user needs to determine the state of a driver according to the online and offline dimensions and the location dimension, the state of the driver is valid only when the driver is online and located within the fence area. In this case, the query instruction needs to be configured so that the state change records of the driver in the online and offline dimensions and the location dimension are queried first, and then the state change records of the online and offline dimensions and the location dimension are combined and calculated to obtain an overall state record. Finally, the query result is generated according to the overall state record.

[0067] In this embodiment, the redis database is queried according to the query instruction to obtain the state change records of each target dimension. The state change records of each target dimension are combined and calculated to obtain an overall state record, and the query result is generated according to the overall state record, thereby achieving state processing of the target object from multiple dimensions.

[0068] Further, the step of combining and calculating the state change records of each target dimension to obtain an overall state record can include assigning a traversal pointer to each state change record of each target dimension, simultaneously traversing the state change records of each target dimension through the traversal pointers, and generating an overall state record according to the state codes traversed by the traversal pointers.

[0069] Specifically, a traversal pointer is assigned to each state change record of each target dimension, and the pointer is used to read the state change records of each target dimension.

[0070] The state change records of each target dimension are simultaneously traversed through the traversal pointers. When each pointer traverses a state code, it is determined whether the current state of the target object is valid according to the state code (whether the state is valid is determined by the state code, which belongs to the business category and can be flexibly configured. For example, in the online and offline dimension, the state of the driver is valid when the driver is online, and the state code is recorded as 1; otherwise, it is recorded as 0. In the location dimension, the state of the driver is valid when the driver is located within the fence area, and the state code is recorded as 1; otherwise, it is recorded as 0. In the order listening dimension, the state of the driver is valid when the driver is in real-time order mode, and the state code is recorded as 1; otherwise, it is recorded as 0).

[0071] The traversal pointer traverses the state change record, which can be understood as regarding the state change record as a line segment, some sub-segments of the line segment being valid and some sub-segments being invalid. The traversal pointer moves on the line segment to determine whether the state at the current position is valid.

[0072] The overall state record is generated according to the state codes traversed by the traversal pointers. Generally, when the state codes of each target dimension indicate validity, the overall state is valid; otherwise, the overall state is invalid; that is, the unified state code is 0 or 1, and the states of each target dimension are combined into one dimension for calculation to obtain the overall state record. It should be noted that the state codes used to determine the overall state should have the same timestamp.

[0073] In this embodiment, a traversal pointer is assigned to each target dimension state change record; each target dimension state change record is traversed simultaneously through the traversal pointers, and the overall state record is generated according to the state codes traversed by the traversal pointers, so that the state of the target object is determined from multiple dimensions, meeting more complex business requirements.

[0074] Further, before the step of assigning a traversal pointer to each target dimension state change record, the method can further include: determining whether there is a truncation time point in the state change record of each target dimension; when there is a truncation time point, obtaining the state of the adjacent time point corresponding to the truncation time point from the state change record of each target dimension; and determining the state of the state change record of each target dimension at the truncation time point according to the obtained state of the adjacent time point, to complete the state change record of each target dimension.

[0075] Specifically, the redis database stores data by day, and if the state change records of each target dimension cross days, there is a truncation time point, and the state needs to be continued and completed.

[0076] The state of the adjacent time point corresponding to the truncation time point is obtained from the state change record of each target dimension; the adjacent time points refer to the two time points before and after the truncation time point, and the states of the two adjacent time points in each target dimension can be obtained through the state change record, so that the state of the truncation time point in each target dimension can be deduced through the states of the two adjacent time points in each target dimension, thereby completing the state change record of each target dimension. For example, in the online and offline dimension, if both adjacent time points are online states, the truncation time point is also an online state.

[0077] In this embodiment, when the state change record of each target dimension has a truncation time point, the state of the state change record of each target dimension at the truncation time point is determined according to the state of the adjacent time point corresponding to the truncation time point in the state change record of each target dimension, thereby completing the state change record of each target dimension, and avoiding errors in traversing the state change record.

[0078] Further, the step of generating the query result according to the overall state record can include: generating a business analysis result of the target object based on the overall state record; generating a state query result according to the overall state record and the business analysis result; and sending the state query result to a terminal logged in by the target account.

[0079] Specifically, the business analysis result of the target object is generated based on the overall state record, and the business analysis result can be generated based on a business rule, for example, when the valid state of the driver on a certain day exceeds 8 hours, a business analysis result indicating that the driver is very excellent is generated.

[0080] The state query result is generated according to the overall state record and the business analysis result, and the state query result is sent to a terminal logged in by the target account, where the target account can be an account used by a user, for example, a business personnel, to feed back the state of the target object.

[0081] In the embodiment, the business analysis result at the business level is generated based on the overall state record, the state query result is generated according to the overall state record and the business analysis result, and the state query result is sent to a terminal logged in by the target account, thereby realizing complete processing of multi-dimensional state data.

[0082] It should be emphasized that, in order to further ensure the privacy and security of the state change records of each dimension, the state change records of each dimension can also be stored in a node of a block chain.

[0083] The block chain referred to in the present application is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. The block chain is essentially a decentralized database, and is a series of data blocks associated using cryptographic methods, each data block containing information of a batch of network transactions, for verifying the validity (anti-fake) of the information and generating the next block. The block chain can include a block chain underlying platform, a platform product service layer and an application service layer, etc.

[0084] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by computer readable instructions instructing related hardware, and the computer readable instructions can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0085] It should be understood that, although each step in the flowchart of the accompanying drawings is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps.

[0086] Further referring to Figure 3 , as an implementation of the method shown in the above Figure 2 , the present application provides an embodiment of a multi-dimensional state data processing device, which corresponds to the method embodiment shown in Figure 2 , and the device can be specifically applied to various electronic devices.

[0087] As shown in Figure 3 , the multi-dimensional state data processing device 300 described in the embodiment includes a data acquisition module 301, a record generation module 302, a record storage module 303, and a record query module 304, wherein:

[0088] The data acquisition module 301 is configured to acquire multi-dimensional state data of a target object through a data consumption service.

[0089] The record generation module 302 is configured to determine a state change point in the state data of each dimension through the data consumption service, and generate a state change record according to the identified state change point.

[0090] The record storage module 303 is configured to store the state change records of each dimension to a redis database.

[0091] The record query module 304 is configured to receive a query instruction for the target object, and query the state change records in the redis database according to the query instruction to obtain a state query result.

[0092] In this embodiment, the multi-dimensional state data of the target object is acquired through the data consumption service; for each dimension, a state change point in the state data of the dimension is determined, the state change point is a time point at which the state of the target object changes in the dimension, and is a relatively key time point; a state change record is generated according to the recognized state change point, and the state change records of the dimensions are stored in the redis database, only key data in the multi-dimensional state data is saved, and the storage pressure is reduced; a query instruction for the target object is received, the state change records in the redis database are queried according to the query instruction, a state query result is obtained, and thus the state distribution of the target object in a dimension is acquired, the query and processing based on the redis improve the query speed, and thus the processing speed of the multi-dimensional state data is improved.

[0093] In some optional implementation of this embodiment, the data acquisition module 301 can include a queue access submodule and a data acquisition submodule, wherein:

[0094] The queue access submodule is configured to access the message queues through the data consumption service, wherein the data consumption service is constructed based on a spring service, and the message queues correspond to the state dimensions one by one.

[0095] The data acquisition submodule is configured to acquire the state data of the target object from the message queues respectively, and obtain the multi-dimensional state data based on the acquired state data.

[0096] In this embodiment, the message queues are accessed through the data consumption service, the data consumption service is constructed based on the spring service, and can run on multiple nodes, thereby improving the data processing efficiency; the message queues correspond to the state dimensions one by one, and thus the state data of each dimension of the target object is acquired from the message queues, and the acquisition of the multi-dimensional state data is completed.

[0097] In some optional implementation of this embodiment, the record generation module 302 can include a standard acquisition submodule, a state determination submodule, a change determination submodule, and a record generation submodule, wherein:

[0098] The standard acquisition submodule is configured to acquire, for each dimension, a state evaluation standard corresponding to the dimension.

[0099] The state determination submodule is configured to determine, according to the state evaluation standard, the state of each time point in the state data of the dimension through the data consumption service.

[0100] The change determination submodule is configured to determine, according to the state of each time point, a time point at which a state change occurs in each time point.

[0101] The record generation submodule is configured to determine a time point at which a state change occurs as a state change point, and generate a state change record according to the determined state change point, wherein the state change record includes a timestamp of the state change point and a state code.

[0102] In this embodiment, for each dimension, the corresponding state evaluation standard is obtained; the data at each time point in the state data is parsed and converted according to the state evaluation standard, to obtain a simple and readable state at each time point; the time point at which a state change occurs is determined in each time point according to the state at each time point, to obtain a state change point, and a state change record is generated according to the state change point, wherein the state change record includes a timestamp of the state change point and a state code, so that the key information in the state data is filtered and recorded.

[0103] In some optional implementation manners of this embodiment, the record query module 304 can include a query submodule and a result generation submodule, wherein:

[0104] The query submodule is configured to query the redis database according to the object identifier, the at least one target dimension, and the time information in the query instruction, to obtain the state change records of the target dimensions.

[0105] The result generation submodule is configured to perform merging calculation on the state change records of the target dimensions, to obtain an overall state record, and generate a query result according to the overall state record.

[0106] In this embodiment, the redis database is queried according to the query instruction, to obtain the state change records of the target dimensions; the state change records of the target dimensions are merged and calculated, to obtain an overall state record, and a query result is generated according to the overall state record, so that state processing is implemented on the target object from multiple dimensions.

[0107] In some optional implementation manners of this embodiment, the result generation submodule can include a pointer allocation unit and a record generation unit, wherein:

[0108] The pointer allocation unit is configured to allocate a traversal pointer to the state change record of each target dimension.

[0109] The record generation unit is configured to simultaneously traverse the state change records of the target dimensions through the traversal pointers, and generate an overall state record according to the state codes traversed by the traversal pointers.

[0110] In this embodiment, a traversal pointer is allocated to the state change record of each target dimension; the state change records of the target dimensions are simultaneously traversed through the traversal pointers, and an overall state record is generated according to the state codes traversed by the traversal pointers, so that the state of the target object is judged from multiple dimensions, to meet more complex business requirements.

[0111] In some optional implementation forms of the embodiment, the result generation sub-module can comprise a truncation judgment unit, a state acquisition unit and a record completion unit, wherein:

[0112] The truncation judgment unit is configured to judge whether there is a truncation time point in the state change record of each target dimension.

[0113] The state acquisition unit is configured to, when there is a truncation time point, acquire the state of the adjacent time point corresponding to the truncation time point from the state change record of each target dimension.

[0114] The record completion unit is configured to determine the state of each target dimension at the truncation time point according to the acquired state of the adjacent time point, so as to complete the state change record of each target dimension.

[0115] In the embodiment, when the state change record of each target dimension has a truncation time point, the state of each target dimension at the truncation time point is determined according to the state of the adjacent time point corresponding to the truncation time point in the state change record of each target dimension, so as to complete the state change record of each target dimension, thereby avoiding errors in traversing the state change record.

[0116] In some optional implementation forms of the embodiment, the result generation sub-module can further comprise an analysis generation unit, a result generation unit and a result sending unit, wherein:

[0117] The analysis generation unit is configured to generate a business analysis result of the target object based on the overall state record.

[0118] The result generation unit is configured to generate a state query result according to the overall state record and the business analysis result.

[0119] The result sending unit is configured to send the state query result to the terminal logged in by the target account.

[0120] In the embodiment, the business analysis result at the business level is generated based on the overall state record, the state query result is generated according to the overall state record and the business analysis result, and the state query result is sent to the terminal logged in by the target account, thereby realizing complete processing of multi-dimensional state data.

[0121] To solve the above technical problems, the embodiment of the present application further provides a computer device. For details, please refer to Figure 4 , Figure 4 The following is a basic structure block diagram of the computer device of the embodiment.

[0122] The computer device 4 includes a memory 41, a processor 42, and a network interface 43, which are communicatively connected via a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure, but it should be understood that not all of the shown components are required to be implemented, and more or fewer components can be alternatively implemented. Among them, those skilled in the art can understand that the computer device herein is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0123] The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server, and the like. The computer device can interact with the user through a keyboard, a mouse, a remote controller, a touchpad, a voice control device, and the like.

[0124] The memory 41 includes at least one type of readable storage medium, including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like. Of course, the memory 41 can also include both the internal storage unit and the external storage device of the computer device 4. In the present embodiment, the memory 41 is generally used to store an operating system and various application software installed in the computer device 4, such as computer readable instructions of the multi-dimensional state data processing method, and the like. In addition, the memory 41 can also be used to temporarily store various data that have been output or will be output.

[0125] The processor 42 may, in some embodiments, be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is generally used to control the overall operation of the computer device 4. In the present embodiment, the processor 42 is configured to execute computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions of the multi-dimensional state data processing method.

[0126] The network interface 43 may include a wireless network interface or a wired network interface, and is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0127] The computer device provided in the present embodiment can execute the multi-dimensional state data processing method described above. The multi-dimensional state data processing method herein can be the multi-dimensional state data processing method of any of the embodiments described above.

[0128] In the present embodiment, the multi-dimensional state data of the target object is obtained through a data consumption service. For each dimension, a state change point in the state data of the dimension is determined, the state change point being a time point at which the target object has a state change in the dimension and being a relatively critical time point. A state change record is generated according to the identified state change point, and the state change records of the dimensions are stored in a redis database. Only the key data in the multi-dimensional state data is saved, thereby reducing the storage pressure. A query instruction for the target object is received, and the state change records in the redis database are queried according to the query instruction to obtain a state query result, thereby obtaining the state distribution of the target object in a certain dimension. The query and processing based on the redis improve the query speed, thereby improving the processing speed of the multi-dimensional state data.

[0129] The present application also provides another embodiment, i.e., a computer readable storage medium storing computer readable instructions, the computer readable instructions being executable by at least one processor to cause the at least one processor to perform the steps of the multi-dimensional state data processing method as described above.

[0130] In the embodiment, the multi-dimensional state data of the target object is acquired through the data consumption service; for each dimension, a state change point in the state data of the dimension is determined, the state change point is a time point at which the target object has a state change in the dimension, and is a relatively key time point; a state change record is generated according to the recognized state change point, and the state change records of the dimensions are stored in the redis database, only key data in the multi-dimensional state data is saved, and the storage pressure is reduced; a query instruction for the target object is received, the state change records in the redis database are queried according to the query instruction, a state query result is obtained, and the state distribution of the target object in a dimension is acquired, the query and processing based on the redis improve the query speed, and thus the processing speed of the multi-dimensional state data is improved.

[0131] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device) execute the method described in each embodiment of the present application.

[0132] Obviously, the above-described embodiments are only some embodiments of the present application, not all embodiments, and the preferred embodiments of the present application are given in the drawings, but do not limit the patent scope of the present application. The present application can be implemented in many different forms, and conversely, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing specific embodiments, or make equivalent replacements to some technical features. Any equivalent structure made by using the content of the specification and drawings, directly or indirectly applied to other related technical fields, is also within the scope of the patent protection of the present application.

Claims

1. A multi-dimensional state data processing method, characterized by, The method comprises the following steps: acquiring multi-dimensional state data of a target object through a data consumption service; for each dimension, determining a state change point in the state data of the dimension through the data consumption service, and generating a state change record according to the identified state change point; storing the state change records of each dimension into a redis database; receiving a query instruction for the target object, and querying the state change records in the redis database according to the query instruction to obtain a state query result; wherein, for each dimension, the step of determining a state change point in the state data of the dimension through the data consumption service, and generating a state change record according to the identified state change point comprises: for each dimension, acquiring a state evaluation standard corresponding to the dimension; determining the state of each time point in the state data of the dimension through the data consumption service according to the state evaluation standard; determining a time point at which a state change occurs among the time points according to the states of the time points; determining the time point at which a state change occurs as a state change point, and generating a state change record according to the determined state change point, the state change record containing a timestamp and a state code of the state change point; the step of querying the state change records in the redis database according to the query instruction to obtain a state query result comprises: querying the redis database according to the object identifier, at least one target dimension and time information in the query instruction to obtain the state change records of each target dimension; merging and calculating the state change records of each target dimension to obtain an overall state record, and generating a query result according to the overall state record; the step of merging and calculating the state change records of each target dimension to obtain an overall state record comprises: allocating a traversal pointer to the state change record of each target dimension; simultaneously traversing the state change records of each target dimension through the traversal pointers, and generating an overall state record according to the state codes traversed by the traversal pointers, comprising: mapping the state change record into a one-dimensional line segment representation, the line segment containing valid sub-line segments and invalid sub-line segments, the state code of the valid sub-line segment being recorded as 1, and the state code of the invalid sub-line segment being recorded as 0, moving the traversal pointer on the line segment to obtain the state code; determining whether the current state of the target object is valid according to the state code, wherein when the state codes of each target dimension are all valid, the state change record is valid, otherwise, the state change record is invalid; combining the state change records of each target dimension into one dimension for calculation to obtain an overall state record.

2. The multi-dimensional state data processing method of claim 1, wherein, the step of acquiring multi-dimensional state data of a target object through a data consumption service comprises: accessing each message queue through a data consumption service, wherein the data consumption service is built based on a spring service, and the message queue corresponds to a state dimension one by one; acquiring state data of a target object from each message queue, and obtaining multi-dimensional state data based on the acquired state data.

3. The multi-dimensional state data processing method of claim 1, wherein, Before the step of assigning a traversal pointer to each target dimension state change record, further comprising: determining whether there is a truncation time point in each target dimension state change record; when there is a truncation time point, obtaining the state of the adjacent time point corresponding to the truncation time point from the state change record of each target dimension; determining the state of the state change record of each target dimension at the truncation time point according to the obtained state of the adjacent time point, so as to complete the state change record of each target dimension.

4. The multi-dimensional state data processing method of claim 1, wherein, The step of generating a query result according to the overall state record comprises: generating a business analysis result of the target object based on the overall state record; generating a state query result according to the overall state record and the business analysis result; sending the state query result to the terminal logged in by the target account.

5. A multi-dimensional state data processing apparatus, characterized by comprising: Comprise: a data acquisition module for acquiring multi-dimensional state data of a target object through a data consumption service; a record generation module for determining a state change point in the state data of each dimension through the data consumption service, and generating a state change record according to the identified state change point; a record storage module for storing the state change record of each dimension in a redis database; a record query module for receiving a query instruction for the target object, and querying the state change record in the redis database according to the query instruction to obtain a state query result; wherein the record generation module comprises a standard acquisition submodule, a state determination submodule, a change determination submodule and a record generation submodule; the standard acquisition submodule is used to acquire a state evaluation standard corresponding to each dimension; the state determination submodule is used to determine the state of each time point in the state data of the dimension through the data consumption service according to the state evaluation standard; the change determination submodule is used to determine the time point of state change in each time point according to the state of each time point; the record generation submodule is used to determine the time point of state change as a state change point, and generate a state change record according to the determined state change point, the state change record containing the timestamp and state code of the state change point; wherein the record query module comprises a query submodule and a result generation submodule; the query submodule is used to query the redis database according to the object identifier, at least one target dimension and time information in the query instruction to obtain the state change record of each target dimension; the result generation submodule is used to merge and calculate the state change record of each target dimension to obtain an overall state record, and generate a query result according to the overall state record; the result generation submodule further comprises a pointer assignment unit and a record generation unit; the pointer assignment unit is used to assign a traversal pointer to each target dimension state change record; The record generating unit is configured to simultaneously traverse the state change records of each target dimension through each traversal pointer, and generate an overall state record according to the state codes traversed by each traversal pointer, including: mapping the state change records into a one-dimensional line segment representation, the line segment including valid sub-line segments and invalid sub-line segments, the state code of the valid sub-line segment being recorded as 1, and the state code of the invalid sub-line segment being recorded as 0, the traversal pointer moving on the line segment to obtain the state code; judging whether the current state of the target object is valid according to the state code, wherein when the state codes of each target dimension are all valid, the state change record is valid, otherwise, the state change record is invalid; and combining the state change records of each target dimension into one dimension for calculation to obtain the overall state record. 6.A computer device, comprising a memory and a processor, wherein the memory stores computer readable instructions, and the processor executes the computer readable instructions to implement the steps of the multi-dimensional state data processing method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by the processor to implement the steps of the multi-dimensional state data processing method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Vehicle abnormity monitoring method and device and server

    CN114997801A